diff options
author | Geir Storli <geirst@yahooinc.com> | 2022-10-10 15:20:17 +0000 |
---|---|---|
committer | Geir Storli <geirst@yahooinc.com> | 2022-10-10 15:21:24 +0000 |
commit | ab10d27bd029f73d82dabd1f3fdb839edae29e61 (patch) | |
tree | bab1c9ca156af7d94b3583d6244a1c09c72e2a81 /searchcore | |
parent | 08f7a121fff008dd1307b106bd1b7d7a84433fe6 (diff) |
Implement GenerationHolder in terms of the generic generation hold list.
Diffstat (limited to 'searchcore')
3 files changed, 7 insertions, 7 deletions
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<search::AttributeSaver> @@ -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<ShrinkBlockHeld>(*this); - getGenerationHolder().hold(std::move(hold)); + getGenerationHolder().insert(std::move(hold)); incGeneration(); } |