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

Method Lookup

src/leveldb/persistent_cache/persistent_cache_metadata.cc:20–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18}
19
20PersistentCacheMetaData::CacheFileWrapper PersistentCacheMetaData::Lookup(uint64_t cache_id) {
21 CacheFile* ret = nullptr;
22 CacheFile lookup_key(cache_id);
23 bool ok = cache_file_index_.Find(&lookup_key, &ret);
24 if (ok) {
25 assert(ret->refs_);
26 return CacheFileWrapper{ret, [](CacheFile* f) { --f->refs_; }};
27 }
28 return nullptr;
29}
30
31CacheFile* PersistentCacheMetaData::Evict() {
32 CacheFile* evicted_file = nullptr;

Callers 3

IsCacheFileMethod · 0.45
ReadMethod · 0.45
InsertMethod · 0.45

Calls 2

FindMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected