summaryrefslogtreecommitdiffstats
path: root/messagebus
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2017-07-24 15:29:15 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2017-07-24 15:29:15 +0000
commit90c18b1ce77f746e075137560382597eea9a5723 (patch)
treea97484d47b230102d120b73799afdbc94e0169bb /messagebus
parent3565bd357c11b7fa5c3c14ce407c765d44ad91f4 (diff)
using vespalib::make_string
Diffstat (limited to 'messagebus')
-rw-r--r--messagebus/src/vespa/messagebus/error.cpp8
-rw-r--r--messagebus/src/vespa/messagebus/messagebus.cpp9
-rw-r--r--messagebus/src/vespa/messagebus/routing/errordirective.cpp6
-rw-r--r--messagebus/src/vespa/messagebus/routing/routedirective.cpp6
-rw-r--r--messagebus/src/vespa/messagebus/routing/routespec.cpp6
-rw-r--r--messagebus/src/vespa/messagebus/routing/routingspec.cpp6
6 files changed, 23 insertions, 18 deletions
diff --git a/messagebus/src/vespa/messagebus/error.cpp b/messagebus/src/vespa/messagebus/error.cpp
index 7a7785a853f..85c9b92eb19 100644
--- a/messagebus/src/vespa/messagebus/error.cpp
+++ b/messagebus/src/vespa/messagebus/error.cpp
@@ -3,6 +3,8 @@
#include "errorcode.h"
#include <vespa/vespalib/util/stringfmt.h>
+using vespalib::make_string;
+
namespace mbus {
Error::Error()
@@ -24,11 +26,9 @@ Error::toString() const
{
string name(ErrorCode::getName(_code));
if (name.empty()) {
- name = vespalib::make_string("%u", _code);
+ name = make_string("%u", _code);
}
- return vespalib::make_string("[%s @ %s]: %s", name.c_str(),
- _service.empty() ? "localhost" : _service.c_str(),
- _msg.c_str());
+ return make_string("[%s @ %s]: %s", name.c_str(), _service.empty() ? "localhost" : _service.c_str(), _msg.c_str());
}
} // namespace mbus
diff --git a/messagebus/src/vespa/messagebus/messagebus.cpp b/messagebus/src/vespa/messagebus/messagebus.cpp
index b0376ba7cda..e32f5ca4137 100644
--- a/messagebus/src/vespa/messagebus/messagebus.cpp
+++ b/messagebus/src/vespa/messagebus/messagebus.cpp
@@ -13,6 +13,7 @@
LOG_SETUP(".messagebus");
using vespalib::LockGuard;
+using vespalib::make_string;
namespace {
@@ -370,14 +371,10 @@ MessageBus::deliverMessage(Message::UP msg, const string &session)
}
if (msgHandler == NULL) {
deliverError(std::move(msg), ErrorCode::UNKNOWN_SESSION,
- vespalib::make_string(
- "Session '%s' does not exist.",
- session.c_str()));
+ make_string("Session '%s' does not exist.", session.c_str()));
} else if (!checkPending(*msg)) {
deliverError(std::move(msg), ErrorCode::SESSION_BUSY,
- vespalib::make_string(
- "Session '%s' is busy, try again later.",
- session.c_str()));
+ make_string("Session '%s' is busy, try again later.", session.c_str()));
} else {
_msn->deliverMessage(std::move(msg), *msgHandler);
}
diff --git a/messagebus/src/vespa/messagebus/routing/errordirective.cpp b/messagebus/src/vespa/messagebus/routing/errordirective.cpp
index 082583b9271..c26a76d10c7 100644
--- a/messagebus/src/vespa/messagebus/routing/errordirective.cpp
+++ b/messagebus/src/vespa/messagebus/routing/errordirective.cpp
@@ -2,6 +2,8 @@
#include "errordirective.h"
#include <vespa/vespalib/util/stringfmt.h>
+using vespalib::make_string;
+
namespace mbus {
ErrorDirective::ErrorDirective(const vespalib::stringref &msg) :
@@ -11,13 +13,13 @@ ErrorDirective::ErrorDirective(const vespalib::stringref &msg) :
string
ErrorDirective::toString() const
{
- return vespalib::make_string("(%s)", _msg.c_str());
+ return make_string("(%s)", _msg.c_str());
}
string
ErrorDirective::toDebugString() const
{
- return vespalib::make_string("ErrorDirective(msg = '%s')", _msg.c_str());
+ return make_string("ErrorDirective(msg = '%s')", _msg.c_str());
}
} // mbus
diff --git a/messagebus/src/vespa/messagebus/routing/routedirective.cpp b/messagebus/src/vespa/messagebus/routing/routedirective.cpp
index c926c20fb1c..dc84f8c0711 100644
--- a/messagebus/src/vespa/messagebus/routing/routedirective.cpp
+++ b/messagebus/src/vespa/messagebus/routing/routedirective.cpp
@@ -2,6 +2,8 @@
#include "routedirective.h"
#include <vespa/vespalib/util/stringfmt.h>
+using vespalib::make_string;
+
namespace mbus {
RouteDirective::RouteDirective(const vespalib::stringref & name) :
@@ -22,13 +24,13 @@ RouteDirective::matches(const IHopDirective &dir) const
string
RouteDirective::toString() const
{
- return vespalib::make_string("route:%s", _name.c_str());
+ return make_string("route:%s", _name.c_str());
}
string
RouteDirective::toDebugString() const
{
- return vespalib::make_string("RouteDirective(name = '%s')", _name.c_str());
+ return make_string("RouteDirective(name = '%s')", _name.c_str());
}
} // mbus
diff --git a/messagebus/src/vespa/messagebus/routing/routespec.cpp b/messagebus/src/vespa/messagebus/routing/routespec.cpp
index 4762dd4a394..0ebd6745740 100644
--- a/messagebus/src/vespa/messagebus/routing/routespec.cpp
+++ b/messagebus/src/vespa/messagebus/routing/routespec.cpp
@@ -3,6 +3,8 @@
#include "routingspec.h"
#include <vespa/vespalib/util/stringfmt.h>
+using vespalib::make_string;
+
namespace mbus {
RouteSpec::RouteSpec(const string &name) :
@@ -36,9 +38,9 @@ RouteSpec::toConfig(string &cfg, const string &prefix) const
cfg.append(prefix).append("name ").append(RoutingSpec::toConfigString(_name)).append("\n");
uint32_t numHops = _hops.size();
if (numHops > 0) {
- cfg.append(prefix).append("hop[").append(vespalib::make_string("%d", numHops)).append("]\n");
+ cfg.append(prefix).append("hop[").append(make_string("%d", numHops)).append("]\n");
for (uint32_t i = 0; i < numHops; ++i) {
- cfg.append(prefix).append("hop[").append(vespalib::make_string("%d", i)).append("] ");
+ cfg.append(prefix).append("hop[").append(make_string("%d", i)).append("] ");
cfg.append(RoutingSpec::toConfigString(_hops[i])).append("\n");
}
}
diff --git a/messagebus/src/vespa/messagebus/routing/routingspec.cpp b/messagebus/src/vespa/messagebus/routing/routingspec.cpp
index 55cde6c6d82..7d627366759 100644
--- a/messagebus/src/vespa/messagebus/routing/routingspec.cpp
+++ b/messagebus/src/vespa/messagebus/routing/routingspec.cpp
@@ -2,6 +2,8 @@
#include "routingspec.h"
#include <vespa/vespalib/util/stringfmt.h>
+using vespalib::make_string;
+
namespace mbus {
RoutingSpec::RoutingSpec() :
@@ -45,9 +47,9 @@ RoutingSpec::toConfig(string &cfg, const string &prefix) const
{
uint32_t numTables = _tables.size();
if (numTables > 0) {
- cfg.append(prefix).append("routingtable[").append(vespalib::make_string("%d", numTables)).append("]\n");
+ cfg.append(prefix).append("routingtable[").append(make_string("%d", numTables)).append("]\n");
for (uint32_t i = 0; i < numTables; ++i) {
- _tables[i].toConfig(cfg, vespalib::make_string("%sroutingtable[%d].", prefix.c_str(), i));
+ _tables[i].toConfig(cfg, make_string("%sroutingtable[%d].", prefix.c_str(), i));
}
}
}