| 591 | } |
| 592 | |
| 593 | Status 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 | |
| 608 | Status BlockCache::remove(HashedKey hk) { |
| 609 | auto start = getSteadyClock(); |