diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-07-24 15:01:50 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-07-24 15:01:50 +0000 |
commit | 87b1d3270af371f6dc7c53bd4d60a77308217223 (patch) | |
tree | fc8a4d765736b133ccadeb264f5919670e57c5ee /messagebus | |
parent | 17f9f8870efd698d1f82508d582a0dc9026453cd (diff) |
make_vespa_string -> make_string.
Diffstat (limited to 'messagebus')
-rw-r--r-- | messagebus/src/vespa/messagebus/sequencer.cpp | 10 | ||||
-rw-r--r-- | messagebus/src/vespa/messagebus/sourcesession.cpp | 29 |
2 files changed, 16 insertions, 23 deletions
diff --git a/messagebus/src/vespa/messagebus/sequencer.cpp b/messagebus/src/vespa/messagebus/sequencer.cpp index 0aa715729fe..79fbd346c16 100644 --- a/messagebus/src/vespa/messagebus/sequencer.cpp +++ b/messagebus/src/vespa/messagebus/sequencer.cpp @@ -3,6 +3,8 @@ #include "tracelevel.h" #include <vespa/vespalib/util/stringfmt.h> +using vespalib::make_string; + namespace mbus { Sequencer::Sequencer(IMessageHandler &sender) : @@ -42,7 +44,7 @@ Sequencer::filter(Message::UP msg) it->second = new MessageQueue(); } msg->getTrace().trace(TraceLevel::COMPONENT, - vespalib::make_vespa_string("Sequencer queued message with sequence id '%" PRIu64 "'.", seqId)); + make_string("Sequencer queued message with sequence id '%" PRIu64 "'.", seqId)); it->second->push(msg.get()); msg.release(); return Message::UP(); @@ -56,8 +58,8 @@ void Sequencer::sequencedSend(Message::UP msg) { msg->getTrace().trace(TraceLevel::COMPONENT, - vespalib::make_vespa_string("Sequencer sending message with sequence id '%" PRIu64 "'.", - msg->getContext().value.UINT64)); + make_string("Sequencer sending message with sequence id '%" PRIu64 "'.", + msg->getContext().value.UINT64)); msg->pushHandler(*this); _sender.handleMessage(std::move(msg)); } @@ -80,7 +82,7 @@ Sequencer::handleReply(Reply::UP reply) { uint64_t seq = reply->getContext().value.UINT64; reply->getTrace().trace(TraceLevel::COMPONENT, - vespalib::make_vespa_string("Sequencer received reply with sequence id '%" PRIu64 "'.", seq)); + make_string("Sequencer received reply with sequence id '%" PRIu64 "'.", seq)); Message::UP msg; { vespalib::LockGuard guard(_lock); diff --git a/messagebus/src/vespa/messagebus/sourcesession.cpp b/messagebus/src/vespa/messagebus/sourcesession.cpp index 1daf6ccee99..9a93a4aedf1 100644 --- a/messagebus/src/vespa/messagebus/sourcesession.cpp +++ b/messagebus/src/vespa/messagebus/sourcesession.cpp @@ -1,15 +1,14 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "sourcesession.h" -#include "sourcesessionparams.h" -#include "error.h" #include "errorcode.h" #include "messagebus.h" #include "replygate.h" #include "tracelevel.h" -#include <algorithm> #include <vespa/messagebus/routing/routingtable.h> #include <vespa/vespalib/util/stringfmt.h> +using vespalib::make_string; + namespace mbus { SourceSession::SourceSession(MessageBus &mbus, const SourceSessionParams ¶ms) @@ -48,15 +47,11 @@ SourceSession::send(Message::UP msg, const string &routeName, bool parseIfNotFou msg->setRoute(*route); found = true; } else if (!parseIfNotFound) { - string str = vespalib::make_vespa_string( - "Route '%s' not found.", - routeName.c_str()); + string str = make_string("Route '%s' not found.", routeName.c_str()); return Result(Error(ErrorCode::ILLEGAL_ROUTE, str), std::move(msg)); } } else if (!parseIfNotFound) { - string str = vespalib::make_vespa_string( - "No routing table available for protocol '%s'.", - msg->getProtocol().c_str()); + string str = make_string("No routing table available for protocol '%s'.", msg->getProtocol().c_str()); return Result(Error(ErrorCode::ILLEGAL_ROUTE, str), std::move(msg)); } if (!found) { @@ -82,13 +77,12 @@ SourceSession::send(Message::UP msg) { vespalib::MonitorGuard guard(_monitor); if (_closed) { - return Result(Error(ErrorCode::SEND_QUEUE_CLOSED, - "Source session is closed."), std::move(msg)); + return Result(Error(ErrorCode::SEND_QUEUE_CLOSED, "Source session is closed."), std::move(msg)); } if (_throttlePolicy.get() != NULL && !_throttlePolicy->canSend(*msg, _pendingCount)) { return Result(Error(ErrorCode::SEND_QUEUE_FULL, - vespalib::make_vespa_string("Too much pending data (%d messages).", - _pendingCount)), std::move(msg)); + make_string("Too much pending data (%d messages).", _pendingCount)), + std::move(msg)); } msg->pushHandler(_replyHandler); if (_throttlePolicy.get() != NULL) { @@ -98,9 +92,8 @@ SourceSession::send(Message::UP msg) } if (msg->getTrace().shouldTrace(TraceLevel::COMPONENT)) { msg->getTrace().trace(TraceLevel::COMPONENT, - vespalib::make_vespa_string("Source session accepted a %d byte message. " - "%d message(s) now pending.", - msg->getApproxSize(), _pendingCount)); + make_string("Source session accepted a %d byte message. %d message(s) now pending.", + msg->getApproxSize(), _pendingCount)); } msg->pushHandler(*this); _sequencer.handleMessage(std::move(msg)); @@ -122,9 +115,7 @@ SourceSession::handleReply(Reply::UP reply) } if (reply->getTrace().shouldTrace(TraceLevel::COMPONENT)) { reply->getTrace().trace(TraceLevel::COMPONENT, - vespalib::make_vespa_string("Source session received reply. " - "%d message(s) now pending.", - _pendingCount)); + make_string("Source session received reply. %d message(s) now pending.", _pendingCount)); } IReplyHandler &handler = reply->getCallStack().pop(*reply); handler.handleReply(std::move(reply)); |