summaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/tensor/direct_tensor_attribute.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'searchlib/src/vespa/searchlib/tensor/direct_tensor_attribute.cpp')
-rw-r--r--searchlib/src/vespa/searchlib/tensor/direct_tensor_attribute.cpp52
1 files changed, 0 insertions, 52 deletions
diff --git a/searchlib/src/vespa/searchlib/tensor/direct_tensor_attribute.cpp b/searchlib/src/vespa/searchlib/tensor/direct_tensor_attribute.cpp
index 7730f340e01..d9fe025b4e5 100644
--- a/searchlib/src/vespa/searchlib/tensor/direct_tensor_attribute.cpp
+++ b/searchlib/src/vespa/searchlib/tensor/direct_tensor_attribute.cpp
@@ -1,16 +1,8 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "direct_tensor_attribute.h"
-#include "direct_tensor_saver.h"
-
#include <vespa/eval/eval/fast_value.h>
#include <vespa/eval/eval/value.h>
-#include <vespa/searchlib/attribute/readerbase.h>
-#include <vespa/searchlib/util/fileutil.h>
-#include <vespa/vespalib/util/array.h>
-
-#include "blob_sequence_reader.h"
-#include "tensor_deserialize.h"
using vespalib::eval::FastValueBuilderFactory;
@@ -27,39 +19,6 @@ DirectTensorAttribute::~DirectTensorAttribute()
_tensorStore.clearHoldLists();
}
-bool
-DirectTensorAttribute::onLoad(vespalib::Executor *)
-{
- BlobSequenceReader tensorReader(*this);
- if (!tensorReader.hasData()) {
- return false;
- }
- setCreateSerialNum(tensorReader.getCreateSerialNum());
- assert(tensorReader.getVersion() == getVersion());
- uint32_t numDocs = tensorReader.getDocIdLimit();
- _refVector.reset();
- _refVector.unsafe_reserve(numDocs);
- vespalib::Array<char> buffer(1024);
- for (uint32_t lid = 0; lid < numDocs; ++lid) {
- uint32_t tensorSize = tensorReader.getNextSize();
- if (tensorSize != 0) {
- if (tensorSize > buffer.size()) {
- buffer.resize(tensorSize + 1024);
- }
- tensorReader.readBlob(&buffer[0], tensorSize);
- auto tensor = deserialize_tensor(&buffer[0], tensorSize);
- EntryRef ref = _direct_store.store_tensor(std::move(tensor));
- _refVector.push_back(AtomicEntryRef(ref));
- } else {
- EntryRef invalid;
- _refVector.push_back(AtomicEntryRef(invalid));
- }
- }
- setNumDocs(numDocs);
- setCommittedDocIdLimit(numDocs);
- return true;
-}
-
void
DirectTensorAttribute::set_tensor(DocId lid, std::unique_ptr<vespalib::eval::Value> tensor)
{
@@ -129,15 +88,4 @@ DirectTensorAttribute::get_tensor_ref(DocId docId) const
return *ptr;
}
-std::unique_ptr<AttributeSaver>
-DirectTensorAttribute::onInitSave(vespalib::stringref fileName)
-{
- vespalib::GenerationHandler::Guard guard(getGenerationHandler().takeGuard());
- return std::make_unique<DirectTensorAttributeSaver>
- (std::move(guard),
- this->createAttributeHeader(fileName),
- getRefCopy(),
- _direct_store);
-}
-
} // namespace