summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@online.no>2021-10-28 21:03:14 +0200
committerTor Egge <Tor.Egge@online.no>2021-10-28 21:03:14 +0200
commit85115fc4804effd03d89c229be30d13a9d6471c5 (patch)
treecd28081347dda032c7d5e8ee2716f0974e9db5cc /searchlib
parent13472dff416a84e4295cf11e618ab17e97a59f82 (diff)
Rename ISequencedTaskExecutor::sync() to sync_all().
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/tests/diskindex/fusion/fusion_test.cpp16
-rw-r--r--searchlib/src/tests/memoryindex/document_inverter/document_inverter_test.cpp4
-rw-r--r--searchlib/src/tests/memoryindex/field_index/field_index_test.cpp46
-rw-r--r--searchlib/src/vespa/searchlib/memoryindex/document_inverter.cpp4
-rw-r--r--searchlib/src/vespa/searchlib/memoryindex/memory_index.cpp8
5 files changed, 39 insertions, 39 deletions
diff --git a/searchlib/src/tests/diskindex/fusion/fusion_test.cpp b/searchlib/src/tests/diskindex/fusion/fusion_test.cpp
index 16657a373ff..ed661b7499f 100644
--- a/searchlib/src/tests/diskindex/fusion/fusion_test.cpp
+++ b/searchlib/src/tests/diskindex/fusion/fusion_test.cpp
@@ -326,9 +326,9 @@ FusionTest::requireThatFusionIsWorking(const vespalib::string &prefix, bool dire
doc = make_doc10(b);
inv.invertDocument(10, *doc);
- invertThreads->sync();
+ invertThreads->sync_all();
myPushDocument(inv);
- pushThreads->sync();
+ pushThreads->sync_all();
b.startDocument("id:ns:searchdocument::11").
startIndexField("f3").
@@ -336,9 +336,9 @@ FusionTest::requireThatFusionIsWorking(const vespalib::string &prefix, bool dire
endField();
doc = b.endDocument();
inv.invertDocument(11, *doc);
- invertThreads->sync();
+ invertThreads->sync_all();
myPushDocument(inv);
- pushThreads->sync();
+ pushThreads->sync_all();
b.startDocument("id:ns:searchdocument::12").
startIndexField("f3").
@@ -346,9 +346,9 @@ FusionTest::requireThatFusionIsWorking(const vespalib::string &prefix, bool dire
endField();
doc = b.endDocument();
inv.invertDocument(12, *doc);
- invertThreads->sync();
+ invertThreads->sync_all();
myPushDocument(inv);
- pushThreads->sync();
+ pushThreads->sync_all();
IndexBuilder ib(schema);
vespalib::string dump2dir = prefix + "dump2";
@@ -465,9 +465,9 @@ FusionTest::make_simple_index(const vespalib::string &dump_dir, const IFieldLeng
DocumentInverter inv(_schema, *invertThreads, *pushThreads, fic);
inv.invertDocument(10, *make_doc10(b));
- invertThreads->sync();
+ invertThreads->sync_all();
myPushDocument(inv);
- pushThreads->sync();
+ pushThreads->sync_all();
IndexBuilder ib(_schema);
TuneFileIndexing tuneFileIndexing;
diff --git a/searchlib/src/tests/memoryindex/document_inverter/document_inverter_test.cpp b/searchlib/src/tests/memoryindex/document_inverter/document_inverter_test.cpp
index a8f1af08158..3bcf75680cc 100644
--- a/searchlib/src/tests/memoryindex/document_inverter/document_inverter_test.cpp
+++ b/searchlib/src/tests/memoryindex/document_inverter/document_inverter_test.cpp
@@ -155,14 +155,14 @@ struct DocumentInverterTest : public ::testing::Test {
}
void pushDocuments() {
- _invertThreads->sync();
+ _invertThreads->sync_all();
uint32_t fieldId = 0;
for (auto &inverter : _inv.getInverters()) {
_inserter.setFieldId(fieldId);
inverter->pushDocuments();
++fieldId;
}
- _pushThreads->sync();
+ _pushThreads->sync_all();
}
};
diff --git a/searchlib/src/tests/memoryindex/field_index/field_index_test.cpp b/searchlib/src/tests/memoryindex/field_index/field_index_test.cpp
index bde78a6229f..7cf40a5be63 100644
--- a/searchlib/src/tests/memoryindex/field_index/field_index_test.cpp
+++ b/searchlib/src/tests/memoryindex/field_index/field_index_test.cpp
@@ -415,7 +415,7 @@ myremove(uint32_t docId, DocumentInverter &inv,
ISequencedTaskExecutor &invertThreads)
{
inv.removeDocument(docId);
- invertThreads.sync();
+ invertThreads.sync_all();
inv.pushDocuments(std::shared_ptr<vespalib::IDestructorCallback>());
}
@@ -480,7 +480,7 @@ myCommit(FieldIndexCollection &fieldIndexes, ISequencedTaskExecutor &pushThreads
{ fieldIndex->commit(); });
++fieldId;
}
- pushThreads.sync();
+ pushThreads.sync_all();
}
void
@@ -950,9 +950,9 @@ TEST_F(BasicInverterTest, require_that_inversion_is_working)
endField();
doc = _b.endDocument();
_inv.invertDocument(10, *doc);
- _invertThreads->sync();
+ _invertThreads->sync_all();
myPushDocument(_inv);
- _pushThreads->sync();
+ _pushThreads->sync_all();
_b.startDocument("id:ns:searchdocument::20");
_b.startIndexField("f0").
@@ -960,9 +960,9 @@ TEST_F(BasicInverterTest, require_that_inversion_is_working)
endField();
doc = _b.endDocument();
_inv.invertDocument(20, *doc);
- _invertThreads->sync();
+ _invertThreads->sync_all();
myPushDocument(_inv);
- _pushThreads->sync();
+ _pushThreads->sync_all();
_b.startDocument("id:ns:searchdocument::30");
_b.startIndexField("f0").
@@ -991,9 +991,9 @@ TEST_F(BasicInverterTest, require_that_inversion_is_working)
endField();
doc = _b.endDocument();
_inv.invertDocument(30, *doc);
- _invertThreads->sync();
+ _invertThreads->sync_all();
myPushDocument(_inv);
- _pushThreads->sync();
+ _pushThreads->sync_all();
_b.startDocument("id:ns:searchdocument::40");
_b.startIndexField("f0").
@@ -1002,9 +1002,9 @@ TEST_F(BasicInverterTest, require_that_inversion_is_working)
endField();
doc = _b.endDocument();
_inv.invertDocument(40, *doc);
- _invertThreads->sync();
+ _invertThreads->sync_all();
myPushDocument(_inv);
- _pushThreads->sync();
+ _pushThreads->sync_all();
_b.startDocument("id:ns:searchdocument::999");
_b.startIndexField("f0").
@@ -1032,12 +1032,12 @@ TEST_F(BasicInverterTest, require_that_inversion_is_working)
doc = _b.endDocument();
for (uint32_t docId = 10000; docId < 20000; ++docId) {
_inv.invertDocument(docId, *doc);
- _invertThreads->sync();
+ _invertThreads->sync_all();
myPushDocument(_inv);
- _pushThreads->sync();
+ _pushThreads->sync_all();
}
- _pushThreads->sync();
+ _pushThreads->sync_all();
DataStoreBase::MemStats beforeStats = getFeatureStoreMemStats(_fic);
LOG(info,
"Before feature compaction: allocElems=%zu, usedElems=%zu"
@@ -1149,17 +1149,17 @@ TEST_F(BasicInverterTest, require_that_inverter_handles_remove_via_document_remo
_b.startIndexField("f1").addStr("a").addStr("c").endField();
Document::UP doc1 = _b.endDocument();
_inv.invertDocument(1, *doc1.get());
- _invertThreads->sync();
+ _invertThreads->sync_all();
myPushDocument(_inv);
- _pushThreads->sync();
+ _pushThreads->sync_all();
_b.startDocument("id:ns:searchdocument::2");
_b.startIndexField("f0").addStr("b").addStr("c").endField();
Document::UP doc2 = _b.endDocument();
_inv.invertDocument(2, *doc2.get());
- _invertThreads->sync();
+ _invertThreads->sync_all();
myPushDocument(_inv);
- _pushThreads->sync();
+ _pushThreads->sync_all();
EXPECT_TRUE(assertPostingList("[1]", find("a", 0)));
EXPECT_TRUE(assertPostingList("[1,2]", find("b", 0)));
@@ -1168,7 +1168,7 @@ TEST_F(BasicInverterTest, require_that_inverter_handles_remove_via_document_remo
EXPECT_TRUE(assertPostingList("[1]", find("c", 1)));
myremove(1, _inv, *_invertThreads);
- _pushThreads->sync();
+ _pushThreads->sync_all();
EXPECT_TRUE(assertPostingList("[]", find("a", 0)));
EXPECT_TRUE(assertPostingList("[2]", find("b", 0)));
@@ -1318,10 +1318,10 @@ TEST_F(UriInverterTest, require_that_uri_indexing_is_working)
endField();
doc = _b.endDocument();
_inv.invertDocument(10, *doc);
- _invertThreads->sync();
+ _invertThreads->sync_all();
myPushDocument(_inv);
- _pushThreads->sync();
+ _pushThreads->sync_all();
SimpleMatchData match_data;
{
@@ -1394,10 +1394,10 @@ TEST_F(CjkInverterTest, require_that_cjk_indexing_is_working)
endField();
doc = _b.endDocument();
_inv.invertDocument(10, *doc);
- _invertThreads->sync();
+ _invertThreads->sync_all();
myPushDocument(_inv);
- _pushThreads->sync();
+ _pushThreads->sync_all();
SimpleMatchData match_data;
uint32_t fieldId = _schema.getIndexFieldId("f0");
@@ -1472,7 +1472,7 @@ struct RemoverTest : public FieldIndexCollectionTest {
void remove(uint32_t docId) {
DocumentInverter inv(schema, *_invertThreads, *_pushThreads, fic);
myremove(docId, inv, *_invertThreads);
- _pushThreads->sync();
+ _pushThreads->sync_all();
EXPECT_FALSE(fic.getFieldIndex(0u)->getDocumentRemover().
getStore().get(docId).valid());
}
diff --git a/searchlib/src/vespa/searchlib/memoryindex/document_inverter.cpp b/searchlib/src/vespa/searchlib/memoryindex/document_inverter.cpp
index 525bc4306ec..4f03a5cb95f 100644
--- a/searchlib/src/vespa/searchlib/memoryindex/document_inverter.cpp
+++ b/searchlib/src/vespa/searchlib/memoryindex/document_inverter.cpp
@@ -77,8 +77,8 @@ DocumentInverter::DocumentInverter(const Schema &schema,
DocumentInverter::~DocumentInverter()
{
- _invertThreads.sync();
- _pushThreads.sync();
+ _invertThreads.sync_all();
+ _pushThreads.sync_all();
}
void
diff --git a/searchlib/src/vespa/searchlib/memoryindex/memory_index.cpp b/searchlib/src/vespa/searchlib/memoryindex/memory_index.cpp
index 1574c94e164..177d8e612bd 100644
--- a/searchlib/src/vespa/searchlib/memoryindex/memory_index.cpp
+++ b/searchlib/src/vespa/searchlib/memoryindex/memory_index.cpp
@@ -73,8 +73,8 @@ MemoryIndex::MemoryIndex(const Schema& schema,
MemoryIndex::~MemoryIndex()
{
- _invertThreads.sync();
- _pushThreads.sync();
+ _invertThreads.sync_all();
+ _pushThreads.sync_all();
}
void
@@ -109,8 +109,8 @@ MemoryIndex::removeDocument(uint32_t docId)
void
MemoryIndex::commit(const std::shared_ptr<vespalib::IDestructorCallback> &onWriteDone)
{
- _invertThreads.sync(); // drain inverting into this inverter
- _pushThreads.sync(); // drain use of other inverter
+ _invertThreads.sync_all(); // drain inverting into this inverter
+ _pushThreads.sync_all(); // drain use of other inverter
_inverter->pushDocuments(onWriteDone);
flipInverter();
}