diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-01-19 22:01:05 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2022-01-19 22:28:10 +0000 |
commit | e814c0a207489b007e1cb6730e584ce678e2e423 (patch) | |
tree | 29f3aa6bd819b87c59adb23d55e4262aa9a87d82 /searchcore | |
parent | 2b96994f5b1b7556d1f189e3fec90950f0bd6885 (diff) |
Only require vespalib::Executor instead of vespalib::ThreadExecutor
Diffstat (limited to 'searchcore')
15 files changed, 29 insertions, 45 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp b/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp index 52b367fd14b..b3b5f2486fa 100644 --- a/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp +++ b/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp @@ -17,7 +17,6 @@ #include <vespa/vespalib/util/destructor_callbacks.h> #include <vespa/vespalib/util/gate.h> #include <vespa/vespalib/util/idestructorcallback.h> -#include <vespa/vespalib/util/threadexecutor.h> #include <future> #include <vespa/log/log.h> diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.h b/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.h index f43aab0f385..a5907233c4b 100644 --- a/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.h +++ b/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.h @@ -25,7 +25,7 @@ private: using FieldValue = document::FieldValue; const IAttributeManager::SP _mgr; vespalib::ISequencedTaskExecutor &_attributeFieldWriter; - vespalib::ThreadExecutor& _shared_executor; + vespalib::Executor& _shared_executor; using ExecutorId = vespalib::ISequencedTaskExecutor::ExecutorId; public: /** diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attributemanager.cpp b/searchcore/src/vespa/searchcore/proton/attribute/attributemanager.cpp index eee6264b9f4..ef7e422c722 100644 --- a/searchcore/src/vespa/searchcore/proton/attribute/attributemanager.cpp +++ b/searchcore/src/vespa/searchcore/proton/attribute/attributemanager.cpp @@ -240,7 +240,7 @@ AttributeManager::AttributeManager(const vespalib::string &baseDir, const TuneFileAttributes &tuneFileAttributes, const FileHeaderContext &fileHeaderContext, vespalib::ISequencedTaskExecutor &attributeFieldWriter, - vespalib::ThreadExecutor& shared_executor, + vespalib::Executor& shared_executor, const HwInfo &hwInfo) : proton::IAttributeManager(), _attributes(), @@ -264,7 +264,7 @@ AttributeManager::AttributeManager(const vespalib::string &baseDir, const search::TuneFileAttributes &tuneFileAttributes, const search::common::FileHeaderContext &fileHeaderContext, vespalib::ISequencedTaskExecutor &attributeFieldWriter, - vespalib::ThreadExecutor& shared_executor, + vespalib::Executor& shared_executor, const IAttributeFactory::SP &factory, const HwInfo &hwInfo) : proton::IAttributeManager(), @@ -558,12 +558,6 @@ AttributeManager::getAttributeFieldWriter() const return _attributeFieldWriter; } -vespalib::ThreadExecutor& -AttributeManager::get_shared_executor() const -{ - return _shared_executor; -} - AttributeVector * AttributeManager::getWritableAttribute(const vespalib::string &name) const { diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attributemanager.h b/searchcore/src/vespa/searchcore/proton/attribute/attributemanager.h index 08e2d511d70..76aa6a7df64 100644 --- a/searchcore/src/vespa/searchcore/proton/attribute/attributemanager.h +++ b/searchcore/src/vespa/searchcore/proton/attribute/attributemanager.h @@ -80,7 +80,7 @@ private: IAttributeFactory::SP _factory; std::shared_ptr<search::attribute::Interlock> _interlock; vespalib::ISequencedTaskExecutor &_attributeFieldWriter; - vespalib::ThreadExecutor& _shared_executor; + vespalib::Executor& _shared_executor; HwInfo _hwInfo; std::unique_ptr<ImportedAttributesRepo> _importedAttributes; @@ -107,7 +107,7 @@ public: const search::TuneFileAttributes &tuneFileAttributes, const search::common::FileHeaderContext & fileHeaderContext, vespalib::ISequencedTaskExecutor &attributeFieldWriter, - vespalib::ThreadExecutor& shared_executor, + vespalib::Executor& shared_executor, const HwInfo &hwInfo); AttributeManager(const vespalib::string &baseDir, @@ -115,7 +115,7 @@ public: const search::TuneFileAttributes &tuneFileAttributes, const search::common::FileHeaderContext & fileHeaderContext, vespalib::ISequencedTaskExecutor &attributeFieldWriter, - vespalib::ThreadExecutor& shared_executor, + vespalib::Executor& shared_executor, const IAttributeFactory::SP &factory, const HwInfo &hwInfo); @@ -171,7 +171,7 @@ public: vespalib::ISequencedTaskExecutor &getAttributeFieldWriter() const override; - vespalib::ThreadExecutor& get_shared_executor() const override; + vespalib::Executor& get_shared_executor() const override { return _shared_executor; } search::AttributeVector *getWritableAttribute(const vespalib::string &name) const override; diff --git a/searchcore/src/vespa/searchcore/proton/attribute/filter_attribute_manager.cpp b/searchcore/src/vespa/searchcore/proton/attribute/filter_attribute_manager.cpp index 5f162281d96..d0caf92be17 100644 --- a/searchcore/src/vespa/searchcore/proton/attribute/filter_attribute_manager.cpp +++ b/searchcore/src/vespa/searchcore/proton/attribute/filter_attribute_manager.cpp @@ -167,12 +167,6 @@ FilterAttributeManager::getAttributeFieldWriter() const return _mgr->getAttributeFieldWriter(); } -vespalib::ThreadExecutor& -FilterAttributeManager::get_shared_executor() const -{ - return _mgr->get_shared_executor(); -} - search::AttributeVector * FilterAttributeManager::getWritableAttribute(const vespalib::string &name) const { diff --git a/searchcore/src/vespa/searchcore/proton/attribute/filter_attribute_manager.h b/searchcore/src/vespa/searchcore/proton/attribute/filter_attribute_manager.h index 1512ab32d62..e291aca6922 100644 --- a/searchcore/src/vespa/searchcore/proton/attribute/filter_attribute_manager.h +++ b/searchcore/src/vespa/searchcore/proton/attribute/filter_attribute_manager.h @@ -20,15 +20,14 @@ public: typedef std::set<vespalib::string> AttributeSet; private: - AttributeSet _acceptedAttributes; - IAttributeManager::SP _mgr; + AttributeSet _acceptedAttributes; + IAttributeManager::SP _mgr; std::vector<search::AttributeVector *> _acceptedWritableAttributes; bool acceptAttribute(const vespalib::string &name) const; public: - FilterAttributeManager(const AttributeSet &acceptedAttributes, - IAttributeManager::SP mgr); + FilterAttributeManager(const AttributeSet &acceptedAttributes, IAttributeManager::SP mgr); ~FilterAttributeManager() override; // Implements search::IAttributeManager @@ -47,7 +46,7 @@ public: void pruneRemovedFields(search::SerialNum serialNum) override; const IAttributeFactory::SP &getFactory() const override; vespalib::ISequencedTaskExecutor & getAttributeFieldWriter() const override; - vespalib::ThreadExecutor& get_shared_executor() const override; + vespalib::Executor& get_shared_executor() const override { return _mgr->get_shared_executor(); } search::AttributeVector * getWritableAttribute(const vespalib::string &name) const override; const std::vector<search::AttributeVector *> & getWritableAttributes() const override; diff --git a/searchcore/src/vespa/searchcore/proton/attribute/i_attribute_manager.h b/searchcore/src/vespa/searchcore/proton/attribute/i_attribute_manager.h index b8968ba9d2e..d32052fe4fa 100644 --- a/searchcore/src/vespa/searchcore/proton/attribute/i_attribute_manager.h +++ b/searchcore/src/vespa/searchcore/proton/attribute/i_attribute_manager.h @@ -14,7 +14,7 @@ namespace search::attribute { class IAttributeFunctor; } namespace vespalib { class ISequencedTaskExecutor; - class ThreadExecutor; + class Executor; class IDestructorCallback; } @@ -76,7 +76,7 @@ struct IAttributeManager : public search::IAttributeManager virtual vespalib::ISequencedTaskExecutor &getAttributeFieldWriter() const = 0; - virtual vespalib::ThreadExecutor& get_shared_executor() const = 0; + virtual vespalib::Executor& get_shared_executor() const = 0; /* * Get pointer to named writable attribute. If attribute isn't diff --git a/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.cpp b/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.cpp index 28a91e1444d..6b938c4cc73 100644 --- a/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.cpp +++ b/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.cpp @@ -145,7 +145,7 @@ SummaryManager::createSummarySetup(const SummaryConfig & summaryCfg, const Summa juniperCfg, attributeMgr, _docStore, repo); } -SummaryManager::SummaryManager(vespalib::ThreadExecutor & executor, const LogDocumentStore::Config & storeConfig, +SummaryManager::SummaryManager(vespalib::Executor & executor, const LogDocumentStore::Config & storeConfig, const search::GrowStrategy & growStrategy, const vespalib::string &baseDir, const DocTypeName &docTypeName, const TuneFileSummary &tuneFileSummary, const FileHeaderContext &fileHeaderContext, search::transactionlog::SyncProxy &tlSyncer, diff --git a/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.h b/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.h index b3cbd399262..f65db787f9d 100644 --- a/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.h +++ b/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.h @@ -10,7 +10,6 @@ #include <vespa/searchlib/docstore/logdocumentstore.h> #include <vespa/searchlib/transactionlog/syncproxy.h> #include <vespa/document/fieldvalue/document.h> -#include <vespa/vespalib/util/threadexecutor.h> namespace search { class IBucketizer; } namespace search::common { class FileHeaderContext; } @@ -60,7 +59,7 @@ private: public: typedef std::shared_ptr<SummaryManager> SP; - SummaryManager(vespalib::ThreadExecutor & executor, + SummaryManager(vespalib::Executor & executor, const search::LogDocumentStore::Config & summary, const search::GrowStrategy & growStrategy, const vespalib::string &baseDir, diff --git a/searchcore/src/vespa/searchcore/proton/docsummary/summarymanagerinitializer.cpp b/searchcore/src/vespa/searchcore/proton/docsummary/summarymanagerinitializer.cpp index 21506c3014f..5d3c3548113 100644 --- a/searchcore/src/vespa/searchcore/proton/docsummary/summarymanagerinitializer.cpp +++ b/searchcore/src/vespa/searchcore/proton/docsummary/summarymanagerinitializer.cpp @@ -11,7 +11,7 @@ SummaryManagerInitializer(const search::GrowStrategy &grow, const vespalib::string & baseDir, const vespalib::string &subDbName, const DocTypeName &docTypeName, - vespalib::ThreadExecutor &summaryExecutor, + vespalib::Executor &summaryExecutor, const search::LogDocumentStore::Config & storeCfg, const search::TuneFileSummary &tuneFile, const search::common::FileHeaderContext &fileHeaderContext, diff --git a/searchcore/src/vespa/searchcore/proton/docsummary/summarymanagerinitializer.h b/searchcore/src/vespa/searchcore/proton/docsummary/summarymanagerinitializer.h index 7075560ed56..ec1016dd044 100644 --- a/searchcore/src/vespa/searchcore/proton/docsummary/summarymanagerinitializer.h +++ b/searchcore/src/vespa/searchcore/proton/docsummary/summarymanagerinitializer.h @@ -5,7 +5,6 @@ #include "summarymanager.h" #include <vespa/searchcore/proton/initializer/initializer_task.h> #include <vespa/searchcommon/common/growstrategy.h> -#include <vespa/vespalib/stllike/string.h> namespace proton { @@ -20,7 +19,7 @@ class SummaryManagerInitializer : public initializer::InitializerTask const vespalib::string _baseDir; const vespalib::string _subDbName; const DocTypeName _docTypeName; - vespalib::ThreadExecutor &_summaryExecutor; + vespalib::Executor &_summaryExecutor; const search::LogDocumentStore::Config _storeCfg; const search::TuneFileSummary _tuneFile; const search::common::FileHeaderContext &_fileHeaderContext; @@ -36,7 +35,7 @@ public: const vespalib::string & baseDir, const vespalib::string &subDbName, const DocTypeName &docTypeName, - vespalib::ThreadExecutor & summaryExecutor, + vespalib::Executor & summaryExecutor, const search::LogDocumentStore::Config & storeCfg, const search::TuneFileSummary &tuneFile, const search::common::FileHeaderContext & fileHeaderContext, diff --git a/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.cpp b/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.cpp index 47eaef2b6b5..ffc142b6155 100644 --- a/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.cpp @@ -38,11 +38,11 @@ VESPA_THREAD_STACK_TAG(field_writer_executor) } -ExecutorThreadingService::ExecutorThreadingService(vespalib::ThreadExecutor &sharedExecutor, uint32_t num_treads) +ExecutorThreadingService::ExecutorThreadingService(vespalib::Executor &sharedExecutor, uint32_t num_treads) : ExecutorThreadingService(sharedExecutor, nullptr, nullptr, ThreadingServiceConfig::make(num_treads)) {} -ExecutorThreadingService::ExecutorThreadingService(vespalib::ThreadExecutor& sharedExecutor, +ExecutorThreadingService::ExecutorThreadingService(vespalib::Executor& sharedExecutor, vespalib::ISequencedTaskExecutor* field_writer, vespalib::InvokeService * invokerService, const ThreadingServiceConfig& cfg, diff --git a/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h b/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h index 8572f7126d6..43d546927c2 100644 --- a/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h +++ b/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h @@ -20,7 +20,7 @@ class ExecutorThreadingService : public searchcorespi::index::IThreadingService { private: using Registration = std::unique_ptr<vespalib::IDestructorCallback>; - vespalib::ThreadExecutor & _sharedExecutor; + vespalib::Executor & _sharedExecutor; vespalib::ThreadStackExecutor _masterExecutor; ThreadingServiceConfig::SharedFieldWriterExecutor _shared_field_writer; std::atomic<uint32_t> _master_task_limit; @@ -42,9 +42,9 @@ public: /** * Convenience constructor used in unit tests. */ - ExecutorThreadingService(vespalib::ThreadExecutor& sharedExecutor, uint32_t num_treads = 1); + ExecutorThreadingService(vespalib::Executor& sharedExecutor, uint32_t num_treads = 1); - ExecutorThreadingService(vespalib::ThreadExecutor& sharedExecutor, + ExecutorThreadingService(vespalib::Executor& sharedExecutor, vespalib::ISequencedTaskExecutor* field_writer, vespalib::InvokeService * invokeService, const ThreadingServiceConfig& cfg, @@ -72,7 +72,7 @@ public: vespalib::ThreadExecutor &summary() override { return *_summaryExecutor; } - vespalib::ThreadExecutor &shared() override { + vespalib::Executor &shared() override { return _sharedExecutor; } diff --git a/searchcore/src/vespa/searchcore/proton/test/mock_attribute_manager.h b/searchcore/src/vespa/searchcore/proton/test/mock_attribute_manager.h index 743cd9af8fc..0e2491e62fa 100644 --- a/searchcore/src/vespa/searchcore/proton/test/mock_attribute_manager.h +++ b/searchcore/src/vespa/searchcore/proton/test/mock_attribute_manager.h @@ -14,7 +14,7 @@ private: std::vector<search::AttributeVector*> _writables; std::unique_ptr<ImportedAttributesRepo> _importedAttributes; vespalib::ISequencedTaskExecutor* _writer; - vespalib::ThreadExecutor* _shared; + vespalib::Executor* _shared; public: MockAttributeManager() @@ -33,7 +33,7 @@ public: void set_writer(vespalib::ISequencedTaskExecutor& writer) { _writer = &writer; } - void set_shared_executor(vespalib::ThreadExecutor& shared) { + void set_shared_executor(vespalib::Executor& shared) { _shared = &shared; } search::AttributeGuard::UP getAttribute(const vespalib::string &name) const override { @@ -72,7 +72,7 @@ public: assert(_writer != nullptr); return *_writer; } - vespalib::ThreadExecutor& get_shared_executor() const override { + vespalib::Executor& get_shared_executor() const override { assert(_shared != nullptr); return *_shared; } diff --git a/searchcore/src/vespa/searchcore/proton/test/threading_service_observer.h b/searchcore/src/vespa/searchcore/proton/test/threading_service_observer.h index e93b1632b3f..78a740ec2c3 100644 --- a/searchcore/src/vespa/searchcore/proton/test/threading_service_observer.h +++ b/searchcore/src/vespa/searchcore/proton/test/threading_service_observer.h @@ -15,7 +15,7 @@ private: SyncableThreadServiceObserver _master; ThreadServiceObserver _index; ThreadExecutorObserver _summary; - vespalib::ThreadExecutor & _shared; + vespalib::Executor & _shared; vespalib::SequencedTaskExecutorObserver _indexFieldInverter; vespalib::SequencedTaskExecutorObserver _indexFieldWriter; vespalib::SequencedTaskExecutorObserver _attributeFieldWriter; @@ -46,7 +46,7 @@ public: vespalib::ThreadExecutor &summary() override { return _summary; } - vespalib::ThreadExecutor &shared() override { + vespalib::Executor &shared() override { return _shared; } vespalib::ISequencedTaskExecutor &indexFieldInverter() override { |