summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeir Storli <geirst@yahooinc.com>2022-04-11 17:18:36 +0200
committerGitHub <noreply@github.com>2022-04-11 17:18:36 +0200
commitdb93ebc313c995a1e877fc9ffb1d41aef845aef1 (patch)
tree9de43273a0beedebc6676f8c1fae436e83002e36
parent8bdf73a7529cfa8fec07a102bc39ac21dfe632ff (diff)
parent069a2f661cc73cbfba99ed634c91534f9d80703e (diff)
Merge pull request #22090 from vespa-engine/toregge/remove-getrawvalues-and-getenumhandles
Remove getRawValues() and getEnumHandles().
-rw-r--r--searchlib/src/vespa/searchlib/attribute/floatbase.h2
-rw-r--r--searchlib/src/vespa/searchlib/attribute/floatbase.hpp12
-rw-r--r--searchlib/src/vespa/searchlib/attribute/integerbase.h2
-rw-r--r--searchlib/src/vespa/searchlib/attribute/integerbase.hpp12
-rw-r--r--searchlib/src/vespa/searchlib/attribute/multienumattribute.cpp9
-rw-r--r--searchlib/src/vespa/searchlib/attribute/multienumattribute.h20
-rw-r--r--searchlib/src/vespa/searchlib/attribute/multienumattribute.hpp25
-rw-r--r--searchlib/src/vespa/searchlib/attribute/multinumericattribute.h4
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 063d6e5f88d..5bfc326ad94 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 c4a0b387d4c..34c46ac994e 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 8c9d65e578e..b2530db0054 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));