aboutsummaryrefslogtreecommitdiffstats
path: root/storageserver
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@oath.com>2018-10-04 22:05:19 +0200
committerHenning Baldersheim <balder@oath.com>2018-10-04 22:05:19 +0200
commit0bdd3c5fa4326ed4106b9aee0585d57c7193bd97 (patch)
tree2b519cf259eb30ab28d85fc560a589457f54ed17 /storageserver
parent3f2b1a9230fbab12f2e8b5afcf1e0ad72f3d872a (diff)
Remove the costly and unnecessary setSlobrokId interface.
Diffstat (limited to 'storageserver')
-rw-r--r--storageserver/src/tests/storageservertest.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/storageserver/src/tests/storageservertest.cpp b/storageserver/src/tests/storageservertest.cpp
index f6ed1a7d270..3ec2b92d6f2 100644
--- a/storageserver/src/tests/storageservertest.cpp
+++ b/storageserver/src/tests/storageservertest.cpp
@@ -268,31 +268,26 @@ namespace {
}
void init() {
- documentapi::DocumentProtocol::SP protocol(
- new documentapi::DocumentProtocol(_loadTypes, _repo));
- storage::mbusprot::StorageProtocol::SP storageProtocol(
- new storage::mbusprot::StorageProtocol(_repo, _loadTypes));
+ auto protocol = std::make_shared<documentapi::DocumentProtocol>(_loadTypes, _repo);
+ auto storageProtocol = std::make_shared<storage::mbusprot::StorageProtocol>(_repo, _loadTypes);
mbus::ProtocolSet protocols;
protocols.add(protocol);
protocols.add(storageProtocol);
- mbus::RPCNetworkParams networkParams;
- networkParams.setSlobrokConfig(config::ConfigUri(_config.getConfigId()));
- _mbus.reset(new mbus::RPCMessageBus(protocols, networkParams,
- _config.getConfigId()));
+ mbus::RPCNetworkParams networkParams(config::ConfigUri(_config.getConfigId()));
+ _mbus = std::make_unique<mbus::RPCMessageBus>(protocols, networkParams, _config.getConfigId());
mbus::SourceSessionParams sourceParams;
sourceParams.setTimeout(5000);
- mbus::StaticThrottlePolicy::SP policy(new mbus::StaticThrottlePolicy());
+ auto policy = std::make_shared<mbus::StaticThrottlePolicy>();
policy->setMaxPendingCount(_maxPending);
sourceParams.setThrottlePolicy(policy);
- _sourceSession = _mbus->getMessageBus().createSourceSession(
- *this, sourceParams);
+ _sourceSession = _mbus->getMessageBus().createSourceSession(*this, sourceParams);
}
virtual void notifyStartingShutdown() {
_startedShutdown = true;
}
- virtual void handleReply(mbus::Reply::UP reply) override {
+ void handleReply(mbus::Reply::UP reply) override {
using documentapi::DocumentProtocol;
--_currentPending;
if (!reply->hasErrors()) {