| 1033 | } |
| 1034 | |
| 1035 | void DataCache::Partition::DeleteOldFiles() { |
| 1036 | std::unique_lock<SpinLock> partition_lock(lock_); |
| 1037 | if (UNLIKELY(files_readonly_)) return; |
| 1038 | DCHECK_GE(oldest_opened_file_, 0); |
| 1039 | int target = cache_files_.size() - FLAGS_data_cache_max_opened_files; |
| 1040 | while (oldest_opened_file_ < target) { |
| 1041 | cache_files_[oldest_opened_file_++]->DeleteFile(); |
| 1042 | } |
| 1043 | } |
| 1044 | |
| 1045 | void DataCache::Partition::SetCacheFilesReadOnly() { |
| 1046 | std::unique_lock<SpinLock> partition_lock(lock_); |
nothing calls this directly
no test coverage detected