summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--document/src/vespa/document/annotation/spantree.h2
-rw-r--r--messagebus/src/vespa/messagebus/network/rpcnetwork.cpp9
-rw-r--r--messagebus/src/vespa/messagebus/network/rpcnetwork.h38
-rw-r--r--messagebus/src/vespa/messagebus/network/rpcsend.cpp9
-rw-r--r--messagebus/src/vespa/messagebus/network/rpcsend.h1
-rw-r--r--searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp2
-rw-r--r--searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp2
-rw-r--r--searchcore/src/tests/proton/documentmetastore/lidreusedelayer/lidreusedelayer_test.cpp4
-rw-r--r--searchcore/src/tests/proton/index/indexmanager_test.cpp2
-rw-r--r--searchcore/src/tests/proton/reference/gid_to_lid_change_handler/gid_to_lid_change_handler_test.cpp4
-rw-r--r--searchcore/src/tests/proton/server/visibility_handler/visibility_handler_test.cpp4
-rw-r--r--searchcore/src/vespa/searchcore/proton/docsummary/summarycompacttarget.cpp4
-rw-r--r--searchcore/src/vespa/searchcore/proton/docsummary/summaryflushtarget.cpp5
-rw-r--r--searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.cpp4
-rw-r--r--searchcore/src/vespa/searchcore/proton/flushengine/threadedflushtarget.cpp4
-rw-r--r--searchcore/src/vespa/searchcore/proton/initializer/task_runner.cpp12
-rw-r--r--searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_change_handler.cpp9
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/disk_mem_usage_forwarder.cpp4
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/disk_mem_usage_sampler.cpp4
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/document_subdb_initializer.cpp4
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/documentdb.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/proton_configurer.cpp4
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/searchable_feed_view.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/tlssyncer.cpp4
-rw-r--r--searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp4
-rw-r--r--searchlib/src/apps/tests/btreestress_test.cpp15
-rw-r--r--searchlib/src/apps/tests/memoryindexstress_test.cpp5
-rw-r--r--searchlib/src/tests/memoryindex/memoryindex/memoryindex_test.cpp8
-rw-r--r--searchlib/src/vespa/searchlib/common/isequencedtaskexecutor.h11
-rw-r--r--searchlib/src/vespa/searchlib/docstore/filechunk.cpp6
-rw-r--r--staging_vespalib/src/vespa/vespalib/util/lambdatask.h (renamed from searchlib/src/vespa/searchlib/common/lambdatask.h)4
33 files changed, 100 insertions, 96 deletions
diff --git a/document/src/vespa/document/annotation/spantree.h b/document/src/vespa/document/annotation/spantree.h
index 2518db32fe3..e2839c4793b 100644
--- a/document/src/vespa/document/annotation/spantree.h
+++ b/document/src/vespa/document/annotation/spantree.h
@@ -2,7 +2,7 @@
#pragma once
-#include <vespa/document/annotation/annotation.h>
+#include "annotation.h"
#include <vector>
#include <cassert>
diff --git a/messagebus/src/vespa/messagebus/network/rpcnetwork.cpp b/messagebus/src/vespa/messagebus/network/rpcnetwork.cpp
index e5c292fedd9..95f3679f45c 100644
--- a/messagebus/src/vespa/messagebus/network/rpcnetwork.cpp
+++ b/messagebus/src/vespa/messagebus/network/rpcnetwork.cpp
@@ -15,6 +15,7 @@
#include <vespa/slobrok/sbmirror.h>
#include <vespa/vespalib/component/vtag.h>
#include <vespa/vespalib/util/stringfmt.h>
+#include <vespa/vespalib/util/threadstackexecutor.h>
#include <vespa/fnet/scheduler.h>
#include <vespa/fnet/transport.h>
#include <vespa/fnet/frt/supervisor.h>
@@ -119,6 +120,7 @@ RPCNetwork::RPCNetwork(const RPCNetworkParams &params) :
_regAPI(std::make_unique<slobrok::api::RegisterAPI>(*_orb, *_slobrokCfgFactory)),
_oosManager(std::make_unique<OOSManager>(*_orb, *_mirror, params.getOOSServerPattern())),
_requestedPort(params.getListenPort()),
+ _executor(std::make_unique<vespalib::ThreadStackExecutor>(8,65536)),
_sendV1(std::make_unique<RPCSendV1>()),
_sendV2(std::make_unique<RPCSendV2>()),
_sendAdapters(),
@@ -222,7 +224,10 @@ RPCNetwork::start()
return true;
}
-
+vespalib::Executor &
+RPCNetwork::getExecutor() {
+ return *_executor;
+}
bool
RPCNetwork::waitUntilReady(double seconds) const
@@ -377,6 +382,8 @@ RPCNetwork::sync()
void
RPCNetwork::shutdown()
{
+ _executor->shutdown();
+ _executor->sync();
_transport->ShutDown(false);
_threadPool->Close();
}
diff --git a/messagebus/src/vespa/messagebus/network/rpcnetwork.h b/messagebus/src/vespa/messagebus/network/rpcnetwork.h
index 5e762f1a2a9..13fab018c3b 100644
--- a/messagebus/src/vespa/messagebus/network/rpcnetwork.h
+++ b/messagebus/src/vespa/messagebus/network/rpcnetwork.h
@@ -60,24 +60,25 @@ private:
using SendAdapterMap = std::map<vespalib::Version, RPCSendAdapter*>;
- INetworkOwner *_owner;
- Identity _ident;
- std::unique_ptr<FastOS_ThreadPool> _threadPool;
- std::unique_ptr<FNET_Transport> _transport;
- std::unique_ptr<FRT_Supervisor> _orb;
- FNET_Scheduler &_scheduler;
- std::unique_ptr<RPCTargetPool> _targetPool;
- TargetPoolTask _targetPoolTask;
- std::unique_ptr<RPCServicePool> _servicePool;
- std::unique_ptr<slobrok::ConfiguratorFactory> _slobrokCfgFactory;
- std::unique_ptr<slobrok::api::IMirrorAPI> _mirror;
- std::unique_ptr<slobrok::api::RegisterAPI> _regAPI;
- std::unique_ptr<OOSManager> _oosManager;
- int _requestedPort;
- std::unique_ptr<RPCSendAdapter> _sendV1;
- std::unique_ptr<RPCSendAdapter> _sendV2;
- SendAdapterMap _sendAdapters;
- CompressionConfig _compressionConfig;
+ INetworkOwner *_owner;
+ Identity _ident;
+ std::unique_ptr<FastOS_ThreadPool> _threadPool;
+ std::unique_ptr<FNET_Transport> _transport;
+ std::unique_ptr<FRT_Supervisor> _orb;
+ FNET_Scheduler &_scheduler;
+ std::unique_ptr<RPCTargetPool> _targetPool;
+ TargetPoolTask _targetPoolTask;
+ std::unique_ptr<RPCServicePool> _servicePool;
+ std::unique_ptr<slobrok::ConfiguratorFactory> _slobrokCfgFactory;
+ std::unique_ptr<slobrok::api::IMirrorAPI> _mirror;
+ std::unique_ptr<slobrok::api::RegisterAPI> _regAPI;
+ std::unique_ptr<OOSManager> _oosManager;
+ int _requestedPort;
+ std::unique_ptr<vespalib::ThreadStackExecutor> _executor;
+ std::unique_ptr<RPCSendAdapter> _sendV1;
+ std::unique_ptr<RPCSendAdapter> _sendV2;
+ SendAdapterMap _sendAdapters;
+ CompressionConfig _compressionConfig;
/**
* Resolves and assigns a service address for the given recipient using the
@@ -235,6 +236,7 @@ public:
const slobrok::api::IMirrorAPI &getMirror() const override;
CompressionConfig getCompressionConfig() { return _compressionConfig; }
void invoke(FRT_RPCRequest *req);
+ vespalib::Executor & getExecutor();
};
} // namespace mbus
diff --git a/messagebus/src/vespa/messagebus/network/rpcsend.cpp b/messagebus/src/vespa/messagebus/network/rpcsend.cpp
index 705b8648442..f47855340cf 100644
--- a/messagebus/src/vespa/messagebus/network/rpcsend.cpp
+++ b/messagebus/src/vespa/messagebus/network/rpcsend.cpp
@@ -7,9 +7,10 @@
#include <vespa/messagebus/tracelevel.h>
#include <vespa/messagebus/emptyreply.h>
#include <vespa/messagebus/errorcode.h>
-#include <vespa/vespalib/util/stringfmt.h>
#include <vespa/fnet/channel.h>
#include <vespa/fnet/frt/reflection.h>
+#include <vespa/vespalib/util/stringfmt.h>
+#include <vespa/vespalib/util/lambdatask.h>
#include <vespa/vespalib/data/slime/cursor.h>
@@ -236,6 +237,12 @@ void
RPCSend::invoke(FRT_RPCRequest *req)
{
req->Detach();
+ _net->getExecutor().execute(vespalib::makeLambdaTask([&, req]() { doRequest(req);}));
+}
+
+void
+RPCSend::doRequest(FRT_RPCRequest *req)
+{
FRT_Values &args = *req->GetParams();
std::unique_ptr<Params> params = toParams(args);
diff --git a/messagebus/src/vespa/messagebus/network/rpcsend.h b/messagebus/src/vespa/messagebus/network/rpcsend.h
index c707b47f548..5002a3914f8 100644
--- a/messagebus/src/vespa/messagebus/network/rpcsend.h
+++ b/messagebus/src/vespa/messagebus/network/rpcsend.h
@@ -82,6 +82,7 @@ public:
void invoke(FRT_RPCRequest *req);
private:
+ void doRequest(FRT_RPCRequest *req);
void attach(RPCNetwork &net) final override;
void handleDiscard(Context ctx) final override;
void sendByHandover(RoutingNode &recipient, const vespalib::Version &version,
diff --git a/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp b/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp
index 9eddef36436..b14eb9051d0 100644
--- a/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp
@@ -23,7 +23,7 @@
#include <vespa/searchcore/proton/test/thread_utils.h>
#include <vespa/searchcorespi/plugin/iindexmanagerfactory.h>
#include <vespa/searchlib/common/idestructorcallback.h>
-#include <vespa/searchlib/common/lambdatask.h>
+#include <vespa/vespalib/util/lambdatask.h>
#include <vespa/searchlib/index/docbuilder.h>
#include <vespa/searchlib/test/directory_handler.h>
#include <vespa/vespalib/io/fileutil.h>
diff --git a/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp b/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp
index bb43aa6c63d..1ccbff6e6cf 100644
--- a/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp
@@ -50,7 +50,7 @@ using search::IDestructorCallback;
using search::SerialNum;
using search::index::schema::CollectionType;
using search::index::schema::DataType;
-using search::makeLambdaTask;
+using vespalib::makeLambdaTask;
using search::transactionlog::TransLogServer;
using storage::spi::PartitionId;
using storage::spi::RemoveResult;
diff --git a/searchcore/src/tests/proton/documentmetastore/lidreusedelayer/lidreusedelayer_test.cpp b/searchcore/src/tests/proton/documentmetastore/lidreusedelayer/lidreusedelayer_test.cpp
index 5109d994f61..d56340be2b2 100644
--- a/searchcore/src/tests/proton/documentmetastore/lidreusedelayer/lidreusedelayer_test.cpp
+++ b/searchcore/src/tests/proton/documentmetastore/lidreusedelayer/lidreusedelayer_test.cpp
@@ -7,9 +7,9 @@ LOG_SETUP("lidreusedelayer_test");
#include <vespa/searchcore/proton/server/executorthreadingservice.h>
#include <vespa/searchcore/proton/test/thread_utils.h>
#include <vespa/searchcore/proton/test/threading_service_observer.h>
-#include <vespa/searchlib/common/lambdatask.h>
+#include <vespa/vespalib/util/lambdatask.h>
-using search::makeLambdaTask;
+using vespalib::makeLambdaTask;
namespace proton {
diff --git a/searchcore/src/tests/proton/index/indexmanager_test.cpp b/searchcore/src/tests/proton/index/indexmanager_test.cpp
index 84198fb9b42..e8afd738e84 100644
--- a/searchcore/src/tests/proton/index/indexmanager_test.cpp
+++ b/searchcore/src/tests/proton/index/indexmanager_test.cpp
@@ -43,7 +43,7 @@ using search::index::DocBuilder;
using search::index::DummyFileHeaderContext;
using search::index::Schema;
using search::index::schema::DataType;
-using search::makeLambdaTask;
+using vespalib::makeLambdaTask;
using search::memoryindex::CompactDocumentWordsStore;
using search::memoryindex::Dictionary;
using search::queryeval::Source;
diff --git a/searchcore/src/tests/proton/reference/gid_to_lid_change_handler/gid_to_lid_change_handler_test.cpp b/searchcore/src/tests/proton/reference/gid_to_lid_change_handler/gid_to_lid_change_handler_test.cpp
index 625e9c1f6a9..1201bc4720b 100644
--- a/searchcore/src/tests/proton/reference/gid_to_lid_change_handler/gid_to_lid_change_handler_test.cpp
+++ b/searchcore/src/tests/proton/reference/gid_to_lid_change_handler/gid_to_lid_change_handler_test.cpp
@@ -4,7 +4,7 @@
#include <vespa/document/base/documentid.h>
#include <vespa/vespalib/util/threadstackexecutor.h>
#include <vespa/searchcore/proton/server/executor_thread_service.h>
-#include <vespa/searchlib/common/lambdatask.h>
+#include <vespa/vespalib/util/lambdatask.h>
#include <vespa/searchcore/proton/reference/i_gid_to_lid_change_listener.h>
#include <vespa/searchcore/proton/reference/gid_to_lid_change_handler.h>
#include <map>
@@ -13,7 +13,7 @@ LOG_SETUP("gid_to_lid_change_handler_test");
using document::GlobalId;
using document::DocumentId;
-using search::makeLambdaTask;
+using vespalib::makeLambdaTask;
using search::SerialNum;
namespace proton {
diff --git a/searchcore/src/tests/proton/server/visibility_handler/visibility_handler_test.cpp b/searchcore/src/tests/proton/server/visibility_handler/visibility_handler_test.cpp
index 69b8a482476..5b5bea412f7 100644
--- a/searchcore/src/tests/proton/server/visibility_handler/visibility_handler_test.cpp
+++ b/searchcore/src/tests/proton/server/visibility_handler/visibility_handler_test.cpp
@@ -6,7 +6,7 @@ LOG_SETUP("visibility_handler_test");
#include <vespa/searchcore/proton/test/dummy_feed_view.h>
#include <vespa/searchcore/proton/test/threading_service_observer.h>
#include <vespa/searchcore/proton/server/executorthreadingservice.h>
-#include <vespa/searchlib/common/lambdatask.h>
+#include <vespa/vespalib/util/lambdatask.h>
using search::SerialNum;
using proton::IGetSerialNum;
@@ -15,7 +15,7 @@ using proton::ExecutorThreadingService;
using proton::test::ThreadingServiceObserver;
using proton::IFeedView;
using proton::VisibilityHandler;
-using search::makeLambdaTask;
+using vespalib::makeLambdaTask;
using fastos::TimeStamp;
namespace {
diff --git a/searchcore/src/vespa/searchcore/proton/docsummary/summarycompacttarget.cpp b/searchcore/src/vespa/searchcore/proton/docsummary/summarycompacttarget.cpp
index 0549e57a528..6cc1c1eb5b9 100644
--- a/searchcore/src/vespa/searchcore/proton/docsummary/summarycompacttarget.cpp
+++ b/searchcore/src/vespa/searchcore/proton/docsummary/summarycompacttarget.cpp
@@ -1,13 +1,13 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "summarycompacttarget.h"
-#include <vespa/searchlib/common/lambdatask.h>
+#include <vespa/vespalib/util/lambdatask.h>
#include <vespa/searchcorespi/index/i_thread_service.h>
#include <future>
using search::IDocumentStore;
using search::SerialNum;
-using search::makeLambdaTask;
+using vespalib::makeLambdaTask;
using searchcorespi::FlushStats;
using searchcorespi::IFlushTarget;
diff --git a/searchcore/src/vespa/searchcore/proton/docsummary/summaryflushtarget.cpp b/searchcore/src/vespa/searchcore/proton/docsummary/summaryflushtarget.cpp
index de8eaacf184..2f7681c5909 100644
--- a/searchcore/src/vespa/searchcore/proton/docsummary/summaryflushtarget.cpp
+++ b/searchcore/src/vespa/searchcore/proton/docsummary/summaryflushtarget.cpp
@@ -1,9 +1,8 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "summaryflushtarget.h"
-#include <future>
#include <vespa/searchcorespi/index/i_thread_service.h>
-#include <vespa/searchlib/common/lambdatask.h>
+#include <vespa/vespalib/util/lambdatask.h>
using search::IDocumentStore;
using search::SerialNum;
@@ -91,7 +90,7 @@ SummaryFlushTarget::initFlush(SerialNum currentSerial)
// Called by document db executor
std::promise<Task::UP> promise;
std::future<Task::UP> future = promise.get_future();
- _summaryService.execute(search::makeLambdaTask(
+ _summaryService.execute(vespalib::makeLambdaTask(
[&]() { promise.set_value(
internalInitFlush(currentSerial));
}));
diff --git a/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.cpp b/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.cpp
index 79d82108ee8..91b043d0c9f 100644
--- a/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.cpp
+++ b/searchcore/src/vespa/searchcore/proton/docsummary/summarymanager.cpp
@@ -9,7 +9,7 @@
#include <vespa/searchcorespi/index/i_thread_service.h>
#include <vespa/searchcore/proton/flushengine/shrink_lid_space_flush_target.h>
#include <vespa/searchlib/docstore/logdocumentstore.h>
-#include <vespa/searchlib/common/lambdatask.h>
+#include <vespa/vespalib/util/lambdatask.h>
#include <vespa/searchsummary/docsummary/docsumconfig.h>
#include <vespa/vespalib/util/exceptions.h>
#include <sstream>
@@ -32,7 +32,7 @@ using search::IDocumentStore;
using search::LogDocumentStore;
using search::LogDataStore;
using search::WriteableFileChunk;
-using search::makeLambdaTask;
+using vespalib::makeLambdaTask;
using search::TuneFileSummary;
using search::common::FileHeaderContext;
diff --git a/searchcore/src/vespa/searchcore/proton/flushengine/threadedflushtarget.cpp b/searchcore/src/vespa/searchcore/proton/flushengine/threadedflushtarget.cpp
index c7a614dafe8..3c1ac1b5361 100644
--- a/searchcore/src/vespa/searchcore/proton/flushengine/threadedflushtarget.cpp
+++ b/searchcore/src/vespa/searchcore/proton/flushengine/threadedflushtarget.cpp
@@ -2,13 +2,13 @@
#include "threadedflushtarget.h"
#include <vespa/searchcore/proton/server/igetserialnum.h>
-#include <vespa/searchlib/common/lambdatask.h>
+#include <vespa/vespalib/util/lambdatask.h>
#include <future>
#include <cassert>
using searchcorespi::IFlushTarget;
using searchcorespi::FlushStats;
-using search::makeLambdaTask;
+using vespalib::makeLambdaTask;
namespace proton {
diff --git a/searchcore/src/vespa/searchcore/proton/initializer/task_runner.cpp b/searchcore/src/vespa/searchcore/proton/initializer/task_runner.cpp
index a416a7d18f3..7deb0afa7af 100644
--- a/searchcore/src/vespa/searchcore/proton/initializer/task_runner.cpp
+++ b/searchcore/src/vespa/searchcore/proton/initializer/task_runner.cpp
@@ -1,15 +1,13 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "task_runner.h"
-#include <vespa/searchlib/common/lambdatask.h>
+#include <vespa/vespalib/util/lambdatask.h>
#include <vespa/vespalib/util/threadstackexecutor.h>
#include <future>
-using search::makeLambdaTask;
+using vespalib::makeLambdaTask;
-namespace proton {
-
-namespace initializer {
+namespace proton::initializer {
TaskRunner::TaskRunner(vespalib::Executor &executor)
: _executor(executor),
@@ -126,6 +124,4 @@ TaskRunner::runTask(InitializerTask::SP rootTask,
context->execute(makeLambdaTask([=]() { pollTask(context); } ));
}
-} // namespace proton::initializer
-
-} // namespace proton
+}
diff --git a/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_change_handler.cpp b/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_change_handler.cpp
index bd3574327bc..abaf37f5084 100644
--- a/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_change_handler.cpp
+++ b/searchcore/src/vespa/searchcore/proton/reference/gid_to_lid_change_handler.cpp
@@ -2,14 +2,12 @@
#include "gid_to_lid_change_handler.h"
#include "i_gid_to_lid_change_listener.h"
-#include <vespa/searchlib/common/lambdatask.h>
#include <vespa/searchcorespi/index/i_thread_service.h>
-#include <vespa/document/base/globalid.h>
-#include <cassert>
#include <vespa/vespalib/stllike/hash_map.hpp>
+#include <vespa/vespalib/util/lambdatask.h>
+#include <cassert>
-using search::makeLambdaTask;
-
+using vespalib::makeLambdaTask;
namespace proton {
@@ -22,7 +20,6 @@ GidToLidChangeHandler::GidToLidChangeHandler()
{
}
-
GidToLidChangeHandler::~GidToLidChangeHandler()
{
assert(_closed);
diff --git a/searchcore/src/vespa/searchcore/proton/server/disk_mem_usage_forwarder.cpp b/searchcore/src/vespa/searchcore/proton/server/disk_mem_usage_forwarder.cpp
index 7e8f16ac9a1..22af1dc1692 100644
--- a/searchcore/src/vespa/searchcore/proton/server/disk_mem_usage_forwarder.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/disk_mem_usage_forwarder.cpp
@@ -1,10 +1,10 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "disk_mem_usage_forwarder.h"
-#include <vespa/searchlib/common/lambdatask.h>
+#include <vespa/vespalib/util/lambdatask.h>
#include <cassert>
-using search::makeLambdaTask;
+using vespalib::makeLambdaTask;
namespace proton {
diff --git a/searchcore/src/vespa/searchcore/proton/server/disk_mem_usage_sampler.cpp b/searchcore/src/vespa/searchcore/proton/server/disk_mem_usage_sampler.cpp
index fb7d712db9d..bacf80e69a6 100644
--- a/searchcore/src/vespa/searchcore/proton/server/disk_mem_usage_sampler.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/disk_mem_usage_sampler.cpp
@@ -2,10 +2,10 @@
#include "disk_mem_usage_sampler.h"
#include <vespa/vespalib/util/timer.h>
-#include <vespa/searchlib/common/lambdatask.h>
+#include <vespa/vespalib/util/lambdatask.h>
#include <unistd.h>
-using search::makeLambdaTask;
+using vespalib::makeLambdaTask;
namespace proton {
diff --git a/searchcore/src/vespa/searchcore/proton/server/document_subdb_initializer.cpp b/searchcore/src/vespa/searchcore/proton/server/document_subdb_initializer.cpp
index f48a9d37e8f..375940ea4df 100644
--- a/searchcore/src/vespa/searchcore/proton/server/document_subdb_initializer.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/document_subdb_initializer.cpp
@@ -3,10 +3,10 @@
#include "document_subdb_initializer.h"
#include "idocumentsubdb.h"
#include <future>
-#include <vespa/searchlib/common/lambdatask.h>
+#include <vespa/vespalib/util/lambdatask.h>
#include <vespa/searchcorespi/index/i_thread_service.h>
-using search::makeLambdaTask;
+using vespalib::makeLambdaTask;
namespace proton {
diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp b/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp
index 8c89f2a36af..024de835d7a 100644
--- a/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp
@@ -56,7 +56,7 @@ using storage::spi::Timestamp;
using search::common::FileHeaderContext;
using proton::initializer::InitializerTask;
using proton::initializer::TaskRunner;
-using search::makeLambdaTask;
+using vespalib::makeLambdaTask;
using searchcorespi::IFlushTarget;
namespace proton {
diff --git a/searchcore/src/vespa/searchcore/proton/server/proton_configurer.cpp b/searchcore/src/vespa/searchcore/proton/server/proton_configurer.cpp
index 3e18c05ba0f..fe3314e7976 100644
--- a/searchcore/src/vespa/searchcore/proton/server/proton_configurer.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/proton_configurer.cpp
@@ -5,11 +5,11 @@
#include "bootstrapconfig.h"
#include "i_proton_configurer_owner.h"
#include "i_document_db_config_owner.h"
-#include <vespa/searchlib/common/lambdatask.h>
+#include <vespa/vespalib/util/lambdatask.h>
#include <vespa/vespalib/util/threadstackexecutorbase.h>
#include <future>
-using search::makeLambdaTask;
+using vespalib::makeLambdaTask;
using vespa::config::search::core::ProtonConfig;
namespace proton {
diff --git a/searchcore/src/vespa/searchcore/proton/server/searchable_feed_view.cpp b/searchcore/src/vespa/searchcore/proton/server/searchable_feed_view.cpp
index 14556c86c18..6216af77a56 100644
--- a/searchcore/src/vespa/searchcore/proton/server/searchable_feed_view.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/searchable_feed_view.cpp
@@ -24,7 +24,7 @@ using storage::spi::BucketInfoResult;
using storage::spi::Timestamp;
using vespalib::IllegalStateException;
using vespalib::make_string;
-using search::makeLambdaTask;
+using vespalib::makeLambdaTask;
namespace proton {
diff --git a/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.cpp b/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.cpp
index 5fbae951536..e92c11c2fb8 100644
--- a/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/storeonlydocsubdb.cpp
@@ -36,7 +36,7 @@ using search::GrowStrategy;
using search::AttributeGuard;
using search::AttributeVector;
using search::IndexMetaInfo;
-using search::makeLambdaTask;
+using vespalib::makeLambdaTask;
using search::TuneFileDocumentDB;
using search::index::Schema;
using search::SerialNum;
diff --git a/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.cpp b/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.cpp
index c35f942ca35..290b7b74e87 100644
--- a/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/storeonlyfeedview.cpp
@@ -26,7 +26,7 @@ using document::DocumentId;
using document::DocumentTypeRepo;
using document::DocumentUpdate;
using search::index::Schema;
-using search::makeLambdaTask;
+using vespalib::makeLambdaTask;
using search::IDestructorCallback;
using search::SerialNum;
using storage::spi::BucketInfoResult;
diff --git a/searchcore/src/vespa/searchcore/proton/server/tlssyncer.cpp b/searchcore/src/vespa/searchcore/proton/server/tlssyncer.cpp
index 9afc818594f..4d104256cbd 100644
--- a/searchcore/src/vespa/searchcore/proton/server/tlssyncer.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/tlssyncer.cpp
@@ -3,11 +3,11 @@
#include "tlssyncer.h"
#include "igetserialnum.h"
#include <vespa/vespalib/util/threadexecutor.h>
-#include <vespa/searchlib/common/lambdatask.h>
+#include <vespa/vespalib/util/lambdatask.h>
#include <vespa/searchlib/transactionlog/syncproxy.h>
#include <future>
-using search::makeLambdaTask;
+using vespalib::makeLambdaTask;
using search::SerialNum;
namespace proton {
diff --git a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp
index a2786c90e95..d18ff417074 100644
--- a/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp
+++ b/searchcorespi/src/vespa/searchcorespi/index/indexmaintainer.cpp
@@ -13,7 +13,7 @@
#include <vespa/searchlib/util/filekit.h>
#include <vespa/vespalib/util/autoclosurecaller.h>
#include <vespa/vespalib/util/closuretask.h>
-#include <vespa/searchlib/common/lambdatask.h>
+#include <vespa/vespalib/util/lambdatask.h>
#include <sstream>
#include <vespa/searchcorespi/flush/closureflushtask.h>
#include <vespa/vespalib/util/exceptions.h>
@@ -31,7 +31,7 @@ using search::common::FileHeaderContext;
using search::queryeval::ISourceSelector;
using search::queryeval::Source;
using search::SerialNum;
-using search::makeLambdaTask;
+using vespalib::makeLambdaTask;
using std::ostringstream;
using vespalib::makeClosure;
using vespalib::makeTask;
diff --git a/searchlib/src/apps/tests/btreestress_test.cpp b/searchlib/src/apps/tests/btreestress_test.cpp
index 94f2db165d3..ca92ad4865b 100644
--- a/searchlib/src/apps/tests/btreestress_test.cpp
+++ b/searchlib/src/apps/tests/btreestress_test.cpp
@@ -1,10 +1,6 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/log/log.h>
-LOG_SETUP("btreestress_test");
+
#include <vespa/vespalib/testkit/test_kit.h>
-#include <string>
-#include <set>
-#include <iostream>
#include <vespa/searchlib/btree/btreeroot.h>
#include <vespa/searchlib/btree/btreebuilder.h>
#include <vespa/searchlib/btree/btreenodeallocator.h>
@@ -22,16 +18,17 @@ LOG_SETUP("btreestress_test");
#include <vespa/searchlib/btree/btreestore.hpp>
#include <vespa/searchlib/btree/btreeaggregator.hpp>
-
#include <vespa/vespalib/util/threadstackexecutor.h>
-#include <vespa/searchlib/common/lambdatask.h>
-#include <vespa/searchlib/util/rand48.h>
+#include <vespa/vespalib/util/lambdatask.h>
+
+#include <vespa/log/log.h>
+LOG_SETUP("btreestress_test");
using MyTree = search::btree::BTree<uint32_t, uint32_t>;
using MyTreeIterator = typename MyTree::Iterator;
using MyTreeConstIterator = typename MyTree::ConstIterator;
using GenerationHandler = vespalib::GenerationHandler;
-using search::makeLambdaTask;
+using vespalib::makeLambdaTask;
struct Fixture
{
diff --git a/searchlib/src/apps/tests/memoryindexstress_test.cpp b/searchlib/src/apps/tests/memoryindexstress_test.cpp
index 837952061c8..edb9160a1fb 100644
--- a/searchlib/src/apps/tests/memoryindexstress_test.cpp
+++ b/searchlib/src/apps/tests/memoryindexstress_test.cpp
@@ -16,9 +16,6 @@
#include <vespa/searchlib/common/scheduletaskcallback.h>
#include <vespa/vespalib/util/threadstackexecutor.h>
#include <vespa/document/repo/configbuilder.h>
-#include <vespa/document/datatype/annotationtype.h>
-#include <vespa/document/annotation/annotation.h>
-#include <vespa/document/annotation/span.h>
#include <vespa/document/annotation/spanlist.h>
#include <vespa/document/annotation/spantree.h>
#include <vespa/searchlib/util/rand48.h>
@@ -37,7 +34,7 @@ using document::SpanList;
using document::StringFieldValue;
using search::ScheduleTaskCallback;
using search::index::schema::DataType;
-using search::makeLambdaTask;
+using vespalib::makeLambdaTask;
using search::query::Node;
using search::query::SimplePhrase;
using search::query::SimpleStringTerm;
diff --git a/searchlib/src/tests/memoryindex/memoryindex/memoryindex_test.cpp b/searchlib/src/tests/memoryindex/memoryindex/memoryindex_test.cpp
index cfbb0847cd5..77a687796b3 100644
--- a/searchlib/src/tests/memoryindex/memoryindex/memoryindex_test.cpp
+++ b/searchlib/src/tests/memoryindex/memoryindex/memoryindex_test.cpp
@@ -1,6 +1,5 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/log/log.h>
-LOG_SETUP("memoryindex_test");
+
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/searchlib/memoryindex/memoryindex.h>
@@ -19,11 +18,14 @@ LOG_SETUP("memoryindex_test");
#include <vespa/searchlib/common/scheduletaskcallback.h>
#include <vespa/vespalib/util/threadstackexecutor.h>
+#include <vespa/log/log.h>
+LOG_SETUP("memoryindex_test");
+
using document::Document;
using document::FieldValue;
using search::ScheduleTaskCallback;
using search::index::schema::DataType;
-using search::makeLambdaTask;
+using vespalib::makeLambdaTask;
using search::query::Node;
using search::query::SimplePhrase;
using search::query::SimpleStringTerm;
diff --git a/searchlib/src/vespa/searchlib/common/isequencedtaskexecutor.h b/searchlib/src/vespa/searchlib/common/isequencedtaskexecutor.h
index 6984f696117..9b825f1c47e 100644
--- a/searchlib/src/vespa/searchlib/common/isequencedtaskexecutor.h
+++ b/searchlib/src/vespa/searchlib/common/isequencedtaskexecutor.h
@@ -3,10 +3,9 @@
#include <vespa/vespalib/util/executor.h>
#include <vespa/vespalib/stllike/hash_fun.h>
-#include "lambdatask.h"
+#include <vespa/vespalib/util/lambdatask.h>
-namespace search
-{
+namespace search {
/**
* Interface class to run multiple tasks in parallel, but tasks with same
@@ -50,7 +49,7 @@ public:
*/
template <class FunctionType>
void executeLambda(uint32_t executorId, FunctionType &&function) {
- executeTask(executorId, makeLambdaTask(std::forward<FunctionType>(function)));
+ executeTask(executorId, vespalib::makeLambdaTask(std::forward<FunctionType>(function)));
}
/**
* Wait for all scheduled tasks to complete.
@@ -69,7 +68,7 @@ public:
template <class FunctionType>
void execute(uint64_t componentId, FunctionType &&function) {
uint32_t executorId = getExecutorId(componentId);
- executeTask(executorId, makeLambdaTask(std::forward<FunctionType>(function)));
+ executeTask(executorId, vespalib::makeLambdaTask(std::forward<FunctionType>(function)));
}
/**
@@ -84,7 +83,7 @@ public:
template <class FunctionType>
void execute(vespalib::stringref componentId, FunctionType &&function) {
uint32_t executorId = getExecutorId(componentId);
- executeTask(executorId, makeLambdaTask(std::forward<FunctionType>(function)));
+ executeTask(executorId, vespalib::makeLambdaTask(std::forward<FunctionType>(function)));
}
};
diff --git a/searchlib/src/vespa/searchlib/docstore/filechunk.cpp b/searchlib/src/vespa/searchlib/docstore/filechunk.cpp
index 4fac42c1421..93a85eda0aa 100644
--- a/searchlib/src/vespa/searchlib/docstore/filechunk.cpp
+++ b/searchlib/src/vespa/searchlib/docstore/filechunk.cpp
@@ -5,7 +5,7 @@
#include "summaryexceptions.h"
#include "randreaders.h"
#include <vespa/searchlib/util/filekit.h>
-#include <vespa/searchlib/common/lambdatask.h>
+#include <vespa/vespalib/util/lambdatask.h>
#include <vespa/vespalib/data/fileheader.h>
#include <vespa/vespalib/data/databuffer.h>
#include <vespa/vespalib/stllike/asciistream.h>
@@ -345,14 +345,14 @@ FileChunk::appendTo(vespalib::ThreadExecutor & executor, const IGetLid & db, IWr
for (size_t chunkId(0); chunkId < numChunks; chunkId++) {
std::promise<Chunk::UP> promisedChunk;
std::future<Chunk::UP> futureChunk = promisedChunk.get_future();
- executor.execute(makeLambdaTask([promise = std::move(promisedChunk), chunkId, this]() mutable {
+ executor.execute(vespalib::makeLambdaTask([promise = std::move(promisedChunk), chunkId, this]() mutable {
const ChunkInfo & cInfo(_chunkInfo[chunkId]);
vespalib::DataBuffer whole(0ul, ALIGNMENT);
FileRandRead::FSP keepAlive(_file->read(cInfo.getOffset(), whole, cInfo.getSize()));
promise.set_value(std::make_unique<Chunk>(chunkId, whole.getData(), whole.getDataLen()));
}));
- singleExecutor.execute(makeLambdaTask([args = &fixedParams, chunk = std::move(futureChunk)]() mutable {
+ singleExecutor.execute(vespalib::makeLambdaTask([args = &fixedParams, chunk = std::move(futureChunk)]() mutable {
appendChunks(args, chunk.get());
}));
}
diff --git a/searchlib/src/vespa/searchlib/common/lambdatask.h b/staging_vespalib/src/vespa/vespalib/util/lambdatask.h
index 01b57694d11..1d85c1a0e31 100644
--- a/searchlib/src/vespa/searchlib/common/lambdatask.h
+++ b/staging_vespalib/src/vespa/vespalib/util/lambdatask.h
@@ -3,7 +3,7 @@
#include <vespa/vespalib/util/executor.h>
-namespace search {
+namespace vespalib {
template <class FunctionType>
class LambdaTask : public vespalib::Executor::Task {
@@ -26,4 +26,4 @@ makeLambdaTask(FunctionType &&function)
(std::forward<FunctionType>(function));
}
-} // namespace search
+}