summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorGeir Storli <geirst@verizonmedia.com>2020-06-12 14:07:49 +0000
committerGeir Storli <geirst@verizonmedia.com>2020-06-17 13:17:54 +0000
commit5566148a0ad253569e44b4e21ada7e8e59241eaf (patch)
tree43434e8a049323a2c956b23539a2d969f92cefb8 /searchlib
parente55f4b911fd3dab1270514edc99b5e3d3a086833 (diff)
Implement initial support for two-phase puts in attribute writer.
This is only turned on for tensor attributes with a hnsw index that allows multi-threaded indexing.
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/vespa/searchlib/tensor/tensor_attribute.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/tensor/tensor_attribute.h5
2 files changed, 3 insertions, 4 deletions
diff --git a/searchlib/src/vespa/searchlib/tensor/tensor_attribute.cpp b/searchlib/src/vespa/searchlib/tensor/tensor_attribute.cpp
index f8db11ae9d8..6cf4f6d2689 100644
--- a/searchlib/src/vespa/searchlib/tensor/tensor_attribute.cpp
+++ b/searchlib/src/vespa/searchlib/tensor/tensor_attribute.cpp
@@ -263,7 +263,7 @@ TensorAttribute::prepare_set_tensor(DocId docid, const Tensor& tensor) const
void
TensorAttribute::complete_set_tensor(DocId docid, const Tensor& tensor,
- std::future<std::unique_ptr<PrepareResult>> prepare_result)
+ std::unique_ptr<PrepareResult> prepare_result)
{
(void) docid;
(void) tensor;
diff --git a/searchlib/src/vespa/searchlib/tensor/tensor_attribute.h b/searchlib/src/vespa/searchlib/tensor/tensor_attribute.h
index f752b9f7f2e..8380e485172 100644
--- a/searchlib/src/vespa/searchlib/tensor/tensor_attribute.h
+++ b/searchlib/src/vespa/searchlib/tensor/tensor_attribute.h
@@ -7,7 +7,6 @@
#include "tensor_store.h"
#include <vespa/searchlib/attribute/not_implemented_attribute.h>
#include <vespa/vespalib/util/rcuvector.h>
-#include <future>
namespace search::tensor {
@@ -66,9 +65,9 @@ public:
* Performs the complete step in a two-phase operation to set a tensor for a document.
*
* This function is only called by the attribute writer thread.
- * It must wait for the result from the prepare step (via the future) before it does the modifying changes.
+ * It uses the result from the prepare step to do the modifying changes.
*/
- virtual void complete_set_tensor(DocId docid, const Tensor& tensor, std::future<std::unique_ptr<PrepareResult>> prepare_result);
+ virtual void complete_set_tensor(DocId docid, const Tensor& tensor, std::unique_ptr<PrepareResult> prepare_result);
virtual void compactWorst() = 0;
};