summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-12-01 14:47:06 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2020-12-01 14:47:06 +0000
commit1e0886545cdb582528998d3d40d337ebd71ccc08 (patch)
tree6d27145bab62ed91e7a49c2c64c544972176e9c2
parent9741a44eaeec1f922696d776053ca2e108554d4e (diff)
Move config setters directly onto main TransportConfig object
-rw-r--r--fnet/src/vespa/fnet/config.h19
-rw-r--r--fnet/src/vespa/fnet/transport.h24
-rw-r--r--messagebus/src/vespa/messagebus/network/rpcnetwork.cpp7
-rw-r--r--storage/src/vespa/storage/storageserver/rpc/shared_rpc_resources.cpp2
4 files changed, 24 insertions, 28 deletions
diff --git a/fnet/src/vespa/fnet/config.h b/fnet/src/vespa/fnet/config.h
index 508cb26c36f..f512d7cde75 100644
--- a/fnet/src/vespa/fnet/config.h
+++ b/fnet/src/vespa/fnet/config.h
@@ -18,23 +18,4 @@ public:
bool _tcpNoDelay;
FNET_Config();
- FNET_Config & events_before_wakeup(uint32_t v) {
- if (v > 1) {
- _events_before_wakeup = v;
- }
- return *this;
- }
- FNET_Config & maxInputBufferSize(uint32_t v) {
- _maxInputBufferSize = v;
- return *this;
- }
- FNET_Config & maxOutputBufferSize(uint32_t v) {
- _maxOutputBufferSize = v;
- return *this;
- }
- FNET_Config & tcpNoDelay(bool v) {
- _tcpNoDelay = v;
- return *this;
- }
-
};
diff --git a/fnet/src/vespa/fnet/transport.h b/fnet/src/vespa/fnet/transport.h
index 6557c372a4d..766eaa3ccaa 100644
--- a/fnet/src/vespa/fnet/transport.h
+++ b/fnet/src/vespa/fnet/transport.h
@@ -32,13 +32,27 @@ public:
_crypto = std::move(crypto_in);
return *this;
}
- TransportConfig & config(const FNET_Config & config_in) {
- _config = config_in;
- return *this;
- }
const FNET_Config & config() const { return _config; }
- FNET_Config & config() { return _config; }
uint32_t num_threads() const { return _num_threads; }
+
+ TransportConfig & events_before_wakeup(uint32_t v) {
+ if (v > 1) {
+ _config._events_before_wakeup = v;
+ }
+ return *this;
+ }
+ TransportConfig & maxInputBufferSize(uint32_t v) {
+ _config._maxInputBufferSize = v;
+ return *this;
+ }
+ TransportConfig & maxOutputBufferSize(uint32_t v) {
+ _config._maxOutputBufferSize = v;
+ return *this;
+ }
+ TransportConfig & tcpNoDelay(bool v) {
+ _config._tcpNoDelay = v;
+ return *this;
+ }
private:
FNET_Config _config;
vespalib::AsyncResolver::SP _resolver;
diff --git a/messagebus/src/vespa/messagebus/network/rpcnetwork.cpp b/messagebus/src/vespa/messagebus/network/rpcnetwork.cpp
index c286b056ae2..9ecc57fd9de 100644
--- a/messagebus/src/vespa/messagebus/network/rpcnetwork.cpp
+++ b/messagebus/src/vespa/messagebus/network/rpcnetwork.cpp
@@ -81,9 +81,10 @@ struct TargetPoolTask : public FNET_Task {
TransportConfig
toFNETConfig(const RPCNetworkParams & params) {
- return TransportConfig().config(FNET_Config().maxInputBufferSize(params.getMaxInputBufferSize())
- .maxOutputBufferSize(params.getMaxOutputBufferSize())
- .tcpNoDelay(params.getTcpNoDelay()));
+ return TransportConfig()
+ .maxInputBufferSize(params.getMaxInputBufferSize())
+ .maxOutputBufferSize(params.getMaxOutputBufferSize())
+ .tcpNoDelay(params.getTcpNoDelay());
}
}
diff --git a/storage/src/vespa/storage/storageserver/rpc/shared_rpc_resources.cpp b/storage/src/vespa/storage/storageserver/rpc/shared_rpc_resources.cpp
index 1b629f86f31..3aa3d21aa7b 100644
--- a/storage/src/vespa/storage/storageserver/rpc/shared_rpc_resources.cpp
+++ b/storage/src/vespa/storage/storageserver/rpc/shared_rpc_resources.cpp
@@ -64,7 +64,7 @@ SharedRpcResources::SharedRpcResources(const config::ConfigUri& config_uri,
int rpc_server_port,
size_t rpc_thread_pool_size)
: _thread_pool(std::make_unique<FastOS_ThreadPool>(1024*60)),
- _transport(std::make_unique<FNET_Transport>(TransportConfig(rpc_thread_pool_size).config(FNET_Config().events_before_wakeup(1)))),
+ _transport(std::make_unique<FNET_Transport>(TransportConfig(rpc_thread_pool_size).events_before_wakeup(1))),
_orb(std::make_unique<FRT_Supervisor>(_transport.get())),
_slobrok_register(std::make_unique<slobrok::api::RegisterAPI>(*_orb, slobrok::ConfiguratorFactory(config_uri))),
_slobrok_mirror(std::make_unique<slobrok::api::MirrorAPI>(*_orb, slobrok::ConfiguratorFactory(config_uri))),