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

Method GarbageCollect

src/leveldb/persistent_cache/persistent_cache_impl.cc:350–357  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

348}
349
350void PersistentCacheImpl::GarbageCollect() {
351 std::vector<std::unique_ptr<CacheFile>> evictable_files = metadata_.CollectEvictableFiles();
352 for (auto& file : evictable_files) {
353 assert(!file->refs_);
354 DeleteFileAndReleaseCache(file.get());
355 LEVELDB_LOG("Remove evictable file in GC: %lu.rc.", file->cacheid());
356 }
357}
358
359Status NewPersistentCache(const PersistentCacheConfig& config,
360 std::shared_ptr<PersistentCache>* cache) {

Callers

nothing calls this directly

Calls 3

CollectEvictableFilesMethod · 0.80
cacheidMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected