diff options
author | Geir Storli <geirst@yahooinc.com> | 2022-10-12 16:05:19 +0000 |
---|---|---|
committer | Geir Storli <geirst@yahooinc.com> | 2022-10-12 16:21:01 +0000 |
commit | 9f930c426fd9804bdba41b3114b1ba9cd0a955db (patch) | |
tree | be8e0f469757ac537833d90dcbf533ed23225fd1 | |
parent | 8273895eb7fdc6d681b3f24096be129248f3d5c3 (diff) |
Rename removeOldGenerations() -> reclaim_memory().
42 files changed, 79 insertions, 79 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastore.cpp b/searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastore.cpp index 0a3d0192d81..ead9f142508 100644 --- a/searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastore.cpp +++ b/searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastore.cpp @@ -250,11 +250,11 @@ DocumentMetaStore::before_inc_generation(generation_t current_gen) } void -DocumentMetaStore::removeOldGenerations(generation_t firstUsed) +DocumentMetaStore::reclaim_memory(generation_t oldest_used_gen) { - _gidToLidMap.getAllocator().reclaim_memory(firstUsed); - _lidAlloc.reclaim_memory(firstUsed); - getGenerationHolder().reclaim(firstUsed); + _gidToLidMap.getAllocator().reclaim_memory(oldest_used_gen); + _lidAlloc.reclaim_memory(oldest_used_gen); + getGenerationHolder().reclaim(oldest_used_gen); } std::unique_ptr<search::AttributeSaver> diff --git a/searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastore.h b/searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastore.h index b6f907c26d5..2dc85f07cf4 100644 --- a/searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastore.h +++ b/searchcore/src/vespa/searchcore/proton/documentmetastore/documentmetastore.h @@ -94,7 +94,7 @@ private: // Implements AttributeVector void before_inc_generation(generation_t current_gen) override; - void removeOldGenerations(generation_t firstUsed) override; + void reclaim_memory(generation_t oldest_used_gen) override; std::unique_ptr<search::AttributeSaver> onInitSave(vespalib::stringref fileName) override; bool onLoad(vespalib::Executor *executor) override; diff --git a/searchlib/src/tests/attribute/multi_value_mapping/multi_value_mapping_test.cpp b/searchlib/src/tests/attribute/multi_value_mapping/multi_value_mapping_test.cpp index 35758ce7c08..8b8f4d2c4d4 100644 --- a/searchlib/src/tests/attribute/multi_value_mapping/multi_value_mapping_test.cpp +++ b/searchlib/src/tests/attribute/multi_value_mapping/multi_value_mapping_test.cpp @@ -41,8 +41,8 @@ class MyAttribute : public search::NotImplementedAttribute _mvMapping.shrink(committedDocIdLimit); setNumDocs(committedDocIdLimit); } - virtual void removeOldGenerations(generation_t firstUsed) override { - _mvMapping.reclaim_memory(firstUsed); + virtual void reclaim_memory(generation_t oldest_used_gen) override { + _mvMapping.reclaim_memory(oldest_used_gen); } virtual void before_inc_generation(generation_t current_gen) override { _mvMapping.assign_generation(current_gen); diff --git a/searchlib/src/tests/attribute/postinglist/postinglist.cpp b/searchlib/src/tests/attribute/postinglist/postinglist.cpp index e41aaec351e..1eed3a015e1 100644 --- a/searchlib/src/tests/attribute/postinglist/postinglist.cpp +++ b/searchlib/src/tests/attribute/postinglist/postinglist.cpp @@ -201,7 +201,7 @@ private: PostingListNodeAllocator &postingsAlloc); void - removeOldGenerations(Tree &tree, + reclaim_memory(Tree &tree, ValueHandle &valueHandle, PostingList &postings, PostingListNodeAllocator &postingsAlloc); @@ -665,7 +665,7 @@ bumpGeneration(Tree &tree, void AttributePostingListTest:: -removeOldGenerations(Tree &tree, +reclaim_memory(Tree &tree, ValueHandle &valueHandle, PostingList &postings, PostingListNodeAllocator &postingsAlloc) diff --git a/searchlib/src/vespa/searchlib/attribute/attributevector.cpp b/searchlib/src/vespa/searchlib/attribute/attributevector.cpp index 3d557f3380c..100470b5a5f 100644 --- a/searchlib/src/vespa/searchlib/attribute/attributevector.cpp +++ b/searchlib/src/vespa/searchlib/attribute/attributevector.cpp @@ -237,7 +237,7 @@ AttributeVector::headerTypeOK(const vespalib::GenericHeader &header) const getConfig().collectionType().asString(); } -void AttributeVector::removeOldGenerations(generation_t firstUsed) { (void) firstUsed; } +void AttributeVector::reclaim_memory(generation_t oldest_used_gen) { (void) oldest_used_gen; } void AttributeVector::before_inc_generation(generation_t current_gen) { (void) current_gen; } const IEnumStore* AttributeVector::getEnumStoreBase() const { return nullptr; } IEnumStore* AttributeVector::getEnumStoreBase() { return nullptr; } @@ -410,7 +410,7 @@ bool AttributeVector::applyWeight(DocId, const FieldValue&, const AssignValueUpd void AttributeVector::removeAllOldGenerations() { _genHandler.update_oldest_used_generation(); - removeOldGenerations(_genHandler.get_oldest_used_generation()); + reclaim_memory(_genHandler.get_oldest_used_generation()); } diff --git a/searchlib/src/vespa/searchlib/attribute/attributevector.h b/searchlib/src/vespa/searchlib/attribute/attributevector.h index 56bc8688905..6963814be0c 100644 --- a/searchlib/src/vespa/searchlib/attribute/attributevector.h +++ b/searchlib/src/vespa/searchlib/attribute/attributevector.h @@ -446,7 +446,7 @@ private: GenerationHandler::Guard takeGenerationGuard() { return _genHandler.takeGuard(); } /// Clean up [0, firstUsed> - virtual void removeOldGenerations(generation_t firstUsed); + virtual void reclaim_memory(generation_t oldest_used_gen); virtual void before_inc_generation(generation_t current_gen); virtual void onUpdateStat() = 0; /** diff --git a/searchlib/src/vespa/searchlib/attribute/flagattribute.cpp b/searchlib/src/vespa/searchlib/attribute/flagattribute.cpp index df75b0ab4e5..f8cf742bdb2 100644 --- a/searchlib/src/vespa/searchlib/attribute/flagattribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/flagattribute.cpp @@ -229,10 +229,10 @@ FlagAttributeT<B>::resizeBitVectors(uint32_t neededSize) template <typename B> void -FlagAttributeT<B>::removeOldGenerations(vespalib::GenerationHandler::generation_t firstUsed) +FlagAttributeT<B>::reclaim_memory(vespalib::GenerationHandler::generation_t oldest_used_gen) { - B::removeOldGenerations(firstUsed); - _bitVectorHolder.reclaim(firstUsed); + B::reclaim_memory(oldest_used_gen); + _bitVectorHolder.reclaim(oldest_used_gen); } template class FlagAttributeT<FlagBaseImpl>; diff --git a/searchlib/src/vespa/searchlib/attribute/flagattribute.h b/searchlib/src/vespa/searchlib/attribute/flagattribute.h index 796c1493cc9..df75e7afa04 100644 --- a/searchlib/src/vespa/searchlib/attribute/flagattribute.h +++ b/searchlib/src/vespa/searchlib/attribute/flagattribute.h @@ -33,7 +33,7 @@ private: void ensureGuardBit(); void clearGuardBit(DocId doc); void resizeBitVectors(uint32_t neededSize); - void removeOldGenerations(vespalib::GenerationHandler::generation_t firstUsed) override; + void reclaim_memory(vespalib::GenerationHandler::generation_t oldest_used_gen) override; uint32_t getOffset(int8_t value) const { return value + 128; } using AtomicBitVectorPtr = vespalib::datastore::AtomicValueWrapper<BitVector *>; diff --git a/searchlib/src/vespa/searchlib/attribute/multienumattribute.h b/searchlib/src/vespa/searchlib/attribute/multienumattribute.h index f7a13fc71b1..a073060afc5 100644 --- a/searchlib/src/vespa/searchlib/attribute/multienumattribute.h +++ b/searchlib/src/vespa/searchlib/attribute/multienumattribute.h @@ -63,7 +63,7 @@ public: void onCommit() override; void onUpdateStat() override; - void removeOldGenerations(generation_t firstUsed) override; + void reclaim_memory(generation_t oldest_used_gen) override; void before_inc_generation(generation_t current_gen) override; //----------------------------------------------------------------------------------------------------------------- diff --git a/searchlib/src/vespa/searchlib/attribute/multienumattribute.hpp b/searchlib/src/vespa/searchlib/attribute/multienumattribute.hpp index 66bc21748e4..4dad82073e0 100644 --- a/searchlib/src/vespa/searchlib/attribute/multienumattribute.hpp +++ b/searchlib/src/vespa/searchlib/attribute/multienumattribute.hpp @@ -194,10 +194,10 @@ MultiValueEnumAttribute<B, M>::onUpdateStat() template <typename B, typename M> void -MultiValueEnumAttribute<B, M>::removeOldGenerations(generation_t firstUsed) +MultiValueEnumAttribute<B, M>::reclaim_memory(generation_t oldest_used_gen) { - this->_enumStore.reclaim_memory(firstUsed); - this->_mvMapping.reclaim_memory(firstUsed); + this->_enumStore.reclaim_memory(oldest_used_gen); + this->_mvMapping.reclaim_memory(oldest_used_gen); } template <typename B, typename M> diff --git a/searchlib/src/vespa/searchlib/attribute/multinumericattribute.h b/searchlib/src/vespa/searchlib/attribute/multinumericattribute.h index 0a7b579e6b3..ed78f7776f1 100644 --- a/searchlib/src/vespa/searchlib/attribute/multinumericattribute.h +++ b/searchlib/src/vespa/searchlib/attribute/multinumericattribute.h @@ -60,7 +60,7 @@ public: uint32_t getValueCount(DocId doc) const override; void onCommit() override; void onUpdateStat() override; - void removeOldGenerations(generation_t firstUsed) override; + void reclaim_memory(generation_t oldest_used_gen) override; void before_inc_generation(generation_t current_gen) override; bool onLoad(vespalib::Executor *executor) override; diff --git a/searchlib/src/vespa/searchlib/attribute/multinumericattribute.hpp b/searchlib/src/vespa/searchlib/attribute/multinumericattribute.hpp index 0791ee60147..b746fa5d555 100644 --- a/searchlib/src/vespa/searchlib/attribute/multinumericattribute.hpp +++ b/searchlib/src/vespa/searchlib/attribute/multinumericattribute.hpp @@ -96,9 +96,9 @@ void MultiValueNumericAttribute<B, M>::setNewValues(DocId doc, const std::vector } template <typename B, typename M> -void MultiValueNumericAttribute<B, M>::removeOldGenerations(generation_t firstUsed) +void MultiValueNumericAttribute<B, M>::reclaim_memory(generation_t oldest_used_gen) { - this->_mvMapping.reclaim_memory(firstUsed); + this->_mvMapping.reclaim_memory(oldest_used_gen); } diff --git a/searchlib/src/vespa/searchlib/attribute/multinumericpostattribute.h b/searchlib/src/vespa/searchlib/attribute/multinumericpostattribute.h index 6ef2547934d..a22a6241ab2 100644 --- a/searchlib/src/vespa/searchlib/attribute/multinumericpostattribute.h +++ b/searchlib/src/vespa/searchlib/attribute/multinumericpostattribute.h @@ -80,7 +80,7 @@ public: MultiValueNumericPostingAttribute(const vespalib::string & name, const AttributeVector::Config & cfg); ~MultiValueNumericPostingAttribute(); - void removeOldGenerations(generation_t firstUsed) override; + void reclaim_memory(generation_t oldest_used_gen) override; void before_inc_generation(generation_t current_gen) override; std::unique_ptr<attribute::SearchContext> diff --git a/searchlib/src/vespa/searchlib/attribute/multinumericpostattribute.hpp b/searchlib/src/vespa/searchlib/attribute/multinumericpostattribute.hpp index 3117cdd8442..deee72dcf39 100644 --- a/searchlib/src/vespa/searchlib/attribute/multinumericpostattribute.hpp +++ b/searchlib/src/vespa/searchlib/attribute/multinumericpostattribute.hpp @@ -56,10 +56,10 @@ MultiValueNumericPostingAttribute<B, M>::~MultiValueNumericPostingAttribute() template <typename B, typename M> void -MultiValueNumericPostingAttribute<B, M>::removeOldGenerations(generation_t firstUsed) +MultiValueNumericPostingAttribute<B, M>::reclaim_memory(generation_t oldest_used_gen) { - MultiValueNumericEnumAttribute<B, M>::removeOldGenerations(firstUsed); - _postingList.reclaim_memory(firstUsed); + MultiValueNumericEnumAttribute<B, M>::reclaim_memory(oldest_used_gen); + _postingList.reclaim_memory(oldest_used_gen); } template <typename B, typename M> diff --git a/searchlib/src/vespa/searchlib/attribute/multistringpostattribute.h b/searchlib/src/vespa/searchlib/attribute/multistringpostattribute.h index c1996e9c868..2e355a9aed2 100644 --- a/searchlib/src/vespa/searchlib/attribute/multistringpostattribute.h +++ b/searchlib/src/vespa/searchlib/attribute/multistringpostattribute.h @@ -77,7 +77,7 @@ public: MultiValueStringPostingAttributeT(const vespalib::string & name); ~MultiValueStringPostingAttributeT(); - void removeOldGenerations(generation_t firstUsed) override; + void reclaim_memory(generation_t oldest_used_gen) override; void before_inc_generation(generation_t current_gen) override; std::unique_ptr<attribute::SearchContext> diff --git a/searchlib/src/vespa/searchlib/attribute/multistringpostattribute.hpp b/searchlib/src/vespa/searchlib/attribute/multistringpostattribute.hpp index dd3aa2d6117..cfd00f84636 100644 --- a/searchlib/src/vespa/searchlib/attribute/multistringpostattribute.hpp +++ b/searchlib/src/vespa/searchlib/attribute/multistringpostattribute.hpp @@ -75,10 +75,10 @@ MultiValueStringPostingAttributeT<B, T>::mergeMemoryStats(vespalib::MemoryUsage template <typename B, typename T> void -MultiValueStringPostingAttributeT<B, T>::removeOldGenerations(generation_t firstUsed) +MultiValueStringPostingAttributeT<B, T>::reclaim_memory(generation_t oldest_used_gen) { - MultiValueStringAttributeT<B, T>::removeOldGenerations(firstUsed); - _postingList.reclaim_memory(firstUsed); + MultiValueStringAttributeT<B, T>::reclaim_memory(oldest_used_gen); + _postingList.reclaim_memory(oldest_used_gen); } template <typename B, typename T> diff --git a/searchlib/src/vespa/searchlib/attribute/predicate_attribute.cpp b/searchlib/src/vespa/searchlib/attribute/predicate_attribute.cpp index 25a4f5748a9..f34099de758 100644 --- a/searchlib/src/vespa/searchlib/attribute/predicate_attribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/predicate_attribute.cpp @@ -125,10 +125,10 @@ PredicateAttribute::onUpdateStat() } void -PredicateAttribute::removeOldGenerations(generation_t firstUsed) +PredicateAttribute::reclaim_memory(generation_t oldest_used_gen) { - getGenerationHolder().reclaim(firstUsed); - _index->reclaim_memory(firstUsed); + getGenerationHolder().reclaim(oldest_used_gen); + _index->reclaim_memory(oldest_used_gen); } void diff --git a/searchlib/src/vespa/searchlib/attribute/predicate_attribute.h b/searchlib/src/vespa/searchlib/attribute/predicate_attribute.h index bc03916dd66..159e71e99e3 100644 --- a/searchlib/src/vespa/searchlib/attribute/predicate_attribute.h +++ b/searchlib/src/vespa/searchlib/attribute/predicate_attribute.h @@ -48,7 +48,7 @@ public: void onSave(IAttributeSaveTarget & saveTarget) override; bool onLoad(vespalib::Executor *executor) override; void onCommit() override; - void removeOldGenerations(generation_t firstUsed) override; + void reclaim_memory(generation_t oldest_used_gen) override; void before_inc_generation(generation_t current_gen) override; void onUpdateStat() override; bool addDoc(DocId &doc_id) override; diff --git a/searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp b/searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp index 1311868599a..e620d3aca72 100644 --- a/searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp @@ -161,11 +161,11 @@ ReferenceAttribute::clearDoc(DocId doc) } void -ReferenceAttribute::removeOldGenerations(generation_t firstUsed) +ReferenceAttribute::reclaim_memory(generation_t oldest_used_gen) { - _referenceMappings.reclaim_memory(firstUsed); - _store.reclaim_memory(firstUsed); - getGenerationHolder().reclaim(firstUsed); + _referenceMappings.reclaim_memory(oldest_used_gen); + _store.reclaim_memory(oldest_used_gen); + getGenerationHolder().reclaim(oldest_used_gen); } void diff --git a/searchlib/src/vespa/searchlib/attribute/reference_attribute.h b/searchlib/src/vespa/searchlib/attribute/reference_attribute.h index 0e9c7858315..e0ae906eb23 100644 --- a/searchlib/src/vespa/searchlib/attribute/reference_attribute.h +++ b/searchlib/src/vespa/searchlib/attribute/reference_attribute.h @@ -50,7 +50,7 @@ private: ReferenceMappings _referenceMappings; void onAddDocs(DocId docIdLimit) override; - void removeOldGenerations(generation_t firstUsed) override; + void reclaim_memory(generation_t oldest_used_gen) override; void before_inc_generation(generation_t current_gen) override; void onCommit() override; void onUpdateStat() override; diff --git a/searchlib/src/vespa/searchlib/attribute/singleboolattribute.cpp b/searchlib/src/vespa/searchlib/attribute/singleboolattribute.cpp index b4e32bc8bd9..ac05ab3b7c6 100644 --- a/searchlib/src/vespa/searchlib/attribute/singleboolattribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/singleboolattribute.cpp @@ -257,8 +257,8 @@ SingleBoolAttribute::getEstimatedSaveByteSize() const } void -SingleBoolAttribute::removeOldGenerations(generation_t firstUsed) { - getGenerationHolder().reclaim(firstUsed); +SingleBoolAttribute::reclaim_memory(generation_t oldest_used_gen) { + getGenerationHolder().reclaim(oldest_used_gen); } void diff --git a/searchlib/src/vespa/searchlib/attribute/singleboolattribute.h b/searchlib/src/vespa/searchlib/attribute/singleboolattribute.h index 741331c4abd..a02d5c7d80d 100644 --- a/searchlib/src/vespa/searchlib/attribute/singleboolattribute.h +++ b/searchlib/src/vespa/searchlib/attribute/singleboolattribute.h @@ -28,7 +28,7 @@ public: void onSave(IAttributeSaveTarget &saveTarget) override; void clearDocs(DocId lidLow, DocId lidLimit, bool in_shrink_lid_space) override; void onShrinkLidSpace() override; - void removeOldGenerations(generation_t firstUsed) override; + void reclaim_memory(generation_t oldest_used_gen) override; void before_inc_generation(generation_t current_gen) override; uint64_t getEstimatedSaveByteSize() const override; diff --git a/searchlib/src/vespa/searchlib/attribute/singleenumattribute.h b/searchlib/src/vespa/searchlib/attribute/singleenumattribute.h index b9d19bbc305..dbf3e4e7c58 100644 --- a/searchlib/src/vespa/searchlib/attribute/singleenumattribute.h +++ b/searchlib/src/vespa/searchlib/attribute/singleenumattribute.h @@ -111,7 +111,7 @@ public: uint32_t getValueCount(DocId doc) const override; void onCommit() override; void onUpdateStat() override; - void removeOldGenerations(generation_t firstUsed) override; + void reclaim_memory(generation_t oldest_used_gen) override; void before_inc_generation(generation_t current_gen) override; EnumHandle getEnum(DocId doc) const override { return getE(doc); diff --git a/searchlib/src/vespa/searchlib/attribute/singleenumattribute.hpp b/searchlib/src/vespa/searchlib/attribute/singleenumattribute.hpp index 9980d466740..dd400295b3d 100644 --- a/searchlib/src/vespa/searchlib/attribute/singleenumattribute.hpp +++ b/searchlib/src/vespa/searchlib/attribute/singleenumattribute.hpp @@ -264,10 +264,10 @@ SingleValueEnumAttribute<B>::load_enumerated_data(ReaderBase& attrReader, template <typename B> void -SingleValueEnumAttribute<B>::removeOldGenerations(generation_t firstUsed) +SingleValueEnumAttribute<B>::reclaim_memory(generation_t oldest_used_gen) { - this->_enumStore.reclaim_memory(firstUsed); - getGenerationHolder().reclaim(firstUsed); + this->_enumStore.reclaim_memory(oldest_used_gen); + getGenerationHolder().reclaim(oldest_used_gen); } template <typename B> diff --git a/searchlib/src/vespa/searchlib/attribute/singlenumericattribute.h b/searchlib/src/vespa/searchlib/attribute/singlenumericattribute.h index b22b6e1c0a6..c6387323fea 100644 --- a/searchlib/src/vespa/searchlib/attribute/singlenumericattribute.h +++ b/searchlib/src/vespa/searchlib/attribute/singlenumericattribute.h @@ -55,7 +55,7 @@ public: void onCommit() override; void onAddDocs(DocId lidLimit) override; void onUpdateStat() override; - void removeOldGenerations(generation_t firstUsed) override; + void reclaim_memory(generation_t oldest_used_gen) override; void before_inc_generation(generation_t current_gen) override; bool addDoc(DocId & doc) override; bool onLoad(vespalib::Executor *executor) override; diff --git a/searchlib/src/vespa/searchlib/attribute/singlenumericattribute.hpp b/searchlib/src/vespa/searchlib/attribute/singlenumericattribute.hpp index 6e169e9d241..66af5fe4adc 100644 --- a/searchlib/src/vespa/searchlib/attribute/singlenumericattribute.hpp +++ b/searchlib/src/vespa/searchlib/attribute/singlenumericattribute.hpp @@ -95,9 +95,9 @@ SingleValueNumericAttribute<B>::addDoc(DocId & doc) { template <typename B> void -SingleValueNumericAttribute<B>::removeOldGenerations(generation_t firstUsed) +SingleValueNumericAttribute<B>::reclaim_memory(generation_t oldest_used_gen) { - getGenerationHolder().reclaim(firstUsed); + getGenerationHolder().reclaim(oldest_used_gen); } template <typename B> diff --git a/searchlib/src/vespa/searchlib/attribute/singlenumericpostattribute.h b/searchlib/src/vespa/searchlib/attribute/singlenumericpostattribute.h index dac498f4050..f2343c1a57c 100644 --- a/searchlib/src/vespa/searchlib/attribute/singlenumericpostattribute.h +++ b/searchlib/src/vespa/searchlib/attribute/singlenumericpostattribute.h @@ -69,7 +69,7 @@ public: SingleValueNumericPostingAttribute(const vespalib::string & name, const AttributeVector::Config & cfg); ~SingleValueNumericPostingAttribute(); - void removeOldGenerations(generation_t firstUsed) override; + void reclaim_memory(generation_t oldest_used_gen) override; void before_inc_generation(generation_t current_gen) override; std::unique_ptr<attribute::SearchContext> diff --git a/searchlib/src/vespa/searchlib/attribute/singlenumericpostattribute.hpp b/searchlib/src/vespa/searchlib/attribute/singlenumericpostattribute.hpp index 1170ed8def9..1775774171d 100644 --- a/searchlib/src/vespa/searchlib/attribute/singlenumericpostattribute.hpp +++ b/searchlib/src/vespa/searchlib/attribute/singlenumericpostattribute.hpp @@ -127,10 +127,10 @@ SingleValueNumericPostingAttribute<B>::applyValueChanges(EnumStoreBatchUpdater& template <typename B> void -SingleValueNumericPostingAttribute<B>::removeOldGenerations(generation_t firstUsed) +SingleValueNumericPostingAttribute<B>::reclaim_memory(generation_t oldest_used_gen) { - SingleValueNumericEnumAttribute<B>::removeOldGenerations(firstUsed); - _postingList.reclaim_memory(firstUsed); + SingleValueNumericEnumAttribute<B>::reclaim_memory(oldest_used_gen); + _postingList.reclaim_memory(oldest_used_gen); } template <typename B> diff --git a/searchlib/src/vespa/searchlib/attribute/singlesmallnumericattribute.cpp b/searchlib/src/vespa/searchlib/attribute/singlesmallnumericattribute.cpp index 0f18faacecc..b2662a0928d 100644 --- a/searchlib/src/vespa/searchlib/attribute/singlesmallnumericattribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/singlesmallnumericattribute.cpp @@ -106,9 +106,9 @@ SingleValueSmallNumericAttribute::onUpdateStat() void -SingleValueSmallNumericAttribute::removeOldGenerations(generation_t firstUsed) +SingleValueSmallNumericAttribute::reclaim_memory(generation_t oldest_used_gen) { - getGenerationHolder().reclaim(firstUsed); + getGenerationHolder().reclaim(oldest_used_gen); } diff --git a/searchlib/src/vespa/searchlib/attribute/singlesmallnumericattribute.h b/searchlib/src/vespa/searchlib/attribute/singlesmallnumericattribute.h index d299724121b..b2af8752fa4 100644 --- a/searchlib/src/vespa/searchlib/attribute/singlesmallnumericattribute.h +++ b/searchlib/src/vespa/searchlib/attribute/singlesmallnumericattribute.h @@ -72,7 +72,7 @@ public: void onCommit() override; void onAddDocs(DocId docIdLimit) override; void onUpdateStat() override; - void removeOldGenerations(generation_t firstUsed) override; + void reclaim_memory(generation_t oldest_used_gen) override; void before_inc_generation(generation_t current_gen) override; bool addDoc(DocId & doc) override; bool onLoad(vespalib::Executor *executor) override; diff --git a/searchlib/src/vespa/searchlib/attribute/singlestringpostattribute.h b/searchlib/src/vespa/searchlib/attribute/singlestringpostattribute.h index 0e6bbbe0462..358c95f65dc 100644 --- a/searchlib/src/vespa/searchlib/attribute/singlestringpostattribute.h +++ b/searchlib/src/vespa/searchlib/attribute/singlestringpostattribute.h @@ -71,7 +71,7 @@ public: SingleValueStringPostingAttributeT(const vespalib::string & name); ~SingleValueStringPostingAttributeT(); - void removeOldGenerations(generation_t firstUsed) override; + void reclaim_memory(generation_t oldest_used_gen) override; void before_inc_generation(generation_t current_gen) override; std::unique_ptr<attribute::SearchContext> diff --git a/searchlib/src/vespa/searchlib/attribute/singlestringpostattribute.hpp b/searchlib/src/vespa/searchlib/attribute/singlestringpostattribute.hpp index 0e1ccce1ea8..eef72984e79 100644 --- a/searchlib/src/vespa/searchlib/attribute/singlestringpostattribute.hpp +++ b/searchlib/src/vespa/searchlib/attribute/singlestringpostattribute.hpp @@ -127,10 +127,10 @@ SingleValueStringPostingAttributeT<B>::applyValueChanges(EnumStoreBatchUpdater& template <typename B> void -SingleValueStringPostingAttributeT<B>::removeOldGenerations(generation_t firstUsed) +SingleValueStringPostingAttributeT<B>::reclaim_memory(generation_t oldest_used_gen) { - SingleValueStringAttributeT<B>::removeOldGenerations(firstUsed); - _postingList.reclaim_memory(firstUsed); + SingleValueStringAttributeT<B>::reclaim_memory(oldest_used_gen); + _postingList.reclaim_memory(oldest_used_gen); } template <typename B> diff --git a/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp b/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp index cdf7e5f5ea8..0e7e492c954 100644 --- a/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp +++ b/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp @@ -110,7 +110,7 @@ LogDataStore::~LogDataStore() // Must be called before ending threads as there are sanity checks. _fileChunks.clear(); _genHandler.update_oldest_used_generation(); - _lidInfo.removeOldGenerations(_genHandler.get_oldest_used_generation()); + _lidInfo.reclaim_memory(_genHandler.get_oldest_used_generation()); } void @@ -940,7 +940,7 @@ LogDataStore::setLid(const MonitorGuard &guard, uint32_t lid, const LidInfo &met (void) guard; if (lid < _lidInfo.size()) { _genHandler.update_oldest_used_generation(); - _lidInfo.removeOldGenerations(_genHandler.get_oldest_used_generation()); + _lidInfo.reclaim_memory(_genHandler.get_oldest_used_generation()); const LidInfo prev = vespalib::atomic::load_ref_relaxed(_lidInfo[lid]); if (prev.valid()) { _fileChunks[prev.getFileId()]->remove(lid, prev.size()); @@ -959,7 +959,7 @@ LogDataStore::incGeneration() _lidInfo.setGeneration(_genHandler.getNextGeneration()); _genHandler.incGeneration(); _genHandler.update_oldest_used_generation(); - _lidInfo.removeOldGenerations(_genHandler.get_oldest_used_generation()); + _lidInfo.reclaim_memory(_genHandler.get_oldest_used_generation()); } size_t diff --git a/searchlib/src/vespa/searchlib/tensor/dense_tensor_attribute.cpp b/searchlib/src/vespa/searchlib/tensor/dense_tensor_attribute.cpp index c5cccc8153c..56b9473b6e6 100644 --- a/searchlib/src/vespa/searchlib/tensor/dense_tensor_attribute.cpp +++ b/searchlib/src/vespa/searchlib/tensor/dense_tensor_attribute.cpp @@ -459,11 +459,11 @@ DenseTensorAttribute::before_inc_generation(generation_t current_gen) } void -DenseTensorAttribute::removeOldGenerations(generation_t first_used_gen) +DenseTensorAttribute::reclaim_memory(generation_t oldest_used_gen) { - TensorAttribute::removeOldGenerations(first_used_gen); + TensorAttribute::reclaim_memory(oldest_used_gen); if (_index) { - _index->reclaim_memory(first_used_gen); + _index->reclaim_memory(oldest_used_gen); } } diff --git a/searchlib/src/vespa/searchlib/tensor/dense_tensor_attribute.h b/searchlib/src/vespa/searchlib/tensor/dense_tensor_attribute.h index 191e2c8d5f1..3aa52fe622a 100644 --- a/searchlib/src/vespa/searchlib/tensor/dense_tensor_attribute.h +++ b/searchlib/src/vespa/searchlib/tensor/dense_tensor_attribute.h @@ -48,7 +48,7 @@ public: uint32_t getVersion() const override; void onCommit() override; void before_inc_generation(generation_t current_gen) override; - void removeOldGenerations(generation_t first_used_gen) override; + void reclaim_memory(generation_t oldest_used_gen) override; void get_state(const vespalib::slime::Inserter& inserter) const override; void onShrinkLidSpace() override; diff --git a/searchlib/src/vespa/searchlib/tensor/hnsw_index.cpp b/searchlib/src/vespa/searchlib/tensor/hnsw_index.cpp index d505e939a34..10f06a1e1ec 100644 --- a/searchlib/src/vespa/searchlib/tensor/hnsw_index.cpp +++ b/searchlib/src/vespa/searchlib/tensor/hnsw_index.cpp @@ -523,7 +523,7 @@ HnswIndex::assign_generation(generation_t current_gen) void HnswIndex::reclaim_memory(generation_t oldest_used_gen) { - _graph.node_refs.removeOldGenerations(oldest_used_gen); + _graph.node_refs.reclaim_memory(oldest_used_gen); _graph.nodes.reclaim_memory(oldest_used_gen); _graph.links.reclaim_memory(oldest_used_gen); } diff --git a/searchlib/src/vespa/searchlib/tensor/tensor_attribute.cpp b/searchlib/src/vespa/searchlib/tensor/tensor_attribute.cpp index f70c83c62ce..6130da6fcf9 100644 --- a/searchlib/src/vespa/searchlib/tensor/tensor_attribute.cpp +++ b/searchlib/src/vespa/searchlib/tensor/tensor_attribute.cpp @@ -110,10 +110,10 @@ TensorAttribute::onUpdateStat() } void -TensorAttribute::removeOldGenerations(generation_t firstUsed) +TensorAttribute::reclaim_memory(generation_t oldest_used_gen) { - _tensorStore.reclaim_memory(firstUsed); - getGenerationHolder().reclaim(firstUsed); + _tensorStore.reclaim_memory(oldest_used_gen); + getGenerationHolder().reclaim(oldest_used_gen); } void diff --git a/searchlib/src/vespa/searchlib/tensor/tensor_attribute.h b/searchlib/src/vespa/searchlib/tensor/tensor_attribute.h index 88bb9fd4c61..b7bac35d1b7 100644 --- a/searchlib/src/vespa/searchlib/tensor/tensor_attribute.h +++ b/searchlib/src/vespa/searchlib/tensor/tensor_attribute.h @@ -48,7 +48,7 @@ public: uint32_t clearDoc(DocId docId) override; void onCommit() override; void onUpdateStat() override; - void removeOldGenerations(generation_t firstUsed) override; + void reclaim_memory(generation_t oldest_used_gen) override; void before_inc_generation(generation_t current_gen) override; bool addDoc(DocId &docId) override; std::unique_ptr<vespalib::eval::Value> getEmptyTensor() const override; diff --git a/vespalib/src/tests/btree/frozenbtree_test.cpp b/vespalib/src/tests/btree/frozenbtree_test.cpp index 0bde2786a0b..3471d5dc3df 100644 --- a/vespalib/src/tests/btree/frozenbtree_test.cpp +++ b/vespalib/src/tests/btree/frozenbtree_test.cpp @@ -114,7 +114,7 @@ FrozenBTreeTest::freeTree(bool verbose) static_cast<uint64_t>(_intTree->getUsedMemory()), static_cast<uint64_t>(_intTree->getHeldMemory())); _intTree->dropFrozen(); - _intTree->removeOldGenerations(_intTree->getGeneration() + 1); + _intTree->reclaim_memory(_intTree->getGeneration() + 1); LOG(info, "freeTree after unhold: %" PRIu64 " (%" PRIu64 " held)", static_cast<uint64_t>(_intTree->getUsedMemory()), diff --git a/vespalib/src/tests/util/rcuvector/rcuvector_test.cpp b/vespalib/src/tests/util/rcuvector/rcuvector_test.cpp index 48fc88ec86d..5d6ec3050da 100644 --- a/vespalib/src/tests/util/rcuvector/rcuvector_test.cpp +++ b/vespalib/src/tests/util/rcuvector/rcuvector_test.cpp @@ -140,7 +140,7 @@ TEST(RcuVectorTest, generation_handling) v.setGeneration(2); v.push_back(50); - v.removeOldGenerations(3); + v.reclaim_memory(3); EXPECT_EQ(0u, v.getMemoryUsage().allocatedBytesOnHold()); v.push_back(60); // new array EXPECT_EQ(24u, v.getMemoryUsage().allocatedBytesOnHold()); @@ -184,7 +184,7 @@ TEST(RcuVectorTest, memory_usage) EXPECT_TRUE(assertUsage(MemoryUsage(6,6,0,2), v.getMemoryUsage())); v.push_back(4); EXPECT_TRUE(assertUsage(MemoryUsage(12,11,0,6), v.getMemoryUsage())); - v.removeOldGenerations(1); + v.reclaim_memory(1); EXPECT_TRUE(assertUsage(MemoryUsage(6,5,0,0), v.getMemoryUsage())); } diff --git a/vespalib/src/vespa/vespalib/util/rcuvector.h b/vespalib/src/vespa/vespalib/util/rcuvector.h index 5d084fe3815..b0929303692 100644 --- a/vespalib/src/vespa/vespalib/util/rcuvector.h +++ b/vespalib/src/vespa/vespalib/util/rcuvector.h @@ -182,7 +182,7 @@ public: /** * Remove all old data vectors where generation < firstUsed. **/ - void removeOldGenerations(generation_t firstUsed); + void reclaim_memory(generation_t oldest_used_gen); MemoryUsage getMemoryUsage() const override; }; diff --git a/vespalib/src/vespa/vespalib/util/rcuvector.hpp b/vespalib/src/vespa/vespalib/util/rcuvector.hpp index e551bb17db0..eadda8ac1e9 100644 --- a/vespalib/src/vespa/vespalib/util/rcuvector.hpp +++ b/vespalib/src/vespa/vespalib/util/rcuvector.hpp @@ -187,9 +187,9 @@ RcuVector<T>::~RcuVector() template <typename T> void -RcuVector<T>::removeOldGenerations(generation_t firstUsed) +RcuVector<T>::reclaim_memory(generation_t oldest_used_gen) { - _genHolderStore.reclaim(firstUsed); + _genHolderStore.reclaim(oldest_used_gen); } template <typename T> |