diff options
author | Tor Egge <Tor.Egge@yahooinc.com> | 2022-04-11 16:16:24 +0200 |
---|---|---|
committer | Tor Egge <Tor.Egge@yahooinc.com> | 2022-04-11 16:48:16 +0200 |
commit | 069a2f661cc73cbfba99ed634c91534f9d80703e (patch) | |
tree | d50e30ae22ae07086d128c05536762975e38de8c | |
parent | a6f0ef3e995ce8ef0d34a533f37910c6e7c0934a (diff) |
Remove getRawValues() and getEnumHandles().
8 files changed, 1 insertions, 85 deletions
diff --git a/searchlib/src/vespa/searchlib/attribute/floatbase.h b/searchlib/src/vespa/searchlib/attribute/floatbase.h index d27d7ba5925..f10e8189c29 100644 --- a/searchlib/src/vespa/searchlib/attribute/floatbase.h +++ b/searchlib/src/vespa/searchlib/attribute/floatbase.h @@ -60,8 +60,6 @@ public: using BaseType = T; using LoadedValueType = T; using LoadedVector = SequentialReadModifyWriteInterface<LoadedNumericValueT>; - virtual uint32_t getRawValues(DocId doc, const multivalue::Value<T> * & values) const; - virtual uint32_t getRawValues(DocId doc, const multivalue::WeightedValue<T> * & values) const; virtual T get(DocId doc) const = 0; virtual T getFromEnum(EnumHandle e) const = 0; T defaultValue() const { return getConfig().isMutable() ? 0.0 : attribute::getUndefined<T>(); } diff --git a/searchlib/src/vespa/searchlib/attribute/floatbase.hpp b/searchlib/src/vespa/searchlib/attribute/floatbase.hpp index d3cf291849b..7b235b43124 100644 --- a/searchlib/src/vespa/searchlib/attribute/floatbase.hpp +++ b/searchlib/src/vespa/searchlib/attribute/floatbase.hpp @@ -7,18 +7,6 @@ namespace search { template<typename T> -uint32_t -FloatingPointAttributeTemplate<T>::getRawValues(DocId, const multivalue::Value<T> * &) const { - throw std::runtime_error(getNativeClassName() + "::getRawValues() not implemented."); -} - -template<typename T> -uint32_t -FloatingPointAttributeTemplate<T>::getRawValues(DocId, const multivalue::WeightedValue<T> * &) const { - throw std::runtime_error(getNativeClassName() + "::getRawValues() not implemented."); -} - -template<typename T> FloatingPointAttributeTemplate<T>::FloatingPointAttributeTemplate(const vespalib::string & name) : FloatingPointAttributeTemplate(name, BasicType::fromType(T())) { } diff --git a/searchlib/src/vespa/searchlib/attribute/integerbase.h b/searchlib/src/vespa/searchlib/attribute/integerbase.h index 60dd527282a..926ced7c7e0 100644 --- a/searchlib/src/vespa/searchlib/attribute/integerbase.h +++ b/searchlib/src/vespa/searchlib/attribute/integerbase.h @@ -58,8 +58,6 @@ public: using BaseType = T; using LoadedValueType = T; using LoadedVector = SequentialReadModifyWriteInterface<LoadedNumericValueT>; - virtual uint32_t getRawValues(DocId doc, const multivalue::Value<T> * & values) const; - virtual uint32_t getRawValues(DocId doc, const multivalue::WeightedValue<T> * & values) const; virtual T get(DocId doc) const = 0; virtual T getFromEnum(EnumHandle e) const = 0; T defaultValue() const { return getConfig().isMutable() ? 0 : attribute::getUndefined<T>(); } diff --git a/searchlib/src/vespa/searchlib/attribute/integerbase.hpp b/searchlib/src/vespa/searchlib/attribute/integerbase.hpp index 5efca03e435..94ffe17af4c 100644 --- a/searchlib/src/vespa/searchlib/attribute/integerbase.hpp +++ b/searchlib/src/vespa/searchlib/attribute/integerbase.hpp @@ -35,18 +35,6 @@ template<typename T> IntegerAttributeTemplate<T>::~IntegerAttributeTemplate() = default; template<typename T> -uint32_t -IntegerAttributeTemplate<T>::getRawValues(DocId, const multivalue::Value<T> * &) const { - throw std::runtime_error(getNativeClassName() + "::getRawValues() not implemented."); -} - -template<typename T> -uint32_t -IntegerAttributeTemplate<T>::getRawValues(DocId, const multivalue::WeightedValue<T> * &) const { - throw std::runtime_error(getNativeClassName() + "::getRawValues() not implemented."); -} - -template<typename T> bool IntegerAttributeTemplate<T>::findEnum(const char *value, EnumHandle &e) const { vespalib::asciistream iss(value); diff --git a/searchlib/src/vespa/searchlib/attribute/multienumattribute.cpp b/searchlib/src/vespa/searchlib/attribute/multienumattribute.cpp index 938981689da..a781fd54534 100644 --- a/searchlib/src/vespa/searchlib/attribute/multienumattribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/multienumattribute.cpp @@ -4,15 +4,6 @@ #include "multienumattribute.hpp" #include <stdexcept> -namespace search { - -uint32_t -IWeightedIndexVector::getEnumHandles(uint32_t, const WeightedIndex * &) const { - throw std::runtime_error("IWeightedIndexVector::getEnumHandles() not implmented"); -} - -} - namespace search::multienumattribute { using EnumIndex = IEnumStore::Index; diff --git a/searchlib/src/vespa/searchlib/attribute/multienumattribute.h b/searchlib/src/vespa/searchlib/attribute/multienumattribute.h index 48c870e5aa7..d38059d4471 100644 --- a/searchlib/src/vespa/searchlib/attribute/multienumattribute.h +++ b/searchlib/src/vespa/searchlib/attribute/multienumattribute.h @@ -10,21 +10,6 @@ namespace search { -class IWeightedIndexVector { -public: - virtual ~IWeightedIndexVector() = default; - using WeightedIndex = multivalue::WeightedValue<vespalib::datastore::AtomicEntryRef>; - /** - * Provides a reference to the underlying enum/weight pairs. - * This method should only be invoked if @ref getCollectionType(docId) returns CollectionType::WEIGHTED_SET. - * - * @param doc document identifier - * @param values Reference to values and weights - * @return the number of values for this document - **/ - virtual uint32_t getEnumHandles(uint32_t doc, const WeightedIndex * & values) const; -}; - class ReaderBase; /** @@ -35,8 +20,7 @@ class ReaderBase; * M: MultiValueType */ template <typename B, typename M> -class MultiValueEnumAttribute : public MultiValueAttribute<B, M>, - public IWeightedIndexVector +class MultiValueEnumAttribute : public MultiValueAttribute<B, M> { protected: using AtomicEntryRef = vespalib::datastore::AtomicEntryRef; @@ -76,8 +60,6 @@ protected: public: MultiValueEnumAttribute(const vespalib::string & baseFileName, const AttributeVector::Config & cfg); - uint32_t getEnumHandles(DocId doc, const IWeightedIndexVector::WeightedIndex * & values) const override final; - void onCommit() override; void onUpdateStat() override; diff --git a/searchlib/src/vespa/searchlib/attribute/multienumattribute.hpp b/searchlib/src/vespa/searchlib/attribute/multienumattribute.hpp index bb1e4712c2d..f371f0f13a6 100644 --- a/searchlib/src/vespa/searchlib/attribute/multienumattribute.hpp +++ b/searchlib/src/vespa/searchlib/attribute/multienumattribute.hpp @@ -132,31 +132,6 @@ MultiValueEnumAttribute(const vespalib::string &baseFileName, { } -namespace { - -template<typename T> -const IWeightedIndexVector::WeightedIndex * -extract(const T *) { - throw std::runtime_error("IWeightedIndexVector::getEnumHandles not implemented"); -} - -template <> -inline const IWeightedIndexVector::WeightedIndex * -extract(const IWeightedIndexVector::WeightedIndex * values) { - return values; -} - -} - -template <typename B, typename M> -uint32_t -MultiValueEnumAttribute<B, M>::getEnumHandles(DocId doc, const IWeightedIndexVector::WeightedIndex * & values) const -{ - WeightedIndexArrayRef indices(this->_mvMapping.get(doc)); - values = extract(&indices[0]); - return indices.size(); -} - template <typename B, typename M> void MultiValueEnumAttribute<B, M>::onCommit() diff --git a/searchlib/src/vespa/searchlib/attribute/multinumericattribute.h b/searchlib/src/vespa/searchlib/attribute/multinumericattribute.h index 90345c50742..e50e860ef61 100644 --- a/searchlib/src/vespa/searchlib/attribute/multinumericattribute.h +++ b/searchlib/src/vespa/searchlib/attribute/multinumericattribute.h @@ -54,10 +54,6 @@ protected: } public: - uint32_t getRawValues(DocId doc, const WType * & values) const final override { - return get(doc, values); - } - MultiValueNumericAttribute(const vespalib::string & baseFileName, const AttributeVector::Config & c = AttributeVector::Config(AttributeVector::BasicType::fromType(T()), attribute::CollectionType::ARRAY)); |