summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-12-19 23:10:31 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2021-01-10 22:35:28 +0000
commit8f1440ee4f7a41925d88138da80f27d418e3e5f2 (patch)
treeb7b5c7002d9b7bf34bed5355f8bef645696b97f7 /searchlib
parentdfd9a1b244725de2f594053cdb11c7ef0f3cb9ae (diff)
Have the BufferType::_emptyEntry be static.
Use an array of buffer types in the array class.
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/tests/btree/scanspeed.cpp1
-rw-r--r--searchlib/src/tests/predicate/simple_index_test.cpp1
-rw-r--r--searchlib/src/vespa/searchlib/attribute/enum_store_dictionary.cpp8
-rw-r--r--searchlib/src/vespa/searchlib/attribute/enumstore.cpp1
-rw-r--r--searchlib/src/vespa/searchlib/attribute/multi_value_mapping.cpp7
-rw-r--r--searchlib/src/vespa/searchlib/attribute/postinglisttraits.cpp1
-rw-r--r--searchlib/src/vespa/searchlib/attribute/postingstore.cpp14
-rw-r--r--searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp3
-rw-r--r--searchlib/src/vespa/searchlib/memoryindex/field_index.cpp1
-rw-r--r--searchlib/src/vespa/searchlib/predicate/simple_index.cpp1
-rw-r--r--searchlib/src/vespa/searchlib/tensor/dense_tensor_store.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/tensor/dense_tensor_store.h2
-rw-r--r--searchlib/src/vespa/searchlib/tensor/direct_tensor_store.cpp3
-rw-r--r--searchlib/src/vespa/searchlib/tensor/direct_tensor_store.h2
14 files changed, 34 insertions, 13 deletions
diff --git a/searchlib/src/tests/btree/scanspeed.cpp b/searchlib/src/tests/btree/scanspeed.cpp
index 1474edd6b0b..ed3368f4b4e 100644
--- a/searchlib/src/tests/btree/scanspeed.cpp
+++ b/searchlib/src/tests/btree/scanspeed.cpp
@@ -13,6 +13,7 @@
#include <vespa/vespalib/btree/btreebuilder.hpp>
#include <vespa/vespalib/btree/btree.hpp>
#include <vespa/vespalib/btree/btreestore.hpp>
+#include <vespa/vespalib/datastore/buffer_type.hpp>
#include <vespa/vespalib/util/time.h>
#include <vespa/searchlib/common/bitvector.h>
diff --git a/searchlib/src/tests/predicate/simple_index_test.cpp b/searchlib/src/tests/predicate/simple_index_test.cpp
index c5177c526c0..f7398800dba 100644
--- a/searchlib/src/tests/predicate/simple_index_test.cpp
+++ b/searchlib/src/tests/predicate/simple_index_test.cpp
@@ -9,6 +9,7 @@
#include <vespa/vespalib/btree/btreeiterator.hpp>
#include <vespa/vespalib/btree/btreestore.hpp>
#include <vespa/vespalib/btree/btreenodeallocator.hpp>
+#include <vespa/vespalib/datastore/buffer_type.hpp>
#include <map>
#include <vespa/log/log.h>
diff --git a/searchlib/src/vespa/searchlib/attribute/enum_store_dictionary.cpp b/searchlib/src/vespa/searchlib/attribute/enum_store_dictionary.cpp
index 19d30317c7b..304a16c492b 100644
--- a/searchlib/src/vespa/searchlib/attribute/enum_store_dictionary.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/enum_store_dictionary.cpp
@@ -310,3 +310,11 @@ class BTree<IEnumStore::Index, uint32_t, NoAggregated,
const vespalib::datastore::EntryComparatorWrapper, EnumTreeTraits>;
}
+
+namespace vespalib::datastore {
+
+using namespace btree;
+
+VESPALIB_DATASTORE_INSTANTIATE_BUFFERTYPE_INTERNALNODE(EntryRef, NoAggregated, BTreeDefaultTraits::INTERNAL_SLOTS);
+
+} \ No newline at end of file
diff --git a/searchlib/src/vespa/searchlib/attribute/enumstore.cpp b/searchlib/src/vespa/searchlib/attribute/enumstore.cpp
index 74e277b2859..0ad8a7d7c5b 100644
--- a/searchlib/src/vespa/searchlib/attribute/enumstore.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/enumstore.cpp
@@ -89,4 +89,3 @@ template class EnumStoreT<double>;
namespace vespalib {
template class RcuVectorBase<search::IEnumStore::Index>;
}
-
diff --git a/searchlib/src/vespa/searchlib/attribute/multi_value_mapping.cpp b/searchlib/src/vespa/searchlib/attribute/multi_value_mapping.cpp
index 6a1a5194890..71f2bcf4d91 100644
--- a/searchlib/src/vespa/searchlib/attribute/multi_value_mapping.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/multi_value_mapping.cpp
@@ -6,12 +6,12 @@
#include "multi_value_mapping.hpp"
#include "multivalue.h"
#include <vespa/vespalib/util/array.hpp>
+#include <vespa/vespalib/datastore/buffer_type.hpp>
using search::multivalue::Value;
using search::multivalue::WeightedValue;
-namespace search {
-namespace attribute {
+namespace search::attribute {
template class MultiValueMapping<Value<IEnumStore::Index>>;
template class MultiValueMapping<WeightedValue<IEnumStore::Index>>;
@@ -28,5 +28,4 @@ template class MultiValueMapping<WeightedValue<float>>;
template class MultiValueMapping<Value<double>>;
template class MultiValueMapping<WeightedValue<double>>;
-} // namespace search::attribute
-} // namespace search
+}
diff --git a/searchlib/src/vespa/searchlib/attribute/postinglisttraits.cpp b/searchlib/src/vespa/searchlib/attribute/postinglisttraits.cpp
index ae872ee60f1..1dd6631080a 100644
--- a/searchlib/src/vespa/searchlib/attribute/postinglisttraits.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/postinglisttraits.cpp
@@ -6,6 +6,7 @@
#include <vespa/vespalib/btree/btreenodeallocator.hpp>
#include <vespa/vespalib/btree/btreebuilder.hpp>
#include <vespa/vespalib/btree/btreeiterator.hpp>
+#include <vespa/vespalib/datastore/buffer_type.hpp>
namespace vespalib::btree {
diff --git a/searchlib/src/vespa/searchlib/attribute/postingstore.cpp b/searchlib/src/vespa/searchlib/attribute/postingstore.cpp
index 26339392d2c..d06b891c2e2 100644
--- a/searchlib/src/vespa/searchlib/attribute/postingstore.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/postingstore.cpp
@@ -6,6 +6,7 @@
#include <vespa/searchcommon/attribute/status.h>
#include <vespa/vespalib/btree/btreeiterator.hpp>
#include <vespa/vespalib/datastore/datastore.hpp>
+#include <vespa/vespalib/datastore/buffer_type.hpp>
namespace search::attribute {
@@ -255,7 +256,7 @@ PostingStore<DataT>::makeBitVector(EntryRef &ref)
uint32_t expDocFreq = it.size();
(void) expDocFreq;
for (; it.valid(); ++it) {
- uint32_t docId = it.getKey();
+ uint32_t docId = it.getKey();
assert(docId < docIdLimit);
bv.setBit(docId);
}
@@ -278,7 +279,7 @@ PostingStore<DataT>::makeBitVector(EntryRef &ref)
ref = bPair.ref;
}
-
+
template <typename DataT>
void
PostingStore<DataT>::applyNewBitVector(EntryRef &ref,
@@ -314,7 +315,7 @@ PostingStore<DataT>::applyNewBitVector(EntryRef &ref,
ref = bPair.ref;
}
-
+
template <typename DataT>
void
PostingStore<DataT>::apply(BitVector &bv,
@@ -628,3 +629,10 @@ template class PostingStore<BTreeNoLeafData>;
template class PostingStore<int32_t>;
}
+
+namespace vespalib::datastore {
+ using namespace btree;
+
+
+
+}
diff --git a/searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp b/searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp
index 51e15c26b8f..fd4b0365ca1 100644
--- a/searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp
@@ -11,9 +11,10 @@
#include <vespa/searchlib/common/i_gid_to_lid_mapper_factory.h>
#include <vespa/searchlib/query/query_term_simple.h>
#include <vespa/vespalib/data/fileheader.h>
+#include <vespa/vespalib/datastore/unique_store_builder.h>
#include <vespa/vespalib/datastore/datastore.hpp>
#include <vespa/vespalib/datastore/unique_store.hpp>
-#include <vespa/vespalib/datastore/unique_store_builder.h>
+#include <vespa/vespalib/datastore/buffer_type.hpp>
#include <vespa/log/log.h>
LOG_SETUP(".searchlib.attribute.reference_attribute");
diff --git a/searchlib/src/vespa/searchlib/memoryindex/field_index.cpp b/searchlib/src/vespa/searchlib/memoryindex/field_index.cpp
index fecb8116f90..c052c9410e2 100644
--- a/searchlib/src/vespa/searchlib/memoryindex/field_index.cpp
+++ b/searchlib/src/vespa/searchlib/memoryindex/field_index.cpp
@@ -15,6 +15,7 @@
#include <vespa/vespalib/btree/btreeroot.hpp>
#include <vespa/vespalib/btree/btreestore.hpp>
#include <vespa/vespalib/util/array.hpp>
+#include <vespa/vespalib/datastore/buffer_type.hpp>
#include <vespa/vespalib/util/exceptions.h>
#include <vespa/vespalib/util/stringfmt.h>
diff --git a/searchlib/src/vespa/searchlib/predicate/simple_index.cpp b/searchlib/src/vespa/searchlib/predicate/simple_index.cpp
index 364324aeb97..1b0db8f52d4 100644
--- a/searchlib/src/vespa/searchlib/predicate/simple_index.cpp
+++ b/searchlib/src/vespa/searchlib/predicate/simple_index.cpp
@@ -7,6 +7,7 @@
#include <vespa/vespalib/btree/btreestore.hpp>
#include <vespa/vespalib/btree/btreenodeallocator.hpp>
#include <vespa/vespalib/util/array.hpp>
+#include <vespa/vespalib/datastore/buffer_type.hpp>
#include <vespa/log/log.h>
LOG_SETUP(".searchlib.predicate.simple_index");
diff --git a/searchlib/src/vespa/searchlib/tensor/dense_tensor_store.cpp b/searchlib/src/vespa/searchlib/tensor/dense_tensor_store.cpp
index bc8362c2643..bbffc7ec4a5 100644
--- a/searchlib/src/vespa/searchlib/tensor/dense_tensor_store.cpp
+++ b/searchlib/src/vespa/searchlib/tensor/dense_tensor_store.cpp
@@ -54,7 +54,7 @@ DenseTensorStore::BufferType::~BufferType() = default;
void
DenseTensorStore::BufferType::cleanHold(void *buffer, size_t offset,
- size_t numElems, CleanContext)
+ ElemCount numElems, CleanContext)
{
memset(static_cast<char *>(buffer) + offset, 0, numElems);
}
diff --git a/searchlib/src/vespa/searchlib/tensor/dense_tensor_store.h b/searchlib/src/vespa/searchlib/tensor/dense_tensor_store.h
index 49e8a585fec..3f27b4c5218 100644
--- a/searchlib/src/vespa/searchlib/tensor/dense_tensor_store.h
+++ b/searchlib/src/vespa/searchlib/tensor/dense_tensor_store.h
@@ -37,7 +37,7 @@ public:
public:
BufferType(const TensorSizeCalc &tensorSizeCalc);
~BufferType() override;
- void cleanHold(void *buffer, size_t offset, size_t numElems, CleanContext cleanCtx) override;
+ void cleanHold(void *buffer, size_t offset, ElemCount numElems, CleanContext cleanCtx) override;
};
private:
DataStoreType _concreteStore;
diff --git a/searchlib/src/vespa/searchlib/tensor/direct_tensor_store.cpp b/searchlib/src/vespa/searchlib/tensor/direct_tensor_store.cpp
index a74da056d00..db0bb7f875f 100644
--- a/searchlib/src/vespa/searchlib/tensor/direct_tensor_store.cpp
+++ b/searchlib/src/vespa/searchlib/tensor/direct_tensor_store.cpp
@@ -3,6 +3,7 @@
#include "direct_tensor_store.h"
#include <vespa/eval/eval/value.h>
#include <vespa/vespalib/datastore/datastore.hpp>
+#include <vespa/vespalib/datastore/buffer_type.hpp>
using vespalib::datastore::EntryRef;
@@ -16,7 +17,7 @@ DirectTensorStore::TensorBufferType::TensorBufferType()
}
void
-DirectTensorStore::TensorBufferType::cleanHold(void* buffer, size_t offset, size_t num_elems, CleanContext clean_ctx)
+DirectTensorStore::TensorBufferType::cleanHold(void* buffer, size_t offset, ElemCount num_elems, CleanContext clean_ctx)
{
TensorSP* elem = static_cast<TensorSP*>(buffer) + offset;
for (size_t i = 0; i < num_elems; ++i) {
diff --git a/searchlib/src/vespa/searchlib/tensor/direct_tensor_store.h b/searchlib/src/vespa/searchlib/tensor/direct_tensor_store.h
index f5f2f59d85f..f2867eaa643 100644
--- a/searchlib/src/vespa/searchlib/tensor/direct_tensor_store.h
+++ b/searchlib/src/vespa/searchlib/tensor/direct_tensor_store.h
@@ -28,7 +28,7 @@ private:
using CleanContext = typename ParentType::CleanContext;
public:
TensorBufferType();
- virtual void cleanHold(void* buffer, size_t offset, size_t num_elems, CleanContext clean_ctx) override;
+ virtual void cleanHold(void* buffer, size_t offset, ElemCount num_elems, CleanContext clean_ctx) override;
};
TensorStoreType _tensor_store;