aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/apps/vespa-transactionlog-inspect/vespa-transactionlog-inspect.cpp
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-02-20 21:24:22 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2022-02-20 23:46:18 +0000
commit1bb2800fb1bf312689115a7230b1d3ead74d4ac6 (patch)
tree29c84e9a2b9451e0fc4cd8d5e2908c26eb1758fd /searchcore/src/apps/vespa-transactionlog-inspect/vespa-transactionlog-inspect.cpp
parent1cfea65b9bc71b472e9dc3370b120cf428b6ece0 (diff)
Use a common FNET_Transport owned by Proton in both SceduledExecutor and TransactionLogServer.
This reduces the number of Transport object by 1 per document type and netto 1 in Proton. Each of them contains 2 threads. In addition it uses a common Transport for the RpcFileAcquirer objects used during config fetching. This prevents creating 3 temporary Transport objects on every reconfig.
Diffstat (limited to 'searchcore/src/apps/vespa-transactionlog-inspect/vespa-transactionlog-inspect.cpp')
-rw-r--r--searchcore/src/apps/vespa-transactionlog-inspect/vespa-transactionlog-inspect.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/searchcore/src/apps/vespa-transactionlog-inspect/vespa-transactionlog-inspect.cpp b/searchcore/src/apps/vespa-transactionlog-inspect/vespa-transactionlog-inspect.cpp
index a7f23c382e9..c5a163f20ed 100644
--- a/searchcore/src/apps/vespa-transactionlog-inspect/vespa-transactionlog-inspect.cpp
+++ b/searchcore/src/apps/vespa-transactionlog-inspect/vespa-transactionlog-inspect.cpp
@@ -8,12 +8,14 @@
#include <vespa/vespalib/util/programoptions.h>
#include <vespa/vespalib/util/xmlstream.h>
#include <vespa/vespalib/util/time.h>
+#include <vespa/vespalib/util/size_literals.h>
#include <vespa/document/config/documenttypes_config_fwd.h>
#include <vespa/document/config/config-documenttypes.h>
#include <vespa/document/repo/documenttyperepo.h>
#include <vespa/document/fieldvalue/document.h>
#include <vespa/document/update/documentupdate.h>
#include <vespa/config/helper/configgetter.hpp>
+#include <vespa/fnet/transport.h>
#include <vespa/fastos/app.h>
#include <iostream>
#include <thread>
@@ -324,7 +326,7 @@ public:
*/
struct Utility
{
- virtual ~Utility() {}
+ virtual ~Utility() = default;
typedef std::unique_ptr<Utility> UP;
virtual int run() = 0;
};
@@ -371,6 +373,8 @@ class BaseUtility : public Utility
protected:
const BaseOptions &_bopts;
DummyFileHeaderContext _fileHeader;
+ FastOS_ThreadPool _threadPool;
+ FNET_Transport _transport;
TransLogServer _server;
client::TransLogClient _client;
@@ -378,10 +382,15 @@ public:
BaseUtility(const BaseOptions &bopts)
: _bopts(bopts),
_fileHeader(),
- _server(_bopts.tlsName, _bopts.listenPort, _bopts.tlsDir, _fileHeader),
+ _threadPool(64_Ki),
+ _transport(),
+ _server(_transport, _bopts.tlsName, _bopts.listenPort, _bopts.tlsDir, _fileHeader),
_client(vespalib::make_string("tcp/localhost:%d", _bopts.listenPort))
{
}
+ ~BaseUtility() override {
+ _transport.ShutDown(true);
+ }
virtual int run() override = 0;
};