| 1131 | } |
| 1132 | |
| 1133 | Status DataCache::Partition::LoadCacheFiles(const DumpData& dump_data) { |
| 1134 | lock_.DCheckLocked(); |
| 1135 | cache_files_.clear(); |
| 1136 | for (const DumpData::CacheFileData& file_data : dump_data.cache_files_data) { |
| 1137 | unique_ptr<CacheFile> cache_file; |
| 1138 | RETURN_IF_ERROR(CacheFile::Open(file_data.path, file_data.allow_append, |
| 1139 | file_data.current_offset, &cache_file)); |
| 1140 | if (file_data.mtime != cache_file->mtime()) { |
| 1141 | return Status("The actual mtime of the cache file does not match the dumped data."); |
| 1142 | } |
| 1143 | cache_files_.emplace_back(std::move(cache_file)); |
| 1144 | } |
| 1145 | if (cache_files_.empty()) { |
| 1146 | return Status("No cache files loaded."); |
| 1147 | } |
| 1148 | oldest_opened_file_ = 0; |
| 1149 | return Status::OK(); |
| 1150 | } |
| 1151 | |
| 1152 | Status DataCache::Partition::DumpMetaCache(DumpData& dump_data) { |
| 1153 | lock_.DCheckLocked(); |