MCPcopy Create free account
hub / github.com/baidu/tera / RemoveFileInfo

Method RemoveFileInfo

src/leveldb/persistent_cache/persistent_cache_metadata.cc:112–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110}
111
112void 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
130Status PersistentCacheMetaData::Init(uint64_t* recovered_cache_id, PersistentCacheImpl* cache) {
131 Options opt;

Callers

nothing calls this directly

Calls 3

InfoMethod · 0.80
EraseMethod · 0.45
DeleteMethod · 0.45

Tested by

no test coverage detected