summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@broadpark.no>2021-01-05 12:51:15 +0100
committerTor Egge <Tor.Egge@broadpark.no>2021-01-05 14:58:59 +0100
commit42a02eddf6b450682994afae68249171fe7876b8 (patch)
tree6a0a14eac83492008788f41baf81c6dcc87d0a5d /searchcore
parent6382cb8513ab166e4e4184e0ddebd60f97fb6bb3 (diff)
Add low level support for stopping a running disk index fusion.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/tests/proton/feed_and_search/feed_and_search.cpp11
-rw-r--r--searchcore/src/vespa/searchcore/proton/index/indexmanager.cpp4
2 files changed, 11 insertions, 4 deletions
diff --git a/searchcore/src/tests/proton/feed_and_search/feed_and_search.cpp b/searchcore/src/tests/proton/feed_and_search/feed_and_search.cpp
index 74a2a14dbd6..cd48256792f 100644
--- a/searchcore/src/tests/proton/feed_and_search/feed_and_search.cpp
+++ b/searchcore/src/tests/proton/feed_and_search/feed_and_search.cpp
@@ -5,6 +5,7 @@
#include <vespa/document/fieldvalue/fieldvalue.h>
#include <vespa/searchlib/common/documentsummary.h>
#include <vespa/vespalib/util/sequencedtaskexecutor.h>
+#include <vespa/searchlib/common/flush_token.h>
#include <vespa/searchlib/diskindex/diskindex.h>
#include <vespa/searchlib/diskindex/fusion.h>
#include <vespa/searchlib/diskindex/indexbuilder.h>
@@ -29,6 +30,7 @@ using document::DataType;
using document::Document;
using document::FieldValue;
using search::DocumentIdT;
+using search::FlushToken;
using search::TuneFileIndexing;
using search::TuneFileSearch;
using search::diskindex::DiskIndex;
@@ -194,7 +196,8 @@ void Test::requireThatMemoryIndexCanBeDumpedAndSearched() {
false /* dynamicKPosOccFormat */,
tuneFileIndexing,
fileHeaderContext,
- sharedExecutor);
+ sharedExecutor,
+ std::make_shared<FlushToken>());
ASSERT_TRUE(fret2);
// Fusion test with all docs removed in output (doesn't affect word list)
@@ -212,7 +215,8 @@ void Test::requireThatMemoryIndexCanBeDumpedAndSearched() {
false /* dynamicKPosOccFormat */,
tuneFileIndexing,
fileHeaderContext,
- sharedExecutor);
+ sharedExecutor,
+ std::make_shared<FlushToken>());
ASSERT_TRUE(fret4);
// Fusion test with all docs removed in input (affects word list)
@@ -230,7 +234,8 @@ void Test::requireThatMemoryIndexCanBeDumpedAndSearched() {
false /* dynamicKPosOccFormat */,
tuneFileIndexing,
fileHeaderContext,
- sharedExecutor);
+ sharedExecutor,
+ std::make_shared<FlushToken>());
ASSERT_TRUE(fret6);
DiskIndex disk_index(index_dir);
diff --git a/searchcore/src/vespa/searchcore/proton/index/indexmanager.cpp b/searchcore/src/vespa/searchcore/proton/index/indexmanager.cpp
index 6ffd3203019..d93f02c7994 100644
--- a/searchcore/src/vespa/searchcore/proton/index/indexmanager.cpp
+++ b/searchcore/src/vespa/searchcore/proton/index/indexmanager.cpp
@@ -3,6 +3,7 @@
#include "indexmanager.h"
#include "diskindexwrapper.h"
#include "memoryindexwrapper.h"
+#include <vespa/searchlib/common/flush_token.h>
#include <vespa/searchlib/common/serialnumfileheadercontext.h>
#include <vespa/searchlib/diskindex/fusion.h>
@@ -11,6 +12,7 @@ using search::common::FileHeaderContext;
using search::common::SerialNumFileHeaderContext;
using search::index::Schema;
using search::index::SchemaUtil;
+using search::FlushToken;
using search::TuneFileIndexing;
using search::TuneFileIndexManager;
using search::TuneFileSearch;
@@ -68,7 +70,7 @@ IndexManager::MaintainerOperations::runFusion(const Schema &schema,
SerialNumFileHeaderContext fileHeaderContext(_fileHeaderContext, serialNum);
const bool dynamic_k_doc_pos_occ_format = false;
return Fusion::merge(schema, outputDir, sources, selectorArray, dynamic_k_doc_pos_occ_format,
- _tuneFileIndexing, fileHeaderContext, _threadingService.shared());
+ _tuneFileIndexing, fileHeaderContext, _threadingService.shared(), std::make_shared<FlushToken>());
}