diff options
author | Geir Storli <geirst@yahooinc.com> | 2022-10-12 13:03:52 +0000 |
---|---|---|
committer | Geir Storli <geirst@yahooinc.com> | 2022-10-12 13:38:37 +0000 |
commit | 462073020110f8343553cdbc1d5e264c67942c7d (patch) | |
tree | 1e3b6603c4b45fd3b06e5067b18d76f1c0d4f87e /searchcore | |
parent | 06f895593abd5bf49ba181e697bf3a1c68fb870a (diff) |
Rename trimHoldLists() -> reclaim_memory().
Diffstat (limited to 'searchcore')
6 files changed, 13 insertions, 13 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 157d10e6652..8d8674da4f0 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 @@ -66,8 +66,8 @@ protected: _allocator.holdLids(lids, get_size(), 0); } - void trim_hold_lists() { - _allocator.trimHoldLists(1); + void reclaim_memory() { + _allocator.reclaim_memory(1); } std::vector<uint32_t> get_valid_lids() { @@ -117,7 +117,7 @@ TEST_F(LidAllocatorTest, unregister_lids) assert_valid_lids({2, 4, 6}); assert_active_lids({4, 6}); hold_lids({1, 3, 5}); - trim_hold_lists(); + reclaim_memory(); EXPECT_EQ((std::vector<uint32_t>{1, 3, 5, 7, 8}), alloc_lids(5)); } 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 68958bbe3e4..cbc11126b25 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 @@ -47,7 +47,7 @@ TEST_F(LidStateVectorTest, basic_free_list_is_working) EXPECT_EQ(0u, freeLids.count()); EXPECT_EQ(3u, list.size()); - list.trimHoldLists(20, freeLids); + list.reclaim_memory(20, freeLids); EXPECT_FALSE(freeLids.empty()); EXPECT_EQ(1u, freeLids.count()); @@ -57,7 +57,7 @@ TEST_F(LidStateVectorTest, basic_free_list_is_working) EXPECT_EQ(0u, freeLids.count()); EXPECT_EQ(2u, list.size()); - list.trimHoldLists(31, freeLids); + list.reclaim_memory(31, freeLids); EXPECT_FALSE(freeLids.empty()); EXPECT_EQ(2u, freeLids.count()); diff --git a/searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastore.cpp b/searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastore.cpp index 2dc804404b2..c6ef6994b81 100644 --- a/searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastore.cpp +++ b/searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastore.cpp @@ -252,8 +252,8 @@ DocumentMetaStore::onGenerationChange(generation_t generation) void DocumentMetaStore::removeOldGenerations(generation_t firstUsed) { - _gidToLidMap.getAllocator().trimHoldLists(firstUsed); - _lidAlloc.trimHoldLists(firstUsed); + _gidToLidMap.getAllocator().reclaim_memory(firstUsed); + _lidAlloc.reclaim_memory(firstUsed); getGenerationHolder().reclaim(firstUsed); } diff --git a/searchcore/src/vespa/searchcore/proton/documentmetastore/lid_allocator.h b/searchcore/src/vespa/searchcore/proton/documentmetastore/lid_allocator.h index 6118701b0dc..95a8cf85279 100644 --- a/searchcore/src/vespa/searchcore/proton/documentmetastore/lid_allocator.h +++ b/searchcore/src/vespa/searchcore/proton/documentmetastore/lid_allocator.h @@ -41,8 +41,8 @@ public: void unregisterLid(DocId lid); void unregister_lids(const std::vector<DocId>& lids); size_t getUsedLidsSize() const { return _usedLids.byteSize(); } - void trimHoldLists(generation_t firstUsed) { - _holdLids.trimHoldLists(firstUsed, _freeLids); + void reclaim_memory(generation_t oldest_used_gen) { + _holdLids.reclaim_memory(oldest_used_gen, _freeLids); } void moveLidBegin(DocId fromLid, DocId toLid); void moveLidEnd(DocId fromLid, DocId toLid); diff --git a/searchcore/src/vespa/searchcore/proton/documentmetastore/lid_hold_list.cpp b/searchcore/src/vespa/searchcore/proton/documentmetastore/lid_hold_list.cpp index 7157a40c5d5..ef0a244fc37 100644 --- a/searchcore/src/vespa/searchcore/proton/documentmetastore/lid_hold_list.cpp +++ b/searchcore/src/vespa/searchcore/proton/documentmetastore/lid_hold_list.cpp @@ -23,9 +23,9 @@ LidHoldList::clear() { } void -LidHoldList::trimHoldLists(generation_t firstUsed, LidStateVector &freeLids) +LidHoldList::reclaim_memory(generation_t oldest_used_gen, LidStateVector &freeLids) { - while (!_holdList.empty() && _holdList.front().second < firstUsed) { + while (!_holdList.empty() && _holdList.front().second < oldest_used_gen) { uint32_t lid = _holdList.front().first; freeLids.setBit(lid); _holdList.pop_front(); diff --git a/searchcore/src/vespa/searchcore/proton/documentmetastore/lid_hold_list.h b/searchcore/src/vespa/searchcore/proton/documentmetastore/lid_hold_list.h index fc32fcb7510..565d8bf25e1 100644 --- a/searchcore/src/vespa/searchcore/proton/documentmetastore/lid_hold_list.h +++ b/searchcore/src/vespa/searchcore/proton/documentmetastore/lid_hold_list.h @@ -43,9 +43,9 @@ public: void clear(); /** - * Frees up elements with generation < first used generation for reuse. + * Frees up elements with generation < oldest used generation for reuse. **/ - void trimHoldLists(generation_t firstUsed, LidStateVector &freeLids); + void reclaim_memory(generation_t oldest_used_gen, LidStateVector &freeLids); }; |