diff options
author | Harald Musum <musum@verizonmedia.com> | 2022-02-22 15:36:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-22 15:36:28 +0100 |
commit | e16f3bc5db8316c5d95f7f82563261bdcb274705 (patch) | |
tree | a02262447a59ab50e99a08052e454c08f10d2bcd /searchcore/src/tests/proton/index | |
parent | ba49ee6d97276ee19fc9b4d5f0d328df73273a74 (diff) |
Revert "Use common tranport for TlsClient"
Diffstat (limited to 'searchcore/src/tests/proton/index')
-rw-r--r-- | searchcore/src/tests/proton/index/CMakeLists.txt | 2 | ||||
-rw-r--r-- | searchcore/src/tests/proton/index/fusionrunner_test.cpp | 34 | ||||
-rw-r--r-- | searchcore/src/tests/proton/index/indexmanager_test.cpp | 18 |
3 files changed, 28 insertions, 26 deletions
diff --git a/searchcore/src/tests/proton/index/CMakeLists.txt b/searchcore/src/tests/proton/index/CMakeLists.txt index 313dd5e0457..62a631dc26e 100644 --- a/searchcore/src/tests/proton/index/CMakeLists.txt +++ b/searchcore/src/tests/proton/index/CMakeLists.txt @@ -3,7 +3,6 @@ vespa_add_executable(searchcore_indexmanager_test_app TEST SOURCES indexmanager_test.cpp DEPENDS - searchcore_test searchcore_server searchcore_index searchcore_flushengine @@ -18,7 +17,6 @@ vespa_add_executable(searchcore_fusionrunner_test_app TEST SOURCES fusionrunner_test.cpp DEPENDS - searchcore_test searchcore_server searchcore_index searchcore_pcommon diff --git a/searchcore/src/tests/proton/index/fusionrunner_test.cpp b/searchcore/src/tests/proton/index/fusionrunner_test.cpp index 38314abd7e5..ae85211fe24 100644 --- a/searchcore/src/tests/proton/index/fusionrunner_test.cpp +++ b/searchcore/src/tests/proton/index/fusionrunner_test.cpp @@ -2,7 +2,7 @@ #include <vespa/fastos/file.h> #include <vespa/searchcore/proton/index/indexmanager.h> -#include <vespa/searchcore/proton/test/transport_helper.h> +#include <vespa/searchcore/proton/server/executorthreadingservice.h> #include <vespa/searchcorespi/index/fusionrunner.h> #include <vespa/vespalib/util/isequencedtaskexecutor.h> #include <vespa/searchlib/common/flush_token.h> @@ -17,7 +17,6 @@ #include <vespa/vespalib/util/gate.h> #include <vespa/vespalib/util/destructor_callbacks.h> #include <vespa/vespalib/testkit/testapp.h> -#include <vespa/vespalib/util/size_literals.h> #include <set> using document::Document; @@ -67,7 +66,8 @@ class Test : public vespalib::TestApp { FixedSourceSelector::UP _selector; FusionSpec _fusion_spec; DummyFileHeaderContext _fileHeaderContext; - TransportAndExecutorService _service; + vespalib::ThreadStackExecutor _sharedExecutor; + ExecutorThreadingService _threadingService; IndexManager::MaintainerOperations _ops; void setUp(); @@ -85,21 +85,21 @@ class Test : public vespalib::TestApp { void requireThatFusionCanBeStopped(); public: - Test(); - ~Test(); + Test() + : _fusion_runner(), + _selector(), + _fusion_spec(), + _fileHeaderContext(), + _sharedExecutor(1, 0x10000), + _threadingService(_sharedExecutor), + _ops(_fileHeaderContext, + TuneFileIndexManager(), 0, + _threadingService) + {} + ~Test() {} int Main() override; }; -Test::Test() - : _fusion_runner(), - _selector(), - _fusion_spec(), - _fileHeaderContext(), - _service(1), - _ops(_fileHeaderContext,TuneFileIndexManager(), 0, _service.write()) -{ } -Test::~Test() = default; - int Test::Main() { @@ -180,8 +180,8 @@ void Test::createIndex(const string &dir, uint32_t id, bool fusion) { Schema schema = getSchema(); DocBuilder doc_builder(schema); MemoryIndex memory_index(schema, MockFieldLengthInspector(), - _service.write().indexFieldInverter(), - _service.write().indexFieldWriter()); + _threadingService.indexFieldInverter(), + _threadingService.indexFieldWriter()); addDocument(doc_builder, memory_index, *_selector, id, id + 0, term); addDocument(doc_builder, memory_index, *_selector, id, id + 1, "bar"); addDocument(doc_builder, memory_index, *_selector, id, id + 2, "baz"); diff --git a/searchcore/src/tests/proton/index/indexmanager_test.cpp b/searchcore/src/tests/proton/index/indexmanager_test.cpp index 6cca28f5b43..1e33482b055 100644 --- a/searchcore/src/tests/proton/index/indexmanager_test.cpp +++ b/searchcore/src/tests/proton/index/indexmanager_test.cpp @@ -2,7 +2,7 @@ #include <vespa/fastos/file.h> #include <vespa/searchcore/proton/index/indexmanager.h> -#include <vespa/searchcore/proton/test/transport_helper.h> +#include <vespa/searchcore/proton/server/executorthreadingservice.h> #include <vespa/searchcorespi/index/index_manager_stats.h> #include <vespa/searchcorespi/index/indexcollection.h> #include <vespa/searchcorespi/index/indexflushtarget.h> @@ -24,6 +24,7 @@ #include <vespa/vespalib/util/destructor_callbacks.h> #include <vespa/vespalib/util/gate.h> #include <vespa/vespalib/util/size_literals.h> +#include <vespa/vespalib/util/threadstackexecutor.h> #include <vespa/vespalib/util/time.h> #include <set> #include <thread> @@ -52,6 +53,7 @@ using search::memoryindex::FieldIndexCollection; using search::queryeval::Source; using std::set; using std::string; +using vespalib::ThreadStackExecutor; using vespalib::makeLambdaTask; using std::chrono::duration_cast; @@ -106,7 +108,8 @@ struct IndexManagerTest : public ::testing::Test { SerialNum _serial_num; IndexManagerDummyReconfigurer _reconfigurer; DummyFileHeaderContext _fileHeaderContext; - TransportAndExecutorService _service; + vespalib::ThreadStackExecutor _sharedExecutor; + ExecutorThreadingService _writeService; std::unique_ptr<IndexManager> _index_manager; Schema _schema; DocBuilder _builder; @@ -115,7 +118,8 @@ struct IndexManagerTest : public ::testing::Test { : _serial_num(0), _reconfigurer(), _fileHeaderContext(), - _service(1), + _sharedExecutor(1, 0x10000), + _writeService(_sharedExecutor), _index_manager(), _schema(getSchema()), _builder(_schema) @@ -126,13 +130,13 @@ struct IndexManagerTest : public ::testing::Test { } ~IndexManagerTest() { - _service.shutdown(); + _writeService.shutdown(); } template <class FunctionType> inline void runAsMaster(FunctionType &&function) { vespalib::Gate gate; - _service.write().master().execute(makeLambdaTask([&gate,function = std::move(function)]() { + _writeService.master().execute(makeLambdaTask([&gate,function = std::move(function)]() { function(); gate.countDown(); })); @@ -141,7 +145,7 @@ struct IndexManagerTest : public ::testing::Test { template <class FunctionType> inline void runAsIndex(FunctionType &&function) { vespalib::Gate gate; - _service.write().index().execute(makeLambdaTask([&gate,function = std::move(function)]() { + _writeService.index().execute(makeLambdaTask([&gate,function = std::move(function)]() { function(); gate.countDown(); })); @@ -206,7 +210,7 @@ IndexManagerTest::resetIndexManager() { _index_manager.reset(); _index_manager = std::make_unique<IndexManager>(index_dir, IndexConfig(), getSchema(), 1, - _reconfigurer, _service.write(), _service.shared(), + _reconfigurer, _writeService, _sharedExecutor, TuneFileIndexManager(), TuneFileAttributes(), _fileHeaderContext); } |