diff options
35 files changed, 80 insertions, 74 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.cpp b/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.cpp index 113855d7e2b..536017ca66f 100644 --- a/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.cpp +++ b/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.cpp @@ -147,7 +147,7 @@ SummaryManager::createSummarySetup(const SummaryConfig & summaryCfg, const Summa juniperCfg, attributeMgr, _docStore, repo); } -SummaryManager::SummaryManager(vespalib::ThreadExecutor & executor, const LogDocumentStore::Config & storeConfig, +SummaryManager::SummaryManager(vespalib::SyncableThreadExecutor & 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 4fde28e69de..1b822849d8c 100644 --- a/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.h +++ b/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.h @@ -63,7 +63,7 @@ private: public: typedef std::shared_ptr<SummaryManager> SP; - SummaryManager(vespalib::ThreadExecutor & executor, + SummaryManager(vespalib::SyncableThreadExecutor & 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 32a03219416..45d4eb028a2 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::SyncableThreadExecutor &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 e7cb37aea28..c01f7c2ea7f 100644 --- a/searchcore/src/vespa/searchcore/proton/docsummary/summarymanagerinitializer.h +++ b/searchcore/src/vespa/searchcore/proton/docsummary/summarymanagerinitializer.h @@ -20,7 +20,7 @@ class SummaryManagerInitializer : public initializer::InitializerTask const vespalib::string _baseDir; const vespalib::string _subDbName; const DocTypeName _docTypeName; - vespalib::ThreadExecutor &_summaryExecutor; + vespalib::SyncableThreadExecutor &_summaryExecutor; const search::LogDocumentStore::Config _storeCfg; const search::TuneFileSummary _tuneFile; const search::common::FileHeaderContext &_fileHeaderContext; @@ -36,14 +36,14 @@ public: const vespalib::string baseDir, const vespalib::string &subDbName, const DocTypeName &docTypeName, - vespalib::ThreadExecutor & summaryExecutor, + vespalib::SyncableThreadExecutor & summaryExecutor, const search::LogDocumentStore::Config & storeCfg, const search::TuneFileSummary &tuneFile, const search::common::FileHeaderContext & fileHeaderContext, search::transactionlog::SyncProxy &tlSyncer, IBucketizerSP bucketizer, std::shared_ptr<SummaryManager::SP> result); - ~SummaryManagerInitializer(); + ~SummaryManagerInitializer() override; void run() override; }; diff --git a/searchcore/src/vespa/searchcore/proton/index/index_manager_initializer.cpp b/searchcore/src/vespa/searchcore/proton/index/index_manager_initializer.cpp index 9c680ec7768..e87f74e2258 100644 --- a/searchcore/src/vespa/searchcore/proton/index/index_manager_initializer.cpp +++ b/searchcore/src/vespa/searchcore/proton/index/index_manager_initializer.cpp @@ -15,7 +15,7 @@ IndexManagerInitializer(const vespalib::string &baseDir, search::SerialNum serialNum, searchcorespi::IIndexManager::Reconfigurer & reconfigurer, searchcorespi::index::IThreadingService & threadingService, - vespalib::ThreadExecutor & warmupExecutor, + vespalib::SyncableThreadExecutor & warmupExecutor, const search::TuneFileIndexManager & tuneFileIndexManager, const search::TuneFileAttributes &tuneFileAttributes, const search::common::FileHeaderContext & fileHeaderContext, diff --git a/searchcore/src/vespa/searchcore/proton/index/index_manager_initializer.h b/searchcore/src/vespa/searchcore/proton/index/index_manager_initializer.h index 1a14c8d2ea3..8e446e222b3 100644 --- a/searchcore/src/vespa/searchcore/proton/index/index_manager_initializer.h +++ b/searchcore/src/vespa/searchcore/proton/index/index_manager_initializer.h @@ -20,7 +20,7 @@ class IndexManagerInitializer : public initializer::InitializerTask search::SerialNum _serialNum; searchcorespi::IIndexManager::Reconfigurer &_reconfigurer; searchcorespi::index::IThreadingService &_threadingService; - vespalib::ThreadExecutor &_warmupExecutor; + vespalib::SyncableThreadExecutor &_warmupExecutor; const search::TuneFileIndexManager _tuneFileIndexManager; const search::TuneFileAttributes _tuneFileAttributes; const search::common::FileHeaderContext &_fileHeaderContext; @@ -33,7 +33,7 @@ public: search::SerialNum serialNum, searchcorespi::IIndexManager::Reconfigurer & reconfigurer, searchcorespi::index::IThreadingService & threadingService, - vespalib::ThreadExecutor & warmupExecutor, + vespalib::SyncableThreadExecutor & warmupExecutor, const search::TuneFileIndexManager & tuneFileIndexManager, const search::TuneFileAttributes & tuneFileAttributes, const search::common::FileHeaderContext & fileHeaderContext, diff --git a/searchcore/src/vespa/searchcore/proton/index/indexmanager.cpp b/searchcore/src/vespa/searchcore/proton/index/indexmanager.cpp index 8e838414015..6ffd3203019 100644 --- a/searchcore/src/vespa/searchcore/proton/index/indexmanager.cpp +++ b/searchcore/src/vespa/searchcore/proton/index/indexmanager.cpp @@ -78,7 +78,7 @@ IndexManager::IndexManager(const vespalib::string &baseDir, SerialNum serialNum, Reconfigurer &reconfigurer, IThreadingService &threadingService, - vespalib::ThreadExecutor & warmupExecutor, + vespalib::SyncableThreadExecutor & warmupExecutor, const search::TuneFileIndexManager &tuneFileIndexManager, const search::TuneFileAttributes &tuneFileAttributes, const FileHeaderContext &fileHeaderContext) : diff --git a/searchcore/src/vespa/searchcore/proton/index/indexmanager.h b/searchcore/src/vespa/searchcore/proton/index/indexmanager.h index b14912239a3..7e305681f78 100644 --- a/searchcore/src/vespa/searchcore/proton/index/indexmanager.h +++ b/searchcore/src/vespa/searchcore/proton/index/indexmanager.h @@ -72,7 +72,7 @@ public: SerialNum serialNum, Reconfigurer &reconfigurer, searchcorespi::index::IThreadingService &threadingService, - vespalib::ThreadExecutor & warmupExecutor, + vespalib::SyncableThreadExecutor & warmupExecutor, const search::TuneFileIndexManager &tuneFileIndexManager, const search::TuneFileAttributes &tuneFileAttributes, const search::common::FileHeaderContext &fileHeaderContext); diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp b/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp index 5aacfa2678c..45784fc2683 100644 --- a/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp @@ -119,7 +119,7 @@ DocumentDB::DocumentDB(const vespalib::string &baseDir, document::BucketSpace bucketSpace, const ProtonConfig &protonCfg, IDocumentDBOwner &owner, - vespalib::ThreadExecutor &warmupExecutor, + vespalib::SyncableThreadExecutor &warmupExecutor, vespalib::ThreadStackExecutorBase &sharedExecutor, search::transactionlog::Writer &tlsDirectWriter, MetricsWireService &metricsWireService, diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdb.h b/searchcore/src/vespa/searchcore/proton/server/documentdb.h index b4e58d6f178..d6448c0b515 100644 --- a/searchcore/src/vespa/searchcore/proton/server/documentdb.h +++ b/searchcore/src/vespa/searchcore/proton/server/documentdb.h @@ -247,7 +247,7 @@ public: document::BucketSpace bucketSpace, const ProtonConfig &protonCfg, IDocumentDBOwner &owner, - vespalib::ThreadExecutor &warmupExecutor, + vespalib::SyncableThreadExecutor &warmupExecutor, vespalib::ThreadStackExecutorBase &sharedExecutor, search::transactionlog::Writer &tlsDirectWriter, MetricsWireService &metricsWireService, diff --git a/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp b/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp index 682719436f1..74010391fcb 100644 --- a/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp @@ -34,7 +34,7 @@ DocumentSubDBCollection::DocumentSubDBCollection( const IGetSerialNum &getSerialNum, const DocTypeName &docTypeName, searchcorespi::index::IThreadingService &writeService, - vespalib::ThreadExecutor &warmupExecutor, + vespalib::SyncableThreadExecutor &warmupExecutor, const search::common::FileHeaderContext &fileHeaderContext, MetricsWireService &metricsWireService, DocumentDBTaggedMetrics &metrics, diff --git a/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.h b/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.h index 05427f5e545..d09afb92cc8 100644 --- a/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.h +++ b/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.h @@ -11,7 +11,7 @@ namespace vespalib { class Clock; - class ThreadExecutor; + class SyncableThreadExecutor; class ThreadStackExecutorBase; } @@ -100,7 +100,7 @@ public: const IGetSerialNum &getSerialNum, const DocTypeName &docTypeName, searchcorespi::index::IThreadingService &writeService, - vespalib::ThreadExecutor &warmupExecutor, + vespalib::SyncableThreadExecutor &warmupExecutor, const search::common::FileHeaderContext &fileHeaderContext, MetricsWireService &metricsWireService, DocumentDBTaggedMetrics &metrics, diff --git a/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h b/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h index 9ab6eba39e1..ed58420ecea 100644 --- a/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h +++ b/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h @@ -75,7 +75,7 @@ public: searchcorespi::index::IThreadService &summary() override { return _summaryService; } - vespalib::ThreadExecutor &shared() override { + vespalib::SyncableThreadExecutor &shared() override { return _sharedExecutor; } diff --git a/searchcore/src/vespa/searchcore/proton/server/maintenancecontroller.cpp b/searchcore/src/vespa/searchcore/proton/server/maintenancecontroller.cpp index e6afb8a19b2..a2672cc7972 100644 --- a/searchcore/src/vespa/searchcore/proton/server/maintenancecontroller.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/maintenancecontroller.cpp @@ -32,7 +32,7 @@ public: } MaintenanceController::MaintenanceController(IThreadService &masterThread, - vespalib::ThreadExecutor & defaultExecutor, + vespalib::SyncableThreadExecutor & defaultExecutor, const DocTypeName &docTypeName) : IBucketFreezeListener(), _masterThread(masterThread), diff --git a/searchcore/src/vespa/searchcore/proton/server/maintenancecontroller.h b/searchcore/src/vespa/searchcore/proton/server/maintenancecontroller.h index 69416ff63d7..24c1c18959e 100644 --- a/searchcore/src/vespa/searchcore/proton/server/maintenancecontroller.h +++ b/searchcore/src/vespa/searchcore/proton/server/maintenancecontroller.h @@ -11,7 +11,7 @@ namespace vespalib { class Timer; - class ThreadExecutor; + class SyncableThreadExecutor; class Executor; } namespace searchcorespi { namespace index { struct IThreadService; }} @@ -34,7 +34,7 @@ public: using JobList = std::vector<std::shared_ptr<MaintenanceJobRunner>>; using UP = std::unique_ptr<MaintenanceController>; - MaintenanceController(IThreadService &masterThread, vespalib::ThreadExecutor & defaultExecutor, const DocTypeName &docTypeName); + MaintenanceController(IThreadService &masterThread, vespalib::SyncableThreadExecutor & defaultExecutor, const DocTypeName &docTypeName); virtual ~MaintenanceController(); void registerJobInMasterThread(IMaintenanceJob::UP job); @@ -73,7 +73,7 @@ private: using Guard = std::lock_guard<Mutex>; IThreadService &_masterThread; - vespalib::ThreadExecutor &_defaultExecutor; + vespalib::SyncableThreadExecutor &_defaultExecutor; MaintenanceDocumentSubDB _readySubDB; MaintenanceDocumentSubDB _remSubDB; MaintenanceDocumentSubDB _notReadySubDB; diff --git a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.h b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.h index e39ada31673..f3cf95ebfa0 100644 --- a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.h +++ b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.h @@ -52,15 +52,15 @@ public: }; struct Context { - const FastAccessDocSubDB::Context _fastUpdCtx; - matching::QueryLimiter &_queryLimiter; - const vespalib::Clock &_clock; - vespalib::ThreadExecutor &_warmupExecutor; + const FastAccessDocSubDB::Context _fastUpdCtx; + matching::QueryLimiter &_queryLimiter; + const vespalib::Clock &_clock; + vespalib::SyncableThreadExecutor &_warmupExecutor; Context(const FastAccessDocSubDB::Context &fastUpdCtx, matching::QueryLimiter &queryLimiter, const vespalib::Clock &clock, - vespalib::ThreadExecutor &warmupExecutor) + vespalib::SyncableThreadExecutor &warmupExecutor) : _fastUpdCtx(fastUpdCtx), _queryLimiter(queryLimiter), _clock(clock), @@ -80,7 +80,7 @@ private: vespalib::eval::ConstantValueCache _constantValueCache; matching::ConstantValueRepo _constantValueRepo; SearchableDocSubDBConfigurer _configurer; - vespalib::ThreadExecutor &_warmupExecutor; + vespalib::SyncableThreadExecutor &_warmupExecutor; std::shared_ptr<GidToLidChangeHandler> _realGidToLidChangeHandler; DocumentDBFlushConfig _flushConfig; bool _nodeRetired; 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 e1a4433ed4b..d7b9e69774c 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: ThreadServiceObserver _master; ThreadServiceObserver _index; ThreadServiceObserver _summary; - vespalib::ThreadExecutor & _shared; + vespalib::SyncableThreadExecutor & _shared; search::SequencedTaskExecutorObserver _indexFieldInverter; search::SequencedTaskExecutorObserver _indexFieldWriter; search::SequencedTaskExecutorObserver _attributeFieldWriter; @@ -72,7 +72,7 @@ public: searchcorespi::index::IThreadService &summary() override { return _summary; } - vespalib::ThreadExecutor &shared() override { + vespalib::SyncableThreadExecutor &shared() override { return _shared; } search::ISequencedTaskExecutor &indexFieldInverter() override { diff --git a/searchcorespi/src/vespa/searchcorespi/index/i_thread_service.h b/searchcorespi/src/vespa/searchcorespi/index/i_thread_service.h index 40d92010c9b..65f18ac2c79 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/i_thread_service.h +++ b/searchcorespi/src/vespa/searchcorespi/index/i_thread_service.h @@ -9,7 +9,7 @@ namespace searchcorespi::index { /** * Interface for a single thread used for write tasks. */ -struct IThreadService : public vespalib::ThreadExecutor +struct IThreadService : public vespalib::SyncableThreadExecutor { IThreadService(const IThreadService &) = delete; IThreadService & operator = (const IThreadService &) = delete; diff --git a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainercontext.cpp b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainercontext.cpp index 213d2cb8705..78b9930c69a 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainercontext.cpp +++ b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainercontext.cpp @@ -11,7 +11,7 @@ namespace searchcorespi::index { IndexMaintainerContext::IndexMaintainerContext(IThreadingService &threadingService, IIndexManager::Reconfigurer &reconfigurer, const FileHeaderContext &fileHeaderContext, - vespalib::ThreadExecutor & warmupExecutor) + vespalib::SyncableThreadExecutor & warmupExecutor) : _threadingService(threadingService), _reconfigurer(reconfigurer), _fileHeaderContext(fileHeaderContext), diff --git a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainercontext.h b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainercontext.h index 972a16effc3..ab4a447168e 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainercontext.h +++ b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainercontext.h @@ -15,15 +15,15 @@ namespace searchcorespi::index { class IndexMaintainerContext { private: IThreadingService &_threadingService; - searchcorespi::IIndexManager::Reconfigurer &_reconfigurer; + IIndexManager::Reconfigurer &_reconfigurer; const search::common::FileHeaderContext &_fileHeaderContext; - vespalib::ThreadExecutor & _warmupExecutor; + vespalib::SyncableThreadExecutor & _warmupExecutor; public: IndexMaintainerContext(IThreadingService &threadingService, - searchcorespi::IIndexManager::Reconfigurer &reconfigurer, + IIndexManager::Reconfigurer &reconfigurer, const search::common::FileHeaderContext &fileHeaderContext, - vespalib::ThreadExecutor & warmupExecutor); + vespalib::SyncableThreadExecutor & warmupExecutor); /** * Returns the treading service that encapsulates the thread model used for writing. @@ -35,7 +35,7 @@ public: /** * Returns the reconfigurer used to signal when the index maintainer has changed. */ - searchcorespi::IIndexManager::Reconfigurer &getReconfigurer() const { + IIndexManager::Reconfigurer &getReconfigurer() const { return _reconfigurer; } @@ -49,7 +49,7 @@ public: /** * @return The executor that should be used for warmup. */ - vespalib::ThreadExecutor & getWarmupExecutor() const { return _warmupExecutor; } + vespalib::SyncableThreadExecutor & getWarmupExecutor() const { return _warmupExecutor; } }; } diff --git a/searchcorespi/src/vespa/searchcorespi/index/ithreadingservice.h b/searchcorespi/src/vespa/searchcorespi/index/ithreadingservice.h index eb80eff19ac..a8526a13b0b 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/ithreadingservice.h +++ b/searchcorespi/src/vespa/searchcorespi/index/ithreadingservice.h @@ -54,7 +54,7 @@ struct IThreadingService : public vespalib::Syncable virtual IThreadService &master() = 0; virtual IThreadService &index() = 0; virtual IThreadService &summary() = 0; - virtual vespalib::ThreadExecutor &shared() = 0; + virtual vespalib::SyncableThreadExecutor &shared() = 0; // Note this should only supply a ThreadExecutor virtual search::ISequencedTaskExecutor &indexFieldInverter() = 0; virtual search::ISequencedTaskExecutor &indexFieldWriter() = 0; virtual search::ISequencedTaskExecutor &attributeFieldWriter() = 0; diff --git a/searchcorespi/src/vespa/searchcorespi/index/warmupindexcollection.cpp b/searchcorespi/src/vespa/searchcorespi/index/warmupindexcollection.cpp index 911ff5f9eba..1786665c248 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/warmupindexcollection.cpp +++ b/searchcorespi/src/vespa/searchcorespi/index/warmupindexcollection.cpp @@ -34,7 +34,7 @@ WarmupIndexCollection::WarmupIndexCollection(const WarmupConfig & warmupConfig, ISearchableIndexCollection::SP prev, ISearchableIndexCollection::SP next, IndexSearchable & warmup, - vespalib::ThreadExecutor & executor, + vespalib::SyncableThreadExecutor & executor, IWarmupDone & warmupDone) : _warmupConfig(warmupConfig), _prev(prev), diff --git a/searchcorespi/src/vespa/searchcorespi/index/warmupindexcollection.h b/searchcorespi/src/vespa/searchcorespi/index/warmupindexcollection.h index 229d1a7c31d..992cedb1057 100644 --- a/searchcorespi/src/vespa/searchcorespi/index/warmupindexcollection.h +++ b/searchcorespi/src/vespa/searchcorespi/index/warmupindexcollection.h @@ -30,9 +30,9 @@ public: ISearchableIndexCollection::SP prev, ISearchableIndexCollection::SP next, IndexSearchable & warmup, - vespalib::ThreadExecutor & executor, + vespalib::SyncableThreadExecutor & executor, IWarmupDone & warmupDone); - ~WarmupIndexCollection(); + ~WarmupIndexCollection() override; // Implements IIndexCollection const ISourceSelector &getSourceSelector() const override; size_t getSourceCount() const override; @@ -95,15 +95,15 @@ private: void fireWarmup(Task::UP task); bool handledBefore(uint32_t fieldId, const Node &term); - const WarmupConfig _warmupConfig; - ISearchableIndexCollection::SP _prev; - ISearchableIndexCollection::SP _next; - IndexSearchable & _warmup; - vespalib::ThreadExecutor & _executor; - IWarmupDone & _warmupDone; - fastos::TimeStamp _warmupEndTime; - std::mutex _lock; - std::unique_ptr<FieldTermMap> _handledTerms; + const WarmupConfig _warmupConfig; + ISearchableIndexCollection::SP _prev; + ISearchableIndexCollection::SP _next; + IndexSearchable & _warmup; + vespalib::SyncableThreadExecutor & _executor; + IWarmupDone & _warmupDone; + fastos::TimeStamp _warmupEndTime; + std::mutex _lock; + std::unique_ptr<FieldTermMap> _handledTerms; }; } // namespace searchcorespi diff --git a/searchlib/src/vespa/searchlib/docstore/compacter.cpp b/searchlib/src/vespa/searchlib/docstore/compacter.cpp index 1d3d6e1a1df..b53281b4dbb 100644 --- a/searchlib/src/vespa/searchlib/docstore/compacter.cpp +++ b/searchlib/src/vespa/searchlib/docstore/compacter.cpp @@ -18,7 +18,7 @@ Compacter::write(LockGuard guard, uint32_t chunkId, uint32_t lid, const void *bu _ds.write(std::move(guard), fileId, lid, buffer, sz); } -BucketCompacter::BucketCompacter(size_t maxSignificantBucketBits, const CompressionConfig & compression, LogDataStore & ds, ThreadExecutor & executor, const IBucketizer & bucketizer, FileId source, FileId destination) : +BucketCompacter::BucketCompacter(size_t maxSignificantBucketBits, const CompressionConfig & compression, LogDataStore & ds, Executor & executor, const IBucketizer & bucketizer, FileId source, FileId destination) : _unSignificantBucketBits((maxSignificantBucketBits > 8) ? (maxSignificantBucketBits - 8) : 0), _sourceFileId(source), _destinationFileId(destination), diff --git a/searchlib/src/vespa/searchlib/docstore/compacter.h b/searchlib/src/vespa/searchlib/docstore/compacter.h index 279cd8b5441..666943ed629 100644 --- a/searchlib/src/vespa/searchlib/docstore/compacter.h +++ b/searchlib/src/vespa/searchlib/docstore/compacter.h @@ -32,11 +32,11 @@ private: class BucketCompacter : public IWriteData, public StoreByBucket::IWrite { using CompressionConfig = vespalib::compression::CompressionConfig; - using ThreadExecutor = vespalib::ThreadExecutor; + using Executor = vespalib::Executor; public: using FileId = FileChunk::FileId; BucketCompacter(size_t maxSignificantBucketBits, const CompressionConfig & compression, LogDataStore & ds, - ThreadExecutor & exeutor, const IBucketizer & bucketizer, FileId source, FileId destination); + Executor & exeutor, const IBucketizer & bucketizer, FileId source, FileId destination); void write(LockGuard guard, uint32_t chunkId, uint32_t lid, const void *buffer, size_t sz) override ; void write(BucketId bucketId, uint32_t chunkId, uint32_t lid, const void *buffer, size_t sz) override; void close() override; diff --git a/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp b/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp index 46fcdafc585..fb5f60666f7 100644 --- a/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp +++ b/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp @@ -50,7 +50,7 @@ LogDataStore::Config::operator == (const Config & rhs) const { (_fileConfig == rhs._fileConfig); } -LogDataStore::LogDataStore(vespalib::ThreadExecutor &executor, const vespalib::string &dirName, const Config &config, +LogDataStore::LogDataStore(vespalib::SyncableThreadExecutor &executor, const vespalib::string &dirName, const Config &config, const GrowStrategy &growStrategy, const TuneFileSummary &tune, const FileHeaderContext &fileHeaderContext, transactionlog::SyncProxy &tlSyncer, const IBucketizer::SP & bucketizer, bool readOnly) diff --git a/searchlib/src/vespa/searchlib/docstore/logdatastore.h b/searchlib/src/vespa/searchlib/docstore/logdatastore.h index 4ab747d115d..b3fea11db4b 100644 --- a/searchlib/src/vespa/searchlib/docstore/logdatastore.h +++ b/searchlib/src/vespa/searchlib/docstore/logdatastore.h @@ -84,7 +84,7 @@ public: * The caller must keep it alive for the semantic * lifetime of the log data store. */ - LogDataStore(vespalib::ThreadExecutor &executor, const vespalib::string &dirName, const Config & config, + LogDataStore(vespalib::SyncableThreadExecutor &executor, const vespalib::string &dirName, const Config & config, const GrowStrategy &growStrategy, const TuneFileSummary &tune, const search::common::FileHeaderContext &fileHeaderContext, transactionlog::SyncProxy &tlSyncer, const IBucketizer::SP & bucketizer, bool readOnly = false); @@ -279,7 +279,7 @@ private: FileId _prevActive; vespalib::Lock _updateLock; bool _readOnly; - vespalib::ThreadExecutor &_executor; + vespalib::SyncableThreadExecutor &_executor; SerialNum _initFlushSyncToken; transactionlog::SyncProxy &_tlSyncer; IBucketizer::SP _bucketizer; diff --git a/searchlib/src/vespa/searchlib/docstore/logdocumentstore.cpp b/searchlib/src/vespa/searchlib/docstore/logdocumentstore.cpp index c285d4323c2..185e9b49cf3 100644 --- a/searchlib/src/vespa/searchlib/docstore/logdocumentstore.cpp +++ b/searchlib/src/vespa/searchlib/docstore/logdocumentstore.cpp @@ -13,7 +13,7 @@ LogDocumentStore::Config::operator == (const Config & rhs) const { return DocumentStore::Config::operator ==(rhs) && (_logConfig == rhs._logConfig); } -LogDocumentStore::LogDocumentStore(vespalib::ThreadExecutor & executor, +LogDocumentStore::LogDocumentStore(vespalib::SyncableThreadExecutor & executor, const vespalib::string & baseDir, const Config & config, const GrowStrategy & growStrategy, diff --git a/searchlib/src/vespa/searchlib/docstore/logdocumentstore.h b/searchlib/src/vespa/searchlib/docstore/logdocumentstore.h index 3c9aefc9934..7991e73798c 100644 --- a/searchlib/src/vespa/searchlib/docstore/logdocumentstore.h +++ b/searchlib/src/vespa/searchlib/docstore/logdocumentstore.h @@ -44,7 +44,7 @@ public: * The caller must keep it alive for the semantic * lifetime of the log data store. */ - LogDocumentStore(vespalib::ThreadExecutor & executor, const vespalib::string & baseDir, const Config & config, + LogDocumentStore(vespalib::SyncableThreadExecutor & executor, const vespalib::string & baseDir, const Config & config, const GrowStrategy & growStrategy, const TuneFileSummary &tuneFileSummary, const common::FileHeaderContext &fileHeaderContext, transactionlog::SyncProxy &tlSyncer, const IBucketizer::SP & bucketizer); diff --git a/searchlib/src/vespa/searchlib/docstore/storebybucket.cpp b/searchlib/src/vespa/searchlib/docstore/storebybucket.cpp index 25ef968ba14..b2d74684c78 100644 --- a/searchlib/src/vespa/searchlib/docstore/storebybucket.cpp +++ b/searchlib/src/vespa/searchlib/docstore/storebybucket.cpp @@ -12,7 +12,7 @@ using document::BucketId; using vespalib::makeTask; using vespalib::makeClosure; -StoreByBucket::StoreByBucket(MemoryDataStore & backingMemory, ThreadExecutor & executor, const CompressionConfig & compression) : +StoreByBucket::StoreByBucket(MemoryDataStore & backingMemory, Executor & executor, const CompressionConfig & compression) : _chunkSerial(0), _current(), _where(), diff --git a/searchlib/src/vespa/searchlib/docstore/storebybucket.h b/searchlib/src/vespa/searchlib/docstore/storebybucket.h index 2cad67f2194..a4a488e3d65 100644 --- a/searchlib/src/vespa/searchlib/docstore/storebybucket.h +++ b/searchlib/src/vespa/searchlib/docstore/storebybucket.h @@ -5,7 +5,7 @@ #include "chunk.h" #include <vespa/document/bucket/bucketid.h> #include <vespa/vespalib/data/memorydatastore.h> -#include <vespa/vespalib/util/threadexecutor.h> +#include <vespa/vespalib/util/executor.h> #include <vespa/vespalib/util/sync.h> #include <vespa/vespalib/stllike/hash_map.h> #include <map> @@ -20,12 +20,12 @@ namespace search::docstore { class StoreByBucket { using MemoryDataStore = vespalib::MemoryDataStore; - using ThreadExecutor = vespalib::ThreadExecutor; + using Executor = vespalib::Executor; using ConstBufferRef = vespalib::ConstBufferRef; using CompressionConfig = vespalib::compression::CompressionConfig; public: StoreByBucket(vespalib::MemoryDataStore & backingMemory, const CompressionConfig & compression); - StoreByBucket(MemoryDataStore & backingMemory, ThreadExecutor & executor, const CompressionConfig & compression); + StoreByBucket(MemoryDataStore & backingMemory, Executor & executor, const CompressionConfig & compression); StoreByBucket(StoreByBucket &&) = default; ~StoreByBucket(); class IWrite { @@ -68,7 +68,7 @@ private: Chunk::UP _current; std::map<uint64_t, IndexVector> _where; MemoryDataStore & _backingMemory; - ThreadExecutor & _executor; + Executor & _executor; vespalib::Monitor _monitor; size_t _inFlight; vespalib::hash_map<uint64_t, ConstBufferRef> _chunks; diff --git a/searchlib/src/vespa/searchlib/transactionlog/domain.h b/searchlib/src/vespa/searchlib/transactionlog/domain.h index c0ee484926c..d6f964d5140 100644 --- a/searchlib/src/vespa/searchlib/transactionlog/domain.h +++ b/searchlib/src/vespa/searchlib/transactionlog/domain.h @@ -39,7 +39,7 @@ class Domain { public: using SP = std::shared_ptr<Domain>; - using Executor = vespalib::ThreadExecutor; + using Executor = vespalib::SyncableThreadExecutor; Domain(const vespalib::string &name, const vespalib::string &baseDir, Executor & commitExecutor, Executor & sessionExecutor, uint64_t domainPartSize, DomainPart::Crc defaultCrcType, const common::FileHeaderContext &fileHeaderContext); diff --git a/vespalib/src/vespa/vespalib/util/threadexecutor.h b/vespalib/src/vespa/vespalib/util/threadexecutor.h index 158805288e9..2dcbb595bb3 100644 --- a/vespalib/src/vespa/vespalib/util/threadexecutor.h +++ b/vespalib/src/vespa/vespalib/util/threadexecutor.h @@ -2,16 +2,12 @@ #pragma once -#include <vespa/vespalib/util/executor.h> -#include <vespa/vespalib/util/syncable.h> +#include "executor.h" +#include "syncable.h" namespace vespalib { -/** - * Can both execute and sync - **/ -class ThreadExecutor : public Executor, - public Syncable +class ThreadExecutor : public Executor { public: /** @@ -21,5 +17,13 @@ public: virtual size_t getNumThreads() const = 0; }; +/** + * Can both execute and sync + **/ +class SyncableThreadExecutor : public ThreadExecutor, public Syncable +{ +public: +}; + } // namespace vespalib diff --git a/vespalib/src/vespa/vespalib/util/threadstackexecutorbase.cpp b/vespalib/src/vespa/vespalib/util/threadstackexecutorbase.cpp index dfd835e0e8e..969b5e6f61e 100644 --- a/vespalib/src/vespa/vespalib/util/threadstackexecutorbase.cpp +++ b/vespalib/src/vespa/vespalib/util/threadstackexecutorbase.cpp @@ -135,7 +135,9 @@ ThreadStackExecutorBase::run() ThreadStackExecutorBase::ThreadStackExecutorBase(uint32_t stackSize, uint32_t taskLimit, init_fun_t init_fun) - : _pool(std::make_unique<FastOS_ThreadPool>(stackSize)), + : SyncableThreadExecutor(), + Runnable(), + _pool(std::make_unique<FastOS_ThreadPool>(stackSize)), _monitor(), _stats(), _executorCompletion(), diff --git a/vespalib/src/vespa/vespalib/util/threadstackexecutorbase.h b/vespalib/src/vespa/vespalib/util/threadstackexecutorbase.h index 8ee08ed3929..21a6e9cabe0 100644 --- a/vespalib/src/vespa/vespalib/util/threadstackexecutorbase.h +++ b/vespalib/src/vespa/vespalib/util/threadstackexecutorbase.h @@ -32,7 +32,7 @@ namespace thread { struct ThreadInit; } /** * An executor service that executes tasks in multiple threads. **/ -class ThreadStackExecutorBase : public ThreadExecutor, +class ThreadStackExecutorBase : public SyncableThreadExecutor, public Runnable { public: @@ -238,7 +238,7 @@ public: /** * Will invoke shutdown then sync. **/ - ~ThreadStackExecutorBase(); + ~ThreadStackExecutorBase() override; }; } // namespace vespalib |