summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp1
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.h2
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/attributemanager.cpp10
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/attributemanager.h8
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/filter_attribute_manager.cpp6
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/filter_attribute_manager.h9
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/i_attribute_manager.h4
-rw-r--r--searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.h3
-rw-r--r--searchcore/src/vespa/searchcore/proton/docsummary/summarymanagerinitializer.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/proton/docsummary/summarymanagerinitializer.h5
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.cpp4
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h8
-rw-r--r--searchcore/src/vespa/searchcore/proton/test/mock_attribute_manager.h6
-rw-r--r--searchcore/src/vespa/searchcore/proton/test/threading_service_observer.h4
-rw-r--r--searchcorespi/src/vespa/searchcorespi/index/ithreadingservice.h2
-rw-r--r--searchlib/src/vespa/searchlib/docstore/filechunk.cpp24
-rw-r--r--searchlib/src/vespa/searchlib/docstore/filechunk.h4
-rw-r--r--searchlib/src/vespa/searchlib/docstore/logdatastore.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/docstore/logdatastore.h6
-rw-r--r--searchlib/src/vespa/searchlib/docstore/logdocumentstore.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/docstore/logdocumentstore.h2
22 files changed, 53 insertions, 63 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 {
diff --git a/searchcorespi/src/vespa/searchcorespi/index/ithreadingservice.h b/searchcorespi/src/vespa/searchcorespi/index/ithreadingservice.h
index c95a42f601b..59fe73e0dec 100644
--- a/searchcorespi/src/vespa/searchcorespi/index/ithreadingservice.h
+++ b/searchcorespi/src/vespa/searchcorespi/index/ithreadingservice.h
@@ -72,7 +72,7 @@ struct IThreadingService
virtual ISyncableThreadService &master() = 0;
virtual IThreadService &index() = 0;
virtual vespalib::ThreadExecutor &summary() = 0;
- virtual vespalib::ThreadExecutor &shared() = 0;
+ virtual vespalib::Executor &shared() = 0;
virtual vespalib::ISequencedTaskExecutor &indexFieldInverter() = 0;
virtual vespalib::ISequencedTaskExecutor &indexFieldWriter() = 0;
virtual vespalib::ISequencedTaskExecutor &attributeFieldWriter() = 0;
diff --git a/searchlib/src/vespa/searchlib/docstore/filechunk.cpp b/searchlib/src/vespa/searchlib/docstore/filechunk.cpp
index 180d6aa8ced..b7b72552914 100644
--- a/searchlib/src/vespa/searchlib/docstore/filechunk.cpp
+++ b/searchlib/src/vespa/searchlib/docstore/filechunk.cpp
@@ -10,8 +10,9 @@
#include <vespa/vespalib/data/fileheader.h>
#include <vespa/vespalib/data/databuffer.h>
#include <vespa/vespalib/stllike/asciistream.h>
-#include <vespa/vespalib/util/blockingthreadstackexecutor.h>
#include <vespa/vespalib/objects/nbostream.h>
+#include <vespa/vespalib/util/executor.h>
+#include <vespa/vespalib/util/arrayqueue.hpp>
#include <vespa/vespalib/util/array.hpp>
#include <vespa/vespalib/stllike/hash_map.hpp>
#include <vespa/fastos/file.h>
@@ -304,8 +305,6 @@ FileChunk::getModificationTime() const
namespace {
-using FutureChunk = std::future<Chunk::UP>;
-
struct FixedParams {
const IGetLid & db;
IWriteData & dest;
@@ -337,14 +336,15 @@ appendChunks(FixedParams * args, Chunk::UP chunk)
}
void
-FileChunk::appendTo(vespalib::ThreadExecutor & executor, const IGetLid & db, IWriteData & dest,
+FileChunk::appendTo(vespalib::Executor & executor, const IGetLid & db, IWriteData & dest,
uint32_t numChunks, IFileChunkVisitorProgress *visitorProgress)
{
assert(frozen() || visitorProgress);
vespalib::GenerationHandler::Guard lidReadGuard(db.getLidReadGuard());
assert(numChunks <= getNumChunks());
FixedParams fixedParams = {db, dest, lidReadGuard, getFileId().getId(), visitorProgress};
- vespalib::BlockingThreadStackExecutor singleExecutor(1, 64_Ki, executor.getNumThreads()*2);
+ size_t limit = std::thread::hardware_concurrency();
+ vespalib::ArrayQueue<std::future<Chunk::UP>> queue;
for (size_t chunkId(0); chunkId < numChunks; chunkId++) {
std::promise<Chunk::UP> promisedChunk;
std::future<Chunk::UP> futureChunk = promisedChunk.get_future();
@@ -355,11 +355,17 @@ FileChunk::appendTo(vespalib::ThreadExecutor & executor, const IGetLid & db, IWr
promise.set_value(std::make_unique<Chunk>(chunkId, whole.getData(), whole.getDataLen()));
}));
- singleExecutor.execute(vespalib::makeLambdaTask([args = &fixedParams, chunk = std::move(futureChunk)]() mutable {
- appendChunks(args, chunk.get());
- }));
+ while (queue.size() >= limit) {
+ appendChunks(&fixedParams, queue.front().get());
+ queue.pop();
+ }
+
+ queue.push(std::move(futureChunk));
+ }
+ while ( ! queue.empty() ) {
+ appendChunks(&fixedParams, queue.front().get());
+ queue.pop();
}
- singleExecutor.sync();
dest.close();
}
diff --git a/searchlib/src/vespa/searchlib/docstore/filechunk.h b/searchlib/src/vespa/searchlib/docstore/filechunk.h
index eee69602f8b..0d669d9cfde 100644
--- a/searchlib/src/vespa/searchlib/docstore/filechunk.h
+++ b/searchlib/src/vespa/searchlib/docstore/filechunk.h
@@ -18,7 +18,7 @@ class FastOS_FileInterface;
namespace vespalib {
class DataBuffer;
class GenericHeader;
- class ThreadExecutor;
+ class Executor;
}
namespace search {
@@ -163,7 +163,7 @@ public:
virtual bool frozen() const { return true; }
const vespalib::string & getName() const { return _name; }
void compact(const IGetLid & iGetLid);
- void appendTo(vespalib::ThreadExecutor & executor, const IGetLid & db, IWriteData & dest,
+ void appendTo(vespalib::Executor & executor, const IGetLid & db, IWriteData & dest,
uint32_t numChunks, IFileChunkVisitorProgress *visitorProgress);
/**
* Must be called after chunk has been created to allow correct
diff --git a/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp b/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp
index 6a9ae40cc93..3af7338d73a 100644
--- a/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp
+++ b/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp
@@ -54,7 +54,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::Executor &executor, const vespalib::string &dirName, const Config &config,
const GrowStrategy &growStrategy, const TuneFileSummary &tune,
const FileHeaderContext &fileHeaderContext, transactionlog::SyncProxy &tlSyncer,
IBucketizer::SP bucketizer, bool readOnly)
diff --git a/searchlib/src/vespa/searchlib/docstore/logdatastore.h b/searchlib/src/vespa/searchlib/docstore/logdatastore.h
index 62f87076759..14d7b856e96 100644
--- a/searchlib/src/vespa/searchlib/docstore/logdatastore.h
+++ b/searchlib/src/vespa/searchlib/docstore/logdatastore.h
@@ -10,7 +10,7 @@
#include <vespa/searchlib/common/tunefileinfo.h>
#include <vespa/searchlib/transactionlog/syncproxy.h>
#include <vespa/vespalib/util/rcuvector.h>
-#include <vespa/vespalib/util/threadexecutor.h>
+#include <vespa/vespalib/util/executor.h>
#include <set>
@@ -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::Executor &executor, const vespalib::string &dirName, const Config & config,
const GrowStrategy &growStrategy, const TuneFileSummary &tune,
const search::common::FileHeaderContext &fileHeaderContext,
transactionlog::SyncProxy &tlSyncer, IBucketizer::SP bucketizer, bool readOnly = false);
@@ -256,7 +256,7 @@ private:
FileId _prevActive;
mutable std::mutex _updateLock;
bool _readOnly;
- vespalib::ThreadExecutor &_executor;
+ vespalib::Executor &_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 a9bc8559f3c..d18726dbecb 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::Executor & 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 2931f8bce2d..2b7d7365c1e 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::Executor & executor, const vespalib::string & baseDir, const Config & config,
const GrowStrategy & growStrategy, const TuneFileSummary &tuneFileSummary,
const common::FileHeaderContext &fileHeaderContext,
transactionlog::SyncProxy &tlSyncer, IBucketizer::SP bucketizer);