aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2021-11-29 17:31:40 +0100
committerGitHub <noreply@github.com>2021-11-29 17:31:40 +0100
commit13cbbe9bf53c61152e7cba678c500d2250bdc3f9 (patch)
tree91605a1cd8a51401b644e2318d1430fdf7deb1e9
parentf938eaa29672f357ce7b4f7f442923c0b5427b5f (diff)
parent17389acc8d219fa6aa007ead10f9a1d92134772c (diff)
Merge pull request #20275 from vespa-engine/balder/hide-sync-implementationv7.507.96
Hide sync implementation.
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/proton.cpp8
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/shared_threading_service.cpp11
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/shared_threading_service.h5
3 files changed, 16 insertions, 8 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/server/proton.cpp b/searchcore/src/vespa/searchcore/proton/server/proton.cpp
index 89940fbf367..30a23aaa3d5 100644
--- a/searchcore/src/vespa/searchcore/proton/server/proton.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/proton.cpp
@@ -447,11 +447,7 @@ Proton::~Proton()
_flushEngine->close();
}
if (_shared_service) {
- _shared_service->warmup_raw().sync();
- _shared_service->shared_raw()->sync();
- if (_shared_service->field_writer()) {
- _shared_service->field_writer()->sync_all();
- }
+ _shared_service->sync_all_executors();
}
if ( ! _documentDBMap.empty()) {
@@ -946,7 +942,7 @@ Proton::get_child(vespalib::stringref name) const
return std::make_unique<ResourceUsageExplorer>(_diskMemUsageSampler->writeFilter(),
_persistenceEngine->get_resource_usage_tracker());
} else if (name == THREAD_POOLS) {
- return std::make_unique<ProtonThreadPoolsExplorer>((_shared_service) ? _shared_service->shared_raw().get() : nullptr,
+ return std::make_unique<ProtonThreadPoolsExplorer>((_shared_service) ? &_shared_service->shared() : nullptr,
(_matchEngine) ? &_matchEngine->get_executor() : nullptr,
(_summaryEngine) ? &_summaryEngine->get_executor() : nullptr,
(_flushEngine) ? &_flushEngine->get_executor() : nullptr,
diff --git a/searchcore/src/vespa/searchcore/proton/server/shared_threading_service.cpp b/searchcore/src/vespa/searchcore/proton/server/shared_threading_service.cpp
index f9333aa18a5..c4fc79c43fd 100644
--- a/searchcore/src/vespa/searchcore/proton/server/shared_threading_service.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/shared_threading_service.cpp
@@ -31,4 +31,15 @@ SharedThreadingService::SharedThreadingService(const SharedThreadingServiceConfi
}
}
+SharedThreadingService::~SharedThreadingService() = default;
+
+void
+SharedThreadingService::sync_all_executors() {
+ _warmup.sync();
+ _shared->sync();
+ if (_field_writer) {
+ _field_writer->sync_all();
+ }
+}
+
}
diff --git a/searchcore/src/vespa/searchcore/proton/server/shared_threading_service.h b/searchcore/src/vespa/searchcore/proton/server/shared_threading_service.h
index 12686e4a3c5..6006d484c97 100644
--- a/searchcore/src/vespa/searchcore/proton/server/shared_threading_service.h
+++ b/searchcore/src/vespa/searchcore/proton/server/shared_threading_service.h
@@ -20,9 +20,10 @@ private:
public:
SharedThreadingService(const SharedThreadingServiceConfig& cfg);
+ ~SharedThreadingService();
- vespalib::SyncableThreadExecutor& warmup_raw() { return _warmup; }
- std::shared_ptr<vespalib::SyncableThreadExecutor> shared_raw() { return _shared; }
+ std::shared_ptr<vespalib::Executor> shared_raw() { return _shared; }
+ void sync_all_executors();
vespalib::ThreadExecutor& warmup() override { return _warmup; }
vespalib::ThreadExecutor& shared() override { return *_shared; }