From b6073079e7d0d09fb7f13606d3fe3f1798337d66 Mon Sep 17 00:00:00 2001 From: HÃ¥vard Pettersen Date: Wed, 22 Feb 2023 12:54:31 +0000 Subject: untangle fnet from fastos --- config/src/tests/file_acquirer/file_acquirer_test.cpp | 4 +--- config/src/tests/frtconnectionpool/frtconnectionpool.cpp | 5 +---- config/src/vespa/config/frt/frtconnectionpool.cpp | 10 ++++------ config/src/vespa/config/frt/frtconnectionpool.h | 5 +---- config/src/vespa/config/subscription/sourcespec.cpp | 3 +-- 5 files changed, 8 insertions(+), 19 deletions(-) (limited to 'config') diff --git a/config/src/tests/file_acquirer/file_acquirer_test.cpp b/config/src/tests/file_acquirer/file_acquirer_test.cpp index 8449a33a782..8e11f964f16 100644 --- a/config/src/tests/file_acquirer/file_acquirer_test.cpp +++ b/config/src/tests/file_acquirer/file_acquirer_test.cpp @@ -11,7 +11,6 @@ using namespace config; struct ServerFixture : FRT_Invokable { fnet::frt::StandaloneFRT server; - FastOS_ThreadPool threadPool; FNET_Transport transport; FRT_Supervisor &orb; vespalib::string spec; @@ -26,14 +25,13 @@ struct ServerFixture : FRT_Invokable { ServerFixture() : server(), - threadPool(), transport(), orb(server.supervisor()) { init_rpc(); orb.Listen(0); spec = vespalib::make_string("tcp/localhost:%d", orb.GetListenPort()); - transport.Start(&threadPool); + transport.Start(); } void RPC_waitFor(FRT_RPCRequest *req) { diff --git a/config/src/tests/frtconnectionpool/frtconnectionpool.cpp b/config/src/tests/frtconnectionpool/frtconnectionpool.cpp index 9c3498a92a1..834b1797ed0 100644 --- a/config/src/tests/frtconnectionpool/frtconnectionpool.cpp +++ b/config/src/tests/frtconnectionpool/frtconnectionpool.cpp @@ -4,7 +4,6 @@ #include #include #include -#include #include #include #include @@ -14,7 +13,6 @@ using namespace config; class Test : public vespalib::TestApp { private: static ServerSpec::HostSpecList _sources; - FastOS_ThreadPool _threadPool; FNET_Transport _transport; void verifyAllSourcesInRotation(FRTConnectionPool& sourcePool); public: @@ -33,10 +31,9 @@ public: Test::Test() : vespalib::TestApp(), - _threadPool(), _transport() { - _transport.Start(&_threadPool); + _transport.Start(); } Test::~Test() { diff --git a/config/src/vespa/config/frt/frtconnectionpool.cpp b/config/src/vespa/config/frt/frtconnectionpool.cpp index 21d6f0dbe90..de00c650628 100644 --- a/config/src/vespa/config/frt/frtconnectionpool.cpp +++ b/config/src/vespa/config/frt/frtconnectionpool.cpp @@ -167,14 +167,12 @@ FRTConnectionPool::getScheduler() { return _supervisor->GetScheduler(); } -FRTConnectionPoolWithTransport::FRTConnectionPoolWithTransport(std::unique_ptr threadPool, - std::unique_ptr transport, +FRTConnectionPoolWithTransport::FRTConnectionPoolWithTransport(std::unique_ptr transport, const ServerSpec & spec, const TimingValues & timingValues) - : _threadPool(std::move(threadPool)), - _transport(std::move(transport)), - _connectionPool(std::make_unique(*_transport, spec, timingValues)) + : _transport(std::move(transport)), + _connectionPool(std::make_unique(*_transport, spec, timingValues)) { - _transport->Start(_threadPool.get()); + _transport->Start(); } FRTConnectionPoolWithTransport::~FRTConnectionPoolWithTransport() diff --git a/config/src/vespa/config/frt/frtconnectionpool.h b/config/src/vespa/config/frt/frtconnectionpool.h index 564c6506159..5d97f2ae338 100644 --- a/config/src/vespa/config/frt/frtconnectionpool.h +++ b/config/src/vespa/config/frt/frtconnectionpool.h @@ -8,7 +8,6 @@ #include class FNET_Transport; -class FastOS_ThreadPool; namespace config { @@ -103,8 +102,7 @@ public: class FRTConnectionPoolWithTransport : public ConnectionFactory { public: - FRTConnectionPoolWithTransport(std::unique_ptr threadPool, - std::unique_ptr transport, + FRTConnectionPoolWithTransport(std::unique_ptr transport, const ServerSpec & spec, const TimingValues & timingValues); FRTConnectionPoolWithTransport(const FRTConnectionPoolWithTransport&) = delete; FRTConnectionPoolWithTransport& operator=(const FRTConnectionPoolWithTransport&) = delete; @@ -113,7 +111,6 @@ public: void syncTransport() override { _connectionPool->syncTransport(); } Connection* getCurrent() override { return _connectionPool->getCurrent(); } private: - std::unique_ptr _threadPool; std::unique_ptr _transport; std::unique_ptr _connectionPool; }; diff --git a/config/src/vespa/config/subscription/sourcespec.cpp b/config/src/vespa/config/subscription/sourcespec.cpp index c05f639f9ba..0bdcf2acbc5 100644 --- a/config/src/vespa/config/subscription/sourcespec.cpp +++ b/config/src/vespa/config/subscription/sourcespec.cpp @@ -127,8 +127,7 @@ ServerSpec::createSourceFactory(const TimingValues & timingValues) const { const auto vespaVersion = VespaVersion::getCurrentVersion(); return std::make_unique( - std::make_unique(std::make_unique(), - std::make_unique(), + std::make_unique(std::make_unique(), *this, timingValues), timingValues, _traceLevel, vespaVersion, _compressionType); } -- cgit v1.2.3