MCPcopy Create free account
hub / github.com/facebook/CacheLib / removeImpl

Method removeImpl

cachelib/navy/block_cache/BlockCache.cpp:593–606  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

591}
592
593Status BlockCache::removeImpl(const HashedKey& hk, BufferView value) {
594 auto lr = index_->remove(hk.keyHash());
595 if (lr.found()) {
596 uint64_t removedObjectSize = decodeSizeHint(lr.sizeHint());
597 addHole(removedObjectSize);
598 usedSizeBytes_.sub(removedObjectSize);
599 succRemoveCount_.inc();
600 if (!value.isNull() && destructorCb_) {
601 destructorCb_(hk, value, DestructorEvent::Removed);
602 }
603 return Status::Ok;
604 }
605 return Status::NotFound;
606}
607
608Status BlockCache::remove(HashedKey hk) {
609 auto start = getSteadyClock();

Callers

nothing calls this directly

Calls 7

foundMethod · 0.80
sizeHintMethod · 0.80
removeMethod · 0.45
keyHashMethod · 0.45
subMethod · 0.45
incMethod · 0.45
isNullMethod · 0.45

Tested by

no test coverage detected