From 82bea8313f493bc8f790633e0c3aee213f4612b7 Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Mon, 23 May 2022 19:03:30 +0000 Subject: - Stick to using GrowStragey everywhere. - Store the full config in the rcu vector. --- searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp | 2 +- searchlib/src/vespa/searchlib/attribute/reference_mappings.cpp | 4 ++-- searchlib/src/vespa/searchlib/attribute/singleenumattribute.cpp | 5 +---- searchlib/src/vespa/searchlib/attribute/singlenumericattribute.hpp | 6 +----- .../src/vespa/searchlib/attribute/singlesmallnumericattribute.cpp | 5 +---- searchlib/src/vespa/searchlib/common/condensedbitvectors.cpp | 2 +- searchlib/src/vespa/searchlib/docstore/logdatastore.cpp | 4 +--- searchlib/src/vespa/searchlib/tensor/tensor_attribute.cpp | 5 +---- 8 files changed, 9 insertions(+), 24 deletions(-) (limited to 'searchlib') diff --git a/searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp b/searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp index 473174de284..66042bcf0c4 100644 --- a/searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp @@ -43,7 +43,7 @@ ReferenceAttribute::ReferenceAttribute(const vespalib::stringref baseFileName, const Config & cfg) : NotImplementedAttribute(baseFileName, cfg), _store({}), - _indices(getGenerationHolder()), + _indices(cfg.getGrowStrategy().to_generic_strategy(), getGenerationHolder()), _compaction_spec(), _gidToLidMapperFactory(), _referenceMappings(getGenerationHolder(), getCommittedDocIdLimitRef()) diff --git a/searchlib/src/vespa/searchlib/attribute/reference_mappings.cpp b/searchlib/src/vespa/searchlib/attribute/reference_mappings.cpp index 65bbd9514c7..6ebc2996408 100644 --- a/searchlib/src/vespa/searchlib/attribute/reference_mappings.cpp +++ b/searchlib/src/vespa/searchlib/attribute/reference_mappings.cpp @@ -9,10 +9,10 @@ namespace search::attribute { ReferenceMappings::ReferenceMappings(GenerationHolder &genHolder, const std::atomic& committedDocIdLimit) - : _reverseMappingIndices(genHolder), + : _reverseMappingIndices(vespalib::GrowStrategy(16, 1.0, 0), genHolder), _targetLidLimit(0), _reverseMapping(), - _targetLids(genHolder), + _targetLids(vespalib::GrowStrategy(16, 1.0, 0), genHolder), _committedDocIdLimit(committedDocIdLimit) { } diff --git a/searchlib/src/vespa/searchlib/attribute/singleenumattribute.cpp b/searchlib/src/vespa/searchlib/attribute/singleenumattribute.cpp index 38ef186b717..e6695ef6c6c 100644 --- a/searchlib/src/vespa/searchlib/attribute/singleenumattribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/singleenumattribute.cpp @@ -15,10 +15,7 @@ using attribute::Config; SingleValueEnumAttributeBase:: SingleValueEnumAttributeBase(const Config & c, GenerationHolder &genHolder, const vespalib::alloc::Alloc& initial_alloc) - : _enumIndices(c.getGrowStrategy().getDocsInitialCapacity(), - c.getGrowStrategy().getDocsGrowPercent(), - c.getGrowStrategy().getDocsGrowDelta(), - genHolder, initial_alloc) + : _enumIndices(c.getGrowStrategy().to_generic_strategy(), genHolder, initial_alloc) { } diff --git a/searchlib/src/vespa/searchlib/attribute/singlenumericattribute.hpp b/searchlib/src/vespa/searchlib/attribute/singlenumericattribute.hpp index 917f0f55894..0a3c6a9ac4f 100644 --- a/searchlib/src/vespa/searchlib/attribute/singlenumericattribute.hpp +++ b/searchlib/src/vespa/searchlib/attribute/singlenumericattribute.hpp @@ -17,11 +17,7 @@ template SingleValueNumericAttribute:: SingleValueNumericAttribute(const vespalib::string & baseFileName, const AttributeVector::Config & c) : B(baseFileName, c), - _data(c.getGrowStrategy().getDocsInitialCapacity(), - c.getGrowStrategy().getDocsGrowPercent(), - c.getGrowStrategy().getDocsGrowDelta(), - getGenerationHolder(), - this->get_initial_alloc()) + _data(c.getGrowStrategy().to_generic_strategy(), getGenerationHolder(), this->get_initial_alloc()) { } template diff --git a/searchlib/src/vespa/searchlib/attribute/singlesmallnumericattribute.cpp b/searchlib/src/vespa/searchlib/attribute/singlesmallnumericattribute.cpp index eca74255026..3bc2cb8f96a 100644 --- a/searchlib/src/vespa/searchlib/attribute/singlesmallnumericattribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/singlesmallnumericattribute.cpp @@ -24,10 +24,7 @@ SingleValueSmallNumericAttribute(const vespalib::string & baseFileName, _valueShiftShift(valueShiftShift), _valueShiftMask(valueShiftMask), _wordShift(wordShift), - _wordData(c.getGrowStrategy().getDocsInitialCapacity(), - c.getGrowStrategy().getDocsGrowPercent(), - c.getGrowStrategy().getDocsGrowDelta(), - getGenerationHolder()) + _wordData(c.getGrowStrategy().to_generic_strategy(), getGenerationHolder()) { assert(_valueMask + 1 == (1u << (1u << valueShiftShift))); assert((_valueShiftMask + 1) * (1u << valueShiftShift) == 8 * sizeof(Word)); diff --git a/searchlib/src/vespa/searchlib/common/condensedbitvectors.cpp b/searchlib/src/vespa/searchlib/common/condensedbitvectors.cpp index 569e1275080..74df5c8c5d4 100644 --- a/searchlib/src/vespa/searchlib/common/condensedbitvectors.cpp +++ b/searchlib/src/vespa/searchlib/common/condensedbitvectors.cpp @@ -17,7 +17,7 @@ class CondensedBitVectorT : public CondensedBitVector { public: CondensedBitVectorT(size_t sz, GenerationHolder &genHolder) : - _v(sz, 30, 1000, genHolder) + _v(vespalib::GrowStrategy(sz, 30, 1000), genHolder) { for (size_t i = 0; i < sz; ++i) { _v.push_back(0); diff --git a/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp b/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp index 51a4d392839..04cb687e366 100644 --- a/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp +++ b/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp @@ -67,9 +67,7 @@ LogDataStore::LogDataStore(vespalib::Executor &executor, const vespalib::string _tune(tune), _fileHeaderContext(fileHeaderContext), _genHandler(), - _lidInfo(growStrategy.getDocsInitialCapacity(), - growStrategy.getDocsGrowPercent(), - growStrategy.getDocsGrowDelta()), + _lidInfo(growStrategy.to_generic_strategy()), _fileChunks(), _holdFileChunks(), _active(0), diff --git a/searchlib/src/vespa/searchlib/tensor/tensor_attribute.cpp b/searchlib/src/vespa/searchlib/tensor/tensor_attribute.cpp index c1cafd547aa..dabf9203551 100644 --- a/searchlib/src/vespa/searchlib/tensor/tensor_attribute.cpp +++ b/searchlib/src/vespa/searchlib/tensor/tensor_attribute.cpp @@ -49,10 +49,7 @@ vespalib::string makeWrongTensorTypeMsg(const ValueType &fieldTensorType, const TensorAttribute::TensorAttribute(vespalib::stringref name, const Config &cfg, TensorStore &tensorStore) : NotImplementedAttribute(name, cfg), - _refVector(cfg.getGrowStrategy().getDocsInitialCapacity(), - cfg.getGrowStrategy().getDocsGrowPercent(), - cfg.getGrowStrategy().getDocsGrowDelta(), - getGenerationHolder()), + _refVector(cfg.getGrowStrategy().to_generic_strategy(), getGenerationHolder()), _tensorStore(tensorStore), _is_dense(cfg.tensorType().is_dense()), _emptyTensor(createEmptyTensor(cfg.tensorType())), -- cgit v1.2.3