| 110 | } |
| 111 | |
| 112 | void PersistentCacheMetaData::RemoveFileInfo(CacheFile* f) { |
| 113 | FileInfo* tmp = nullptr; |
| 114 | auto f_info = f->Info(); |
| 115 | if (f_info) { |
| 116 | auto status = cache_id_index_.Erase(f_info, &tmp); |
| 117 | { |
| 118 | std::lock_guard<std::mutex> _(keys_lock_); |
| 119 | keys_.erase(f_info->key_); |
| 120 | } |
| 121 | assert(status); |
| 122 | assert(tmp == f_info); |
| 123 | db_->Delete({}, f_info->key_); |
| 124 | LEVELDB_LOG("Remove file from persistent cache: %s\n", f_info->key_.c_str()); |
| 125 | delete f_info; |
| 126 | } |
| 127 | // assert(f_info); |
| 128 | } |
| 129 | |
| 130 | Status PersistentCacheMetaData::Init(uint64_t* recovered_cache_id, PersistentCacheImpl* cache) { |
| 131 | Options opt; |