summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@online.no>2022-10-06 11:59:59 +0200
committerTor Egge <Tor.Egge@online.no>2022-10-06 11:59:59 +0200
commit82d44433734c3aea906819c31fc054528a91a391 (patch)
tree0b7503c8aa95b00aaede2a77d26d61a3a7c7793c /searchlib
parentbbb47ccadb603a84b3a9d4e695aa098ea46a25ad (diff)
Use TensorBufferStore in SerializedFastValueAttribute.
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/vespa/searchlib/tensor/serialized_fast_value_attribute.cpp12
-rw-r--r--searchlib/src/vespa/searchlib/tensor/serialized_fast_value_attribute.h4
-rw-r--r--searchlib/src/vespa/searchlib/tensor/streamed_value_saver.cpp4
-rw-r--r--searchlib/src/vespa/searchlib/tensor/streamed_value_saver.h6
4 files changed, 13 insertions, 13 deletions
diff --git a/searchlib/src/vespa/searchlib/tensor/serialized_fast_value_attribute.cpp b/searchlib/src/vespa/searchlib/tensor/serialized_fast_value_attribute.cpp
index 7229fbed752..94bf3f1a37b 100644
--- a/searchlib/src/vespa/searchlib/tensor/serialized_fast_value_attribute.cpp
+++ b/searchlib/src/vespa/searchlib/tensor/serialized_fast_value_attribute.cpp
@@ -18,9 +18,9 @@ using namespace vespalib::eval;
namespace search::tensor {
SerializedFastValueAttribute::SerializedFastValueAttribute(stringref name, const Config &cfg)
- : TensorAttribute(name, cfg, _streamedValueStore),
+ : TensorAttribute(name, cfg, _tensorBufferStore),
_tensor_type(cfg.tensorType()),
- _streamedValueStore(_tensor_type)
+ _tensorBufferStore(_tensor_type, {}, 1000u)
{
}
@@ -35,7 +35,7 @@ void
SerializedFastValueAttribute::setTensor(DocId docId, const vespalib::eval::Value &tensor)
{
checkTensorType(tensor);
- EntryRef ref = _streamedValueStore.store_tensor(tensor);
+ EntryRef ref = _tensorBufferStore.store_tensor(tensor);
assert(ref.valid());
setTensorRef(docId, ref);
}
@@ -47,7 +47,7 @@ SerializedFastValueAttribute::getTensor(DocId docId) const
if (docId < getCommittedDocIdLimit()) {
ref = acquire_entry_ref(docId);
}
- return _streamedValueStore.get_tensor(ref);
+ return _tensorBufferStore.get_tensor(ref);
}
bool
@@ -71,7 +71,7 @@ SerializedFastValueAttribute::onLoad(vespalib::Executor *)
}
tensorReader.readBlob(&buffer[0], tensorSize);
vespalib::nbostream source(&buffer[0], tensorSize);
- EntryRef ref = _streamedValueStore.store_encoded_tensor(source);
+ EntryRef ref = _tensorBufferStore.store_encoded_tensor(source);
_refVector.push_back(AtomicEntryRef(ref));
} else {
EntryRef invalid;
@@ -93,7 +93,7 @@ SerializedFastValueAttribute::onInitSave(vespalib::stringref fileName)
(std::move(guard),
this->createAttributeHeader(fileName),
getRefCopy(),
- _streamedValueStore);
+ _tensorBufferStore);
}
}
diff --git a/searchlib/src/vespa/searchlib/tensor/serialized_fast_value_attribute.h b/searchlib/src/vespa/searchlib/tensor/serialized_fast_value_attribute.h
index 0ef644813ee..5dd49a2bbc4 100644
--- a/searchlib/src/vespa/searchlib/tensor/serialized_fast_value_attribute.h
+++ b/searchlib/src/vespa/searchlib/tensor/serialized_fast_value_attribute.h
@@ -3,7 +3,7 @@
#pragma once
#include "tensor_attribute.h"
-#include "streamed_value_store.h"
+#include "tensor_buffer_store.h"
namespace search::tensor {
@@ -18,7 +18,7 @@ namespace search::tensor {
*/
class SerializedFastValueAttribute : public TensorAttribute {
vespalib::eval::ValueType _tensor_type;
- StreamedValueStore _streamedValueStore; // data store for serialized tensors
+ TensorBufferStore _tensorBufferStore; // data store for serialized tensors
public:
SerializedFastValueAttribute(vespalib::stringref baseFileName, const Config &cfg);
~SerializedFastValueAttribute() override;
diff --git a/searchlib/src/vespa/searchlib/tensor/streamed_value_saver.cpp b/searchlib/src/vespa/searchlib/tensor/streamed_value_saver.cpp
index 25d3901d761..4c188bb3370 100644
--- a/searchlib/src/vespa/searchlib/tensor/streamed_value_saver.cpp
+++ b/searchlib/src/vespa/searchlib/tensor/streamed_value_saver.cpp
@@ -1,7 +1,7 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "streamed_value_saver.h"
-#include "streamed_value_store.h"
+#include "tensor_buffer_store.h"
#include <vespa/searchlib/attribute/iattributesavetarget.h>
#include <vespa/searchlib/util/bufferwriter.h>
@@ -15,7 +15,7 @@ StreamedValueSaver::
StreamedValueSaver(GenerationHandler::Guard &&guard,
const attribute::AttributeHeader &header,
RefCopyVector &&refs,
- const StreamedValueStore &tensorStore)
+ const TensorBufferStore &tensorStore)
: AttributeSaver(std::move(guard), header),
_refs(std::move(refs)),
_tensorStore(tensorStore)
diff --git a/searchlib/src/vespa/searchlib/tensor/streamed_value_saver.h b/searchlib/src/vespa/searchlib/tensor/streamed_value_saver.h
index c1d0165d55d..0ce864769f7 100644
--- a/searchlib/src/vespa/searchlib/tensor/streamed_value_saver.h
+++ b/searchlib/src/vespa/searchlib/tensor/streamed_value_saver.h
@@ -7,7 +7,7 @@
namespace search::tensor {
-class StreamedValueStore;
+class TensorBufferStore;
/*
* Class for saving a tensor attribute.
@@ -20,14 +20,14 @@ private:
using GenerationHandler = vespalib::GenerationHandler;
RefCopyVector _refs;
- const StreamedValueStore &_tensorStore;
+ const TensorBufferStore &_tensorStore;
bool onSave(IAttributeSaveTarget &saveTarget) override;
public:
StreamedValueSaver(GenerationHandler::Guard &&guard,
const attribute::AttributeHeader &header,
RefCopyVector &&refs,
- const StreamedValueStore &tensorStore);
+ const TensorBufferStore &tensorStore);
virtual ~StreamedValueSaver();
};