From ab10d27bd029f73d82dabd1f3fdb839edae29e61 Mon Sep 17 00:00:00 2001 From: Geir Storli Date: Mon, 10 Oct 2022 15:20:17 +0000 Subject: Implement GenerationHolder in terms of the generic generation hold list. --- .../documentmetastore/lid_allocator/lid_allocator_test.cpp | 2 +- .../lid_state_vector/lid_state_vector_test.cpp | 2 +- .../searchcore/proton/documentmetastore/documentmetastore.cpp | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'searchcore') diff --git a/searchcore/src/tests/proton/documentmetastore/lid_allocator/lid_allocator_test.cpp b/searchcore/src/tests/proton/documentmetastore/lid_allocator/lid_allocator_test.cpp index 2d675e82db2..157d10e6652 100644 --- a/searchcore/src/tests/proton/documentmetastore/lid_allocator/lid_allocator_test.cpp +++ b/searchcore/src/tests/proton/documentmetastore/lid_allocator/lid_allocator_test.cpp @@ -28,7 +28,7 @@ protected: ~LidAllocatorTest() { - _gen_hold.clearHoldLists(); + _gen_hold.reclaim_all(); } uint32_t get_size() { return _allocator.getActiveLids().size(); } diff --git a/searchcore/src/tests/proton/documentmetastore/lid_state_vector/lid_state_vector_test.cpp b/searchcore/src/tests/proton/documentmetastore/lid_state_vector/lid_state_vector_test.cpp index ab45cca0971..68958bbe3e4 100644 --- a/searchcore/src/tests/proton/documentmetastore/lid_state_vector/lid_state_vector_test.cpp +++ b/searchcore/src/tests/proton/documentmetastore/lid_state_vector/lid_state_vector_test.cpp @@ -22,7 +22,7 @@ protected: ~LidStateVectorTest() { - _gen_hold.clearHoldLists(); + _gen_hold.reclaim_all(); } }; diff --git a/searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastore.cpp b/searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastore.cpp index b1b5f45a8fa..1853e939d42 100644 --- a/searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastore.cpp +++ b/searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastore.cpp @@ -224,7 +224,7 @@ DocumentMetaStore::onUpdateStat() { auto &compaction_strategy = getConfig().getCompactionStrategy(); vespalib::MemoryUsage usage = _metaDataStore.getMemoryUsage(); - usage.incAllocatedBytesOnHold(getGenerationHolder().getHeldBytes()); + usage.incAllocatedBytesOnHold(getGenerationHolder().get_held_bytes()); size_t bvSize = _lidAlloc.getUsedLidsSize(); usage.incAllocatedBytes(bvSize); usage.incUsedBytes(bvSize); @@ -245,7 +245,7 @@ DocumentMetaStore::onGenerationChange(generation_t generation) { _gidToLidMap.getAllocator().freeze(); _gidToLidMap.getAllocator().transferHoldLists(generation - 1); - getGenerationHolder().transferHoldLists(generation - 1); + getGenerationHolder().assign_generation(generation - 1); updateStat(false); } @@ -254,7 +254,7 @@ DocumentMetaStore::removeOldGenerations(generation_t firstUsed) { _gidToLidMap.getAllocator().trimHoldLists(firstUsed); _lidAlloc.trimHoldLists(firstUsed); - getGenerationHolder().trimHoldLists(firstUsed); + getGenerationHolder().reclaim(firstUsed); } std::unique_ptr @@ -442,7 +442,7 @@ DocumentMetaStore::~DocumentMetaStore() // TODO: Properly notify about modified buckets when using shared bucket db // between document types unload(); - getGenerationHolder().clearHoldLists(); + getGenerationHolder().reclaim_all(); assert(get_shrink_lid_space_blockers() == 0); } @@ -1009,7 +1009,7 @@ DocumentMetaStore::holdUnblockShrinkLidSpace() { assert(get_shrink_lid_space_blockers() > 0); auto hold = std::make_unique(*this); - getGenerationHolder().hold(std::move(hold)); + getGenerationHolder().insert(std::move(hold)); incGeneration(); } -- cgit v1.2.3