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

Method InsertWithoutPutDb

src/leveldb/persistent_cache/persistent_cache_metadata.cc:64–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64FileInfo* PersistentCacheMetaData::InsertWithoutPutDb(const Slice& key, uint64_t cache_id) {
65 std::unique_ptr<FileInfo> f_info(new FileInfo(key, cache_id));
66 if (!cache_id_index_.Insert(f_info.get())) {
67 LEVELDB_LOG("Insert key failed %s , cache_id %lu\n", key.ToString().c_str(), cache_id);
68 return nullptr;
69 } else {
70 std::lock_guard<std::mutex> _(keys_lock_);
71 keys_.emplace(key.ToString());
72 }
73 return f_info.release();
74}
75
76FileInfo* PersistentCacheMetaData::Insert(const Slice& key, CacheFile* cache_file) {
77 auto finfo = InsertWithoutPutDb(key, cache_file->cacheid());

Callers

nothing calls this directly

Calls 4

InsertMethod · 0.45
getMethod · 0.45
ToStringMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected