summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp1
-rw-r--r--searchcore/src/tests/proton/index/fusionrunner_test.cpp1
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/executor_thread_service.h8
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.cpp44
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h29
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/fast_access_feed_view.cpp1
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/feedhandler.cpp1
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/searchable_feed_view.cpp1
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.cpp5
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/visibilityhandler.cpp1
-rw-r--r--searchcorespi/src/vespa/searchcorespi/index/ithreadingservice.h4
11 files changed, 51 insertions, 45 deletions
diff --git a/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp b/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp
index 153b1ae2867..e673fa2a5df 100644
--- a/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp
@@ -27,6 +27,7 @@
#include <vespa/searchlib/transactionlog/translogserver.h>
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/vespalib/util/closuretask.h>
+#include <vespa/vespalib/util/lambdatask.h>
#include <vespa/vespalib/util/exceptions.h>
#include <vespa/vespalib/io/fileutil.h>
diff --git a/searchcore/src/tests/proton/index/fusionrunner_test.cpp b/searchcore/src/tests/proton/index/fusionrunner_test.cpp
index e6efa246484..429452df2ec 100644
--- a/searchcore/src/tests/proton/index/fusionrunner_test.cpp
+++ b/searchcore/src/tests/proton/index/fusionrunner_test.cpp
@@ -11,6 +11,7 @@
#include <vespa/searchlib/index/docbuilder.h>
#include <vespa/searchlib/index/dummyfileheadercontext.h>
#include <vespa/searchlib/query/tree/simplequery.h>
+#include <vespa/searchlib/common/isequencedtaskexecutor.h>
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/fastos/file.h>
#include <set>
diff --git a/searchcore/src/vespa/searchcore/proton/server/executor_thread_service.h b/searchcore/src/vespa/searchcore/proton/server/executor_thread_service.h
index c938288c714..4b1e8408c8e 100644
--- a/searchcore/src/vespa/searchcore/proton/server/executor_thread_service.h
+++ b/searchcore/src/vespa/searchcore/proton/server/executor_thread_service.h
@@ -24,15 +24,15 @@ public:
/**
* Implements IThreadService
*/
- virtual vespalib::Executor::Task::UP execute(vespalib::Executor::Task::UP task) override {
+ vespalib::Executor::Task::UP execute(vespalib::Executor::Task::UP task) override {
return _executor.execute(std::move(task));
}
- virtual void run(vespalib::Runnable &runnable) override;
- virtual vespalib::Syncable &sync() override {
+ void run(vespalib::Runnable &runnable) override;
+ vespalib::Syncable &sync() override {
_executor.sync();
return *this;
}
- virtual bool isCurrentThread() const override;
+ bool isCurrentThread() const override;
size_t getNumThreads() const override { return _executor.getNumThreads(); }
};
diff --git a/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.cpp b/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.cpp
index 1c4825753a8..1cb30518f8e 100644
--- a/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.cpp
@@ -1,16 +1,19 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "executorthreadingservice.h"
-#include <vespa/vespalib/util/executor.h>
#include <vespa/searchcore/proton/metrics/executor_threading_service_stats.h>
+#include <vespa/searchlib/common/sequencedtaskexecutor.h>
using vespalib::ThreadStackExecutorBase;
+using search::SequencedTaskExecutor;
namespace proton {
-ExecutorThreadingService::ExecutorThreadingService(uint32_t threads,
- uint32_t stackSize,
- uint32_t taskLimit)
+ SequencedTaskExecutor & cast(search::ISequencedTaskExecutor & executor) {
+ return static_cast<SequencedTaskExecutor &>(executor);
+ }
+
+ExecutorThreadingService::ExecutorThreadingService(uint32_t threads, uint32_t stackSize, uint32_t taskLimit)
: _masterExecutor(1, stackSize),
_indexExecutor(1, stackSize, taskLimit),
@@ -18,14 +21,13 @@ ExecutorThreadingService::ExecutorThreadingService(uint32_t threads,
_masterService(_masterExecutor),
_indexService(_indexExecutor),
_summaryService(_summaryExecutor),
- _indexFieldInverter(threads, taskLimit),
- _indexFieldWriter(threads, taskLimit),
- _attributeFieldWriter(threads, taskLimit)
+ _indexFieldInverter(std::make_unique<SequencedTaskExecutor>(threads, taskLimit)),
+ _indexFieldWriter(std::make_unique<SequencedTaskExecutor>(threads, taskLimit)),
+ _attributeFieldWriter(std::make_unique<SequencedTaskExecutor>(threads, taskLimit))
{
}
-ExecutorThreadingService::~ExecutorThreadingService() {
-}
+ExecutorThreadingService::~ExecutorThreadingService() = default;
vespalib::Syncable &
ExecutorThreadingService::sync()
@@ -34,11 +36,11 @@ ExecutorThreadingService::sync()
if (!isMasterThread) {
_masterExecutor.sync();
}
- _attributeFieldWriter.sync();
+ _attributeFieldWriter->sync();
_indexExecutor.sync();
_summaryExecutor.sync();
- _indexFieldInverter.sync();
- _indexFieldWriter.sync();
+ _indexFieldInverter->sync();
+ _indexFieldWriter->sync();
if (!isMasterThread) {
_masterExecutor.sync();
}
@@ -50,13 +52,13 @@ ExecutorThreadingService::shutdown()
{
_masterExecutor.shutdown();
_masterExecutor.sync();
- _attributeFieldWriter.sync();
+ _attributeFieldWriter->sync();
_summaryExecutor.shutdown();
_summaryExecutor.sync();
_indexExecutor.shutdown();
_indexExecutor.sync();
- _indexFieldInverter.sync();
- _indexFieldWriter.sync();
+ _indexFieldInverter->sync();
+ _indexFieldWriter->sync();
}
void
@@ -64,9 +66,9 @@ ExecutorThreadingService::setTaskLimit(uint32_t taskLimit, uint32_t summaryTaskL
{
_indexExecutor.setTaskLimit(taskLimit);
_summaryExecutor.setTaskLimit(summaryTaskLimit);
- _indexFieldInverter.setTaskLimit(taskLimit);
- _indexFieldWriter.setTaskLimit(taskLimit);
- _attributeFieldWriter.setTaskLimit(taskLimit);
+ cast(*_indexFieldInverter).setTaskLimit(taskLimit);
+ cast(*_indexFieldWriter).setTaskLimit(taskLimit);
+ cast(*_attributeFieldWriter).setTaskLimit(taskLimit);
}
ExecutorThreadingServiceStats
@@ -75,9 +77,9 @@ ExecutorThreadingService::getStats()
return ExecutorThreadingServiceStats(_masterExecutor.getStats(),
_indexExecutor.getStats(),
_summaryExecutor.getStats(),
- _indexFieldInverter.getStats(),
- _indexFieldWriter.getStats(),
- _attributeFieldWriter.getStats());
+ cast(*_indexFieldInverter).getStats(),
+ cast(*_indexFieldWriter).getStats(),
+ cast(*_attributeFieldWriter).getStats());
}
} // namespace proton
diff --git a/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h b/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h
index 25aa65d43a7..68449a70470 100644
--- a/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h
+++ b/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h
@@ -5,7 +5,6 @@
#include <vespa/searchcorespi/index/ithreadingservice.h>
#include <vespa/vespalib/util/blockingthreadstackexecutor.h>
#include <vespa/vespalib/util/threadstackexecutor.h>
-#include <vespa/searchlib/common/sequencedtaskexecutor.h>
namespace proton {
@@ -24,9 +23,9 @@ private:
ExecutorThreadService _masterService;
ExecutorThreadService _indexService;
ExecutorThreadService _summaryService;
- search::SequencedTaskExecutor _indexFieldInverter;
- search::SequencedTaskExecutor _indexFieldWriter;
- search::SequencedTaskExecutor _attributeFieldWriter;
+ std::unique_ptr<search::ISequencedTaskExecutor> _indexFieldInverter;
+ std::unique_ptr<search::ISequencedTaskExecutor> _indexFieldWriter;
+ std::unique_ptr<search::ISequencedTaskExecutor> _attributeFieldWriter;
public:
/**
@@ -38,12 +37,12 @@ public:
ExecutorThreadingService(uint32_t threads = 1,
uint32_t stackSize = 128 * 1024,
uint32_t taskLimit = 1000);
- ~ExecutorThreadingService();
+ ~ExecutorThreadingService() override;
/**
* Implements vespalib::Syncable
*/
- virtual vespalib::Syncable &sync() override;
+ vespalib::Syncable &sync() override;
void shutdown();
@@ -63,27 +62,27 @@ public:
/**
* Implements IThreadingService
*/
- virtual searchcorespi::index::IThreadService &master() override {
+ searchcorespi::index::IThreadService &master() override {
return _masterService;
}
- virtual searchcorespi::index::IThreadService &index() override {
+ searchcorespi::index::IThreadService &index() override {
return _indexService;
}
- virtual searchcorespi::index::IThreadService &summary() override {
+ searchcorespi::index::IThreadService &summary() override {
return _summaryService;
}
- virtual search::ISequencedTaskExecutor &indexFieldInverter() override {
- return _indexFieldInverter;
+ search::ISequencedTaskExecutor &indexFieldInverter() override {
+ return *_indexFieldInverter;
}
- virtual search::ISequencedTaskExecutor &indexFieldWriter() override {
- return _indexFieldWriter;
+ search::ISequencedTaskExecutor &indexFieldWriter() override {
+ return *_indexFieldWriter;
}
- virtual search::ISequencedTaskExecutor &attributeFieldWriter() override {
- return _attributeFieldWriter;
+ search::ISequencedTaskExecutor &attributeFieldWriter() override {
+ return *_attributeFieldWriter;
}
ExecutorThreadingServiceStats getStats();
diff --git a/searchcore/src/vespa/searchcore/proton/server/fast_access_feed_view.cpp b/searchcore/src/vespa/searchcore/proton/server/fast_access_feed_view.cpp
index c3c0add2b85..6ec3ac9e1d7 100644
--- a/searchcore/src/vespa/searchcore/proton/server/fast_access_feed_view.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/fast_access_feed_view.cpp
@@ -5,6 +5,7 @@
#include "operationdonecontext.h"
#include "removedonecontext.h"
#include "putdonecontext.h"
+#include <vespa/searchlib/common/isequencedtaskexecutor.h>
using document::Document;
using document::DocumentUpdate;
diff --git a/searchcore/src/vespa/searchcore/proton/server/feedhandler.cpp b/searchcore/src/vespa/searchcore/proton/server/feedhandler.cpp
index 90b9bbc7f34..dbf375c638d 100644
--- a/searchcore/src/vespa/searchcore/proton/server/feedhandler.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/feedhandler.cpp
@@ -17,6 +17,7 @@
#include <vespa/searchcorespi/index/ithreadingservice.h>
#include <vespa/searchlib/common/gatecallback.h>
#include <vespa/vespalib/util/exceptions.h>
+#include <vespa/vespalib/util/lambdatask.h>
#include <unistd.h>
#include <vespa/log/log.h>
diff --git a/searchcore/src/vespa/searchcore/proton/server/searchable_feed_view.cpp b/searchcore/src/vespa/searchcore/proton/server/searchable_feed_view.cpp
index 4cda07eee8b..28b1c407429 100644
--- a/searchcore/src/vespa/searchcore/proton/server/searchable_feed_view.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/searchable_feed_view.cpp
@@ -6,6 +6,7 @@
#include "removedonecontext.h"
#include <vespa/searchcore/proton/common/feedtoken.h>
#include <vespa/searchcore/proton/documentmetastore/ilidreusedelayer.h>
+#include <vespa/searchlib/common/isequencedtaskexecutor.h>
#include <vespa/vespalib/text/stringtokenizer.h>
#include <vespa/vespalib/util/closuretask.h>
#include <vespa/vespalib/util/exceptions.h>
diff --git a/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.cpp b/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.cpp
index da57f886364..e6845c05119 100644
--- a/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.cpp
@@ -12,13 +12,14 @@
#include <vespa/searchcore/proton/common/feedtoken.h>
#include <vespa/searchcore/proton/documentmetastore/ilidreusedelayer.h>
#include <vespa/searchcore/proton/reference/i_gid_to_lid_change_handler.h>
+#include <vespa/searchcore/proton/attribute/ifieldupdatecallback.h>
+
+#include <vespa/searchlib/common/isequencedtaskexecutor.h>
#include <vespa/document/datatype/documenttype.h>
#include <vespa/document/repo/documenttyperepo.h>
#include <vespa/vespalib/util/exceptions.h>
#include <vespa/log/log.h>
-#include <vespa/searchcore/proton/attribute/ifieldupdatecallback.h>
-
LOG_SETUP(".proton.server.storeonlyfeedview");
using document::BucketId;
diff --git a/searchcore/src/vespa/searchcore/proton/server/visibilityhandler.cpp b/searchcore/src/vespa/searchcore/proton/server/visibilityhandler.cpp
index dd12a5cfd3d..71197a5c530 100644
--- a/searchcore/src/vespa/searchcore/proton/server/visibilityhandler.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/visibilityhandler.cpp
@@ -1,6 +1,7 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "visibilityhandler.h"
+#include <vespa/searchlib/common/isequencedtaskexecutor.h>
#include <vespa/vespalib/util/closuretask.h>
using vespalib::makeTask;
diff --git a/searchcorespi/src/vespa/searchcorespi/index/ithreadingservice.h b/searchcorespi/src/vespa/searchcorespi/index/ithreadingservice.h
index bded09143ab..a4b5277b616 100644
--- a/searchcorespi/src/vespa/searchcorespi/index/ithreadingservice.h
+++ b/searchcorespi/src/vespa/searchcorespi/index/ithreadingservice.h
@@ -2,11 +2,9 @@
#pragma once
#include "i_thread_service.h"
-#include <vespa/vespalib/util/runnable.h>
-#include <vespa/vespalib/util/executor.h>
#include <vespa/vespalib/util/syncable.h>
-#include <vespa/searchlib/common/isequencedtaskexecutor.h>
+namespace search { class ISequencedTaskExecutor; }
namespace searchcorespi::index {
/**