diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-11-29 17:31:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-29 17:31:40 +0100 |
commit | 13cbbe9bf53c61152e7cba678c500d2250bdc3f9 (patch) | |
tree | 91605a1cd8a51401b644e2318d1430fdf7deb1e9 /searchcore | |
parent | f938eaa29672f357ce7b4f7f442923c0b5427b5f (diff) | |
parent | 17389acc8d219fa6aa007ead10f9a1d92134772c (diff) |
Merge pull request #20275 from vespa-engine/balder/hide-sync-implementationv7.507.96
Hide sync implementation.
Diffstat (limited to 'searchcore')
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; } |