aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/messagebus
diff options
context:
space:
mode:
authordanlark <danlark@yandex-team.ru>2022-02-10 16:46:08 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:08 +0300
commit3426a9bc7f169ae9da54cef557ad2a33f6e8eee0 (patch)
tree26154e1e9990f1bb4525d3e3fb5b6dac2c2c1da2 /library/cpp/messagebus
parentcb68f224c46a8ee52ac3fdd2a32534b8bb8dc134 (diff)
downloadydb-3426a9bc7f169ae9da54cef557ad2a33f6e8eee0.tar.gz
Restoring authorship annotation for <danlark@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/messagebus')
-rw-r--r--library/cpp/messagebus/config/session_config.cpp6
-rw-r--r--library/cpp/messagebus/message.cpp2
-rw-r--r--library/cpp/messagebus/oldmodule/module.cpp4
-rw-r--r--library/cpp/messagebus/rain_check/http/client.cpp2
-rw-r--r--library/cpp/messagebus/rain_check/http/client_ut.cpp6
-rw-r--r--library/cpp/messagebus/remote_connection.cpp2
-rw-r--r--library/cpp/messagebus/session.cpp6
-rw-r--r--library/cpp/messagebus/storage.cpp2
-rw-r--r--library/cpp/messagebus/test/helper/example.cpp10
-rw-r--r--library/cpp/messagebus/test/helper/message_handler_error.cpp4
-rw-r--r--library/cpp/messagebus/test/perftest/perftest.cpp12
-rw-r--r--library/cpp/messagebus/test/ut/messagebus_ut.cpp22
-rw-r--r--library/cpp/messagebus/test/ut/module_client_ut.cpp2
-rw-r--r--library/cpp/messagebus/ybus.h2
14 files changed, 41 insertions, 41 deletions
diff --git a/library/cpp/messagebus/config/session_config.cpp b/library/cpp/messagebus/config/session_config.cpp
index fbbbb106c9..e4b30278ff 100644
--- a/library/cpp/messagebus/config/session_config.cpp
+++ b/library/cpp/messagebus/config/session_config.cpp
@@ -46,13 +46,13 @@ static T ParseWithKmgSuffixT(const char* option) {
T multiplier = 1;
if (str.EndsWith('k')) {
multiplier = 1024;
- str = str.Head(str.size() - 1);
+ str = str.Head(str.size() - 1);
} else if (str.EndsWith('m')) {
multiplier = 1024 * 1024;
- str = str.Head(str.size() - 1);
+ str = str.Head(str.size() - 1);
} else if (str.EndsWith('g')) {
multiplier = 1024 * 1024 * 1024;
- str = str.Head(str.size() - 1);
+ str = str.Head(str.size() - 1);
}
return FromString<T>(str) * multiplier;
}
diff --git a/library/cpp/messagebus/message.cpp b/library/cpp/messagebus/message.cpp
index bfa7ed8e9b..7a81871d0d 100644
--- a/library/cpp/messagebus/message.cpp
+++ b/library/cpp/messagebus/message.cpp
@@ -112,7 +112,7 @@ namespace NBus {
if (Y_UNLIKELY(LocalFlags != 0)) {
TString describe = Describe();
TString localFlags = LocalFlagSetToString(LocalFlags);
- Y_FAIL("message local flags must be zero, got: %s, message: %s", localFlags.data(), describe.data());
+ Y_FAIL("message local flags must be zero, got: %s, message: %s", localFlags.data(), describe.data());
}
}
diff --git a/library/cpp/messagebus/oldmodule/module.cpp b/library/cpp/messagebus/oldmodule/module.cpp
index 24bd778799..51e524c3aa 100644
--- a/library/cpp/messagebus/oldmodule/module.cpp
+++ b/library/cpp/messagebus/oldmodule/module.cpp
@@ -595,7 +595,7 @@ namespace NBus {
(int)(Now() - Message->GetHeader()->SendTime) / 1000,
(int)Pending.size(),
(int)Finished.size(),
- Status != MESSAGE_OK ? ToString(Status).data() : "");
+ Status != MESSAGE_OK ? ToString(Status).data() : "");
TJobStateVec::iterator it;
for (it = Pending.begin(); it != Pending.end(); ++it) {
@@ -613,7 +613,7 @@ namespace NBus {
(int)Message->GetHeader()->Type,
Session->GetProto()->GetService(),
(int)(Now() - Message->GetHeader()->SendTime) / 1000,
- ToString(Status).data());
+ ToString(Status).data());
return strReturn;
}
diff --git a/library/cpp/messagebus/rain_check/http/client.cpp b/library/cpp/messagebus/rain_check/http/client.cpp
index 5ef5ceeece..f27f4d0346 100644
--- a/library/cpp/messagebus/rain_check/http/client.cpp
+++ b/library/cpp/messagebus/rain_check/http/client.cpp
@@ -74,7 +74,7 @@ namespace NRainCheck {
THolder<THttpCallback> callback(new THttpCallback(future));
NNeh::TServiceStatRef stat;
try {
- NNeh::TMessage msg(addr.replace(0, NNeh::TParsedLocation(addr).Scheme.size(), "post"), data);
+ NNeh::TMessage msg(addr.replace(0, NNeh::TParsedLocation(addr).Scheme.size(), "post"), data);
TStringStream headersText;
headers.OutTo(&headersText);
NNeh::NHttp::MakeFullRequest(msg, headersText.Str(), TString());
diff --git a/library/cpp/messagebus/rain_check/http/client_ut.cpp b/library/cpp/messagebus/rain_check/http/client_ut.cpp
index 1628114391..95cf61d9db 100644
--- a/library/cpp/messagebus/rain_check/http/client_ut.cpp
+++ b/library/cpp/messagebus/rain_check/http/client_ut.cpp
@@ -41,11 +41,11 @@ namespace {
const TString TEST_POST_RECV = "POST was ok.";
TString BuildServiceLocation(ui32 port) {
- return Sprintf("http://*:%" PRIu32 "/%s", port, TEST_SERVICE.data());
+ return Sprintf("http://*:%" PRIu32 "/%s", port, TEST_SERVICE.data());
}
TString BuildPostServiceLocation(ui32 port) {
- return Sprintf("post://*:%" PRIu32 "/%s", port + 1, TEST_SERVICE.data());
+ return Sprintf("post://*:%" PRIu32 "/%s", port + 1, TEST_SERVICE.data());
}
TString BuildGetTestRequest(ui32 port) {
@@ -74,7 +74,7 @@ namespace {
const int THR_POOL_SIZE = 2;
runner->ForkLoop(THR_POOL_SIZE);
} catch (...) {
- Y_FAIL("Can't run server: %s", CurrentExceptionMessage().data());
+ Y_FAIL("Can't run server: %s", CurrentExceptionMessage().data());
}
return runner;
diff --git a/library/cpp/messagebus/remote_connection.cpp b/library/cpp/messagebus/remote_connection.cpp
index 22932569db..bdadf7e2e5 100644
--- a/library/cpp/messagebus/remote_connection.cpp
+++ b/library/cpp/messagebus/remote_connection.cpp
@@ -704,7 +704,7 @@ namespace NBus {
dataSize = sizeof(TBusHeader) + plaindata.Size();
NCodecs::TCodecPtr c = Proto->GetTransportCodec();
- c->Encode(TStringBuf{plaindata.data(), plaindata.size()}, compdata);
+ c->Encode(TStringBuf{plaindata.data(), plaindata.size()}, compdata);
if (compdata.Size() < plaindata.Size()) {
plaindata.Clear();
diff --git a/library/cpp/messagebus/session.cpp b/library/cpp/messagebus/session.cpp
index 46a7ece6a8..7436d2327f 100644
--- a/library/cpp/messagebus/session.cpp
+++ b/library/cpp/messagebus/session.cpp
@@ -53,7 +53,7 @@ namespace NBus {
// Simple check that we have to deal with ipv6 address specification or
// just host name or ipv4 address.
- if (!host.empty() && (host[0] == '[')) {
+ if (!host.empty() && (host[0] == '[')) {
size_t pos = host.find(']');
if (pos < 2 || pos == TString::npos) {
// '[]' and '[<address>' are errors.
@@ -98,7 +98,7 @@ namespace NBus {
hostName = host;
}
- if (port.empty()) {
+ if (port.empty()) {
portNum = GetProto()->GetPort();
} else {
try {
@@ -109,7 +109,7 @@ namespace NBus {
}
TBusService service = GetProto()->GetService();
- return GetQueue()->GetLocator()->Register(service, hostName.data(), portNum, start, end, ipVersion);
+ return GetQueue()->GetLocator()->Register(service, hostName.data(), portNum, start, end, ipVersion);
}
TBusSession::~TBusSession() {
diff --git a/library/cpp/messagebus/storage.cpp b/library/cpp/messagebus/storage.cpp
index efefc87340..f015624672 100644
--- a/library/cpp/messagebus/storage.cpp
+++ b/library/cpp/messagebus/storage.cpp
@@ -77,7 +77,7 @@ namespace NBus {
TValue value = {m.MessagePtr.Release()};
std::pair<TKeyToMessage::iterator, bool> p = KeyToMessage.insert(TKeyToMessage::value_type(m.Header.Id, value));
- Y_VERIFY(p.second, "non-unique id; %s", value.Message->Describe().data());
+ Y_VERIFY(p.second, "non-unique id; %s", value.Message->Describe().data());
TTimedItem item = {m.Header.Id, m.Header.SendTime};
TimedItems.push_back(item);
diff --git a/library/cpp/messagebus/test/helper/example.cpp b/library/cpp/messagebus/test/helper/example.cpp
index 7c6d704042..0d3000b81c 100644
--- a/library/cpp/messagebus/test/helper/example.cpp
+++ b/library/cpp/messagebus/test/helper/example.cpp
@@ -14,8 +14,8 @@ static void FillWithJunk(TArrayRef<char> data) {
"01234567890123456789012345678901234567890123456789012345678901234567890123456789"
"01234567890123456789012345678901234567890123456789012345678901234567890123456789";
- for (size_t i = 0; i < data.size(); i += junk.size()) {
- memcpy(data.data() + i, junk.data(), Min(junk.size(), data.size() - i));
+ for (size_t i = 0; i < data.size(); i += junk.size()) {
+ memcpy(data.data() + i, junk.data(), Min(junk.size(), data.size() - i));
}
}
@@ -79,9 +79,9 @@ void TExampleProtocol::Serialize(const TBusMessage* message, TBuffer& buffer) {
// Messages have no data, we recreate them from scratch
// instead of sending, so we don't need to serialize them.
if (const TExampleRequest* exampleMessage = dynamic_cast<const TExampleRequest*>(message)) {
- buffer.Append(exampleMessage->Data.data(), exampleMessage->Data.size());
+ buffer.Append(exampleMessage->Data.data(), exampleMessage->Data.size());
} else if (const TExampleResponse* exampleReply = dynamic_cast<const TExampleResponse*>(message)) {
- buffer.Append(exampleReply->Data.data(), exampleReply->Data.size());
+ buffer.Append(exampleReply->Data.data(), exampleReply->Data.size());
} else {
Y_FAIL("unknown message type");
}
@@ -277,5 +277,5 @@ void TExampleServer::OnMessage(TOnMessageContext& mess) {
status = mess.SendReplyMove(reply);
}
- Y_VERIFY(status == MESSAGE_OK, "failed to send reply: %s", ToString(status).data());
+ Y_VERIFY(status == MESSAGE_OK, "failed to send reply: %s", ToString(status).data());
}
diff --git a/library/cpp/messagebus/test/helper/message_handler_error.cpp b/library/cpp/messagebus/test/helper/message_handler_error.cpp
index c09811ec67..97c73a101d 100644
--- a/library/cpp/messagebus/test/helper/message_handler_error.cpp
+++ b/library/cpp/messagebus/test/helper/message_handler_error.cpp
@@ -6,7 +6,7 @@ using namespace NBus;
using namespace NBus::NTest;
void TBusClientHandlerError::OnError(TAutoPtr<TBusMessage>, EMessageStatus status) {
- Y_FAIL("must not be called, status: %s", ToString(status).data());
+ Y_FAIL("must not be called, status: %s", ToString(status).data());
}
void TBusClientHandlerError::OnReply(TAutoPtr<TBusMessage>, TAutoPtr<TBusMessage>) {
@@ -18,7 +18,7 @@ void TBusClientHandlerError::OnMessageSentOneWay(TAutoPtr<TBusMessage>) {
}
void TBusServerHandlerError::OnError(TAutoPtr<TBusMessage>, EMessageStatus status) {
- Y_FAIL("must not be called, status: %s", ToString(status).data());
+ Y_FAIL("must not be called, status: %s", ToString(status).data());
}
void TBusServerHandlerError::OnMessage(TOnMessageContext&) {
diff --git a/library/cpp/messagebus/test/perftest/perftest.cpp b/library/cpp/messagebus/test/perftest/perftest.cpp
index 8489319278..dbbddf6ef9 100644
--- a/library/cpp/messagebus/test/perftest/perftest.cpp
+++ b/library/cpp/messagebus/test/perftest/perftest.cpp
@@ -157,7 +157,7 @@ void CheckRequest(TPerftestRequest* request) {
TAutoPtr<TPerftestResponse> NewResponse(TPerftestRequest* request) {
TAutoPtr<TPerftestResponse> r(new TPerftestResponse);
r->SetCompressed(TheConfig->UseCompression);
- r->Record.SetData(TString(request->Record.GetData().size(), '.'));
+ r->Record.SetData(TString(request->Record.GetData().size(), '.'));
return r;
}
@@ -475,10 +475,10 @@ TVector<TNetAddr> ParseNodes(const TString nodes) {
TVector<TString> hosts;
- size_t numh = Split(nodes.data(), ",", hosts);
+ size_t numh = Split(nodes.data(), ",", hosts);
for (int i = 0; i < int(numh); i++) {
- const TNetworkAddress& networkAddress = ParseNetworkAddress(hosts[i].data());
+ const TNetworkAddress& networkAddress = ParseNetworkAddress(hosts[i].data());
Y_VERIFY(networkAddress.Begin() != networkAddress.End(), "no addresses");
r.push_back(TNetAddr(networkAddress, &*networkAddress.Begin()));
}
@@ -542,17 +542,17 @@ void TTestStats::PeriodicallyPrint() {
if (!!Server) {
fprintf(stderr, "server: q: %u %s\n",
(unsigned)Server->Bus->GetExecutor()->GetWorkQueueSize(),
- Server->Session->GetStatusSingleLine().data());
+ Server->Session->GetStatusSingleLine().data());
}
if (!!ServerUsingModule) {
fprintf(stderr, "server: q: %u %s\n",
(unsigned)ServerUsingModule->Bus->GetExecutor()->GetWorkQueueSize(),
- ServerUsingModule->Session->GetStatusSingleLine().data());
+ ServerUsingModule->Session->GetStatusSingleLine().data());
}
for (const auto& client : clients) {
fprintf(stderr, "client: q: %u %s\n",
(unsigned)client->Bus->GetExecutor()->GetWorkQueueSize(),
- client->Session->GetStatusSingleLine().data());
+ client->Session->GetStatusSingleLine().data());
}
TStringStream stats;
diff --git a/library/cpp/messagebus/test/ut/messagebus_ut.cpp b/library/cpp/messagebus/test/ut/messagebus_ut.cpp
index 040f9b7702..a79b266a12 100644
--- a/library/cpp/messagebus/test/ut/messagebus_ut.cpp
+++ b/library/cpp/messagebus/test/ut/messagebus_ut.cpp
@@ -138,7 +138,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) {
void OnError(TAutoPtr<TBusMessage> message, EMessageStatus status) override {
Y_UNUSED(message);
- Y_VERIFY(status == MESSAGE_CONNECT_FAILED, "must be MESSAGE_CONNECT_FAILED, got %s", ToString(status).data());
+ Y_VERIFY(status == MESSAGE_CONNECT_FAILED, "must be MESSAGE_CONNECT_FAILED, got %s", ToString(status).data());
TestSync.CheckAndIncrement((failures++) * 2);
}
@@ -159,7 +159,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) {
status = client.Session->SendMessageAutoPtr(message, &noServerAddr);
}
- Y_VERIFY(status == MESSAGE_OK, "must be MESSAGE_OK, got %s", ToString(status).data());
+ Y_VERIFY(status == MESSAGE_OK, "must be MESSAGE_OK, got %s", ToString(status).data());
if (count == 0) {
// lame way to wait until it is connected
@@ -266,7 +266,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) {
TSystemEvent ErrorHappened;
void OnError(TAutoPtr<TBusMessage>, EMessageStatus status) override {
- Y_VERIFY(status == MESSAGE_CONNECT_FAILED || status == MESSAGE_TIMEOUT, "got status: %s", ToString(status).data());
+ Y_VERIFY(status == MESSAGE_CONNECT_FAILED || status == MESSAGE_TIMEOUT, "got status: %s", ToString(status).data());
ErrorHappened.Signal();
}
};
@@ -378,7 +378,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) {
void OnError(TAutoPtr<TBusMessage> mess, EMessageStatus status) override {
Y_UNUSED(mess);
- Y_VERIFY(status == MESSAGE_SHUTDOWN, "only shutdown allowed, got %s", ToString(status).data());
+ Y_VERIFY(status == MESSAGE_SHUTDOWN, "only shutdown allowed, got %s", ToString(status).data());
}
};
@@ -697,7 +697,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) {
void OnError(TAutoPtr<TBusMessage> mess, EMessageStatus status) override {
TestSync.WaitForAndIncrement(0);
- Y_VERIFY(status == MESSAGE_CONNECT_FAILED || status == MESSAGE_TIMEOUT, "must be connection failed, got %s", ToString(status).data());
+ Y_VERIFY(status == MESSAGE_CONNECT_FAILED || status == MESSAGE_TIMEOUT, "must be connection failed, got %s", ToString(status).data());
mess.Destroy();
TestSync.CheckAndIncrement(1);
}
@@ -726,7 +726,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) {
void OnError(TAutoPtr<TBusMessage> message, EMessageStatus status) override {
TestSync.CheckAndIncrement(0);
- Y_VERIFY(status == MESSAGE_CONNECT_FAILED, "must be MESSAGE_CONNECT_FAILED, got %s", ToString(status).data());
+ Y_VERIFY(status == MESSAGE_CONNECT_FAILED, "must be MESSAGE_CONNECT_FAILED, got %s", ToString(status).data());
// check reset is possible here
message->Reset();
@@ -755,7 +755,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) {
client.Session->Shutdown();
ok = client.Session->SendMessageOneWay(message);
- Y_VERIFY(ok == MESSAGE_SHUTDOWN, "must be shutdown when sending during shutdown, got %s", ToString(ok).data());
+ Y_VERIFY(ok == MESSAGE_SHUTDOWN, "must be shutdown when sending during shutdown, got %s", ToString(ok).data());
// check reset is possible here
message->Reset();
@@ -1074,7 +1074,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) {
EMessageStatus status = client.Session->SendMessageOneWay(new TExampleRequest(&client.Proto.RequestCount),
&noServerAddr);
- Y_VERIFY(status == MESSAGE_OK, "must be MESSAGE_OK, got %s", ToString(status).data());
+ Y_VERIFY(status == MESSAGE_OK, "must be MESSAGE_OK, got %s", ToString(status).data());
client.TestSync.WaitForAndIncrement(count * 2 + 1);
// First connection attempt is for connect call; second one is to get connect result.
@@ -1085,7 +1085,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) {
EMessageStatus status = client.Session->SendMessageOneWay(new TExampleRequest(&client.Proto.RequestCount),
&noServerAddr);
- Y_VERIFY(status == MESSAGE_OK, "must be MESSAGE_OK, got %s", ToString(status).data());
+ Y_VERIFY(status == MESSAGE_OK, "must be MESSAGE_OK, got %s", ToString(status).data());
client.TestSync.WaitForAndIncrement(count * 2 + 1);
// First connection attempt is for connect call; second one is to get connect result.
@@ -1107,7 +1107,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) {
EMessageStatus status = client.Session->SendMessageOneWay(new TExampleRequest(&client.Proto.RequestCount),
&noServerAddr);
- Y_VERIFY(status == MESSAGE_OK, "must be MESSAGE_OK, got %s", ToString(status).data());
+ Y_VERIFY(status == MESSAGE_OK, "must be MESSAGE_OK, got %s", ToString(status).data());
client.TestSync.WaitForAndIncrement(count * 2 + 1);
// First connection attempt is for connect call; second one is to get connect result.
@@ -1134,7 +1134,7 @@ Y_UNIT_TEST_SUITE(TMessageBusTests) {
EMessageStatus status = client.Session->SendMessageOneWay(new TExampleRequest(&client.Proto.RequestCount),
&noServerAddr);
- Y_VERIFY(status == MESSAGE_OK, "must be MESSAGE_OK, got %s", ToString(status).data());
+ Y_VERIFY(status == MESSAGE_OK, "must be MESSAGE_OK, got %s", ToString(status).data());
client.TestSync.WaitForAndIncrement(count * 2 + 1);
// First connection attempt is for connect call; second one is to get connect result.
diff --git a/library/cpp/messagebus/test/ut/module_client_ut.cpp b/library/cpp/messagebus/test/ut/module_client_ut.cpp
index ebfe185cc6..4e107ecd2d 100644
--- a/library/cpp/messagebus/test/ut/module_client_ut.cpp
+++ b/library/cpp/messagebus/test/ut/module_client_ut.cpp
@@ -178,7 +178,7 @@ Y_UNIT_TEST_SUITE(BusJobTest) {
}
void ReplyHandler(TBusJob*, EMessageStatus status, TBusMessage* req, TBusMessage* resp) {
- Y_VERIFY(status == MESSAGE_CONNECT_FAILED || status == MESSAGE_TIMEOUT, "got wrong status: %s", ToString(status).data());
+ Y_VERIFY(status == MESSAGE_CONNECT_FAILED || status == MESSAGE_TIMEOUT, "got wrong status: %s", ToString(status).data());
Y_VERIFY(req == SentMessage, "checking request");
Y_VERIFY(resp == nullptr, "checking response");
GotReplyLatch.CountDown();
diff --git a/library/cpp/messagebus/ybus.h b/library/cpp/messagebus/ybus.h
index de21ad8521..6e286471ca 100644
--- a/library/cpp/messagebus/ybus.h
+++ b/library/cpp/messagebus/ybus.h
@@ -67,7 +67,7 @@ namespace NBus {
/// returns service type for this protocol and message
TBusService GetService() const {
- return ServiceName.data();
+ return ServiceName.data();
}
/// returns port number for destination session to open socket