aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/actors/interconnect/ut/lib
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:15 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:15 +0300
commit72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch)
treeda2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /library/cpp/actors/interconnect/ut/lib
parent778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff)
downloadydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/actors/interconnect/ut/lib')
-rw-r--r--library/cpp/actors/interconnect/ut/lib/ic_test_cluster.h8
-rw-r--r--library/cpp/actors/interconnect/ut/lib/interrupter.h28
-rw-r--r--library/cpp/actors/interconnect/ut/lib/node.h4
-rw-r--r--library/cpp/actors/interconnect/ut/lib/test_actors.h92
-rw-r--r--library/cpp/actors/interconnect/ut/lib/test_events.h2
5 files changed, 67 insertions, 67 deletions
diff --git a/library/cpp/actors/interconnect/ut/lib/ic_test_cluster.h b/library/cpp/actors/interconnect/ut/lib/ic_test_cluster.h
index 2b6d27cd3f..d17755cad1 100644
--- a/library/cpp/actors/interconnect/ut/lib/ic_test_cluster.h
+++ b/library/cpp/actors/interconnect/ut/lib/ic_test_cluster.h
@@ -9,14 +9,14 @@
#include <util/generic/noncopyable.h>
-class TTestICCluster: public TNonCopyable {
+class TTestICCluster: public TNonCopyable {
public:
struct TTrafficInterrupterSettings {
TDuration RejectingTrafficTimeout;
double BandWidth;
bool Disconnect;
};
-
+
private:
const ui32 NumNodes;
const TString Address = "::1";
@@ -29,7 +29,7 @@ private:
public:
TTestICCluster(ui32 numNodes = 1, NActors::TChannelsConfig channelsConfig = NActors::TChannelsConfig(),
- TTrafficInterrupterSettings* tiSettings = nullptr)
+ TTrafficInterrupterSettings* tiSettings = nullptr)
: NumNodes(numNodes)
, Counters(new NMonitoring::TDynamicCounters)
, ChannelsConfig(channelsConfig)
@@ -67,7 +67,7 @@ public:
return Nodes[id].Get();
}
- ~TTestICCluster() {
+ ~TTestICCluster() {
}
TActorId RegisterActor(NActors::IActor* actor, ui32 nodeId) {
diff --git a/library/cpp/actors/interconnect/ut/lib/interrupter.h b/library/cpp/actors/interconnect/ut/lib/interrupter.h
index 48851de2c5..a4a4373f3e 100644
--- a/library/cpp/actors/interconnect/ut/lib/interrupter.h
+++ b/library/cpp/actors/interconnect/ut/lib/interrupter.h
@@ -26,7 +26,7 @@ class TTrafficInterrupter
TVector<char> Data;
};
struct TCompare {
- bool operator()(const std::pair<TInstant, TDelayedPacket>& x, const std::pair<TInstant, TDelayedPacket>& y) const {
+ bool operator()(const std::pair<TInstant, TDelayedPacket>& x, const std::pair<TInstant, TDelayedPacket>& y) const {
return x.first > y.first;
};
};
@@ -160,7 +160,7 @@ private:
timeout = Min(timeout, conn.DelayedQueue.top().first - TInstant::Now());
}
};
- for (auto& it : Connections) {
+ for (auto& it : Connections) {
updateTimout(it.ForwardConnection);
updateTimout(it.BackwardConnection);
}
@@ -177,20 +177,20 @@ private:
}
if (DelayTraffic) { // process packets from DelayQueues
auto processDelayedPackages = [](TDirectedConnection& conn) {
- while (!conn.DelayedQueue.empty()) {
- auto& frontPackage = conn.DelayedQueue.top();
- if (TInstant::Now() >= frontPackage.first) {
- TInet6StreamSocket* sock = frontPackage.second.ForwardSocket;
- if (sock) {
+ while (!conn.DelayedQueue.empty()) {
+ auto& frontPackage = conn.DelayedQueue.top();
+ if (TInstant::Now() >= frontPackage.first) {
+ TInet6StreamSocket* sock = frontPackage.second.ForwardSocket;
+ if (sock) {
sock->Send(frontPackage.second.Data.data(), frontPackage.second.Data.size());
}
- conn.DelayedQueue.pop();
- } else {
- break;
+ conn.DelayedQueue.pop();
+ } else {
+ break;
}
- }
- };
- for (auto& it : Connections) {
+ }
+ };
+ for (auto& it : Connections) {
processDelayedPackages(it.ForwardConnection);
processDelayedPackages(it.BackwardConnection);
}
@@ -228,7 +228,7 @@ private:
if (recvSize > 0) {
if (DelayTraffic) {
// put packet into DelayQueue
- const TDuration baseDelay = TDuration::MicroSeconds(recvSize * 1e6 / Bandwidth);
+ const TDuration baseDelay = TDuration::MicroSeconds(recvSize * 1e6 / Bandwidth);
const TInstant now = TInstant::Now();
directedConnection->Timestamp = Max(now, directedConnection->Timestamp) + baseDelay;
TDelayedPacket pkt;
diff --git a/library/cpp/actors/interconnect/ut/lib/node.h b/library/cpp/actors/interconnect/ut/lib/node.h
index ff30b1445e..cd3a39a6c0 100644
--- a/library/cpp/actors/interconnect/ut/lib/node.h
+++ b/library/cpp/actors/interconnect/ut/lib/node.h
@@ -63,7 +63,7 @@ public:
TMailboxType::ReadAsFilled, 0));
const TActorId loggerActorId(0, "logger");
- constexpr ui32 LoggerComponentId = 410; // NKikimrServices::LOGGER
+ constexpr ui32 LoggerComponentId = 410; // NKikimrServices::LOGGER
auto loggerSettings = MakeIntrusive<NLog::TSettings>(
loggerActorId,
@@ -78,7 +78,7 @@ public:
NActorsServices::EServiceCommon_Name
);
- constexpr ui32 WilsonComponentId = 430; // NKikimrServices::WILSON
+ constexpr ui32 WilsonComponentId = 430; // NKikimrServices::WILSON
static const TString WilsonComponentName = "WILSON";
loggerSettings->Append(
diff --git a/library/cpp/actors/interconnect/ut/lib/test_actors.h b/library/cpp/actors/interconnect/ut/lib/test_actors.h
index 7591200471..bcb3504ebe 100644
--- a/library/cpp/actors/interconnect/ut/lib/test_actors.h
+++ b/library/cpp/actors/interconnect/ut/lib/test_actors.h
@@ -1,56 +1,56 @@
#pragma once
namespace NActors {
- class TSenderBaseActor: public TActorBootstrapped<TSenderBaseActor> {
- protected:
+ class TSenderBaseActor: public TActorBootstrapped<TSenderBaseActor> {
+ protected:
const TActorId RecipientActorId;
- const ui32 Preload;
- ui64 SequenceNumber = 0;
- ui32 InFlySize = 0;
+ const ui32 Preload;
+ ui64 SequenceNumber = 0;
+ ui32 InFlySize = 0;
- public:
+ public:
TSenderBaseActor(const TActorId& recipientActorId, ui32 preload = 1)
- : RecipientActorId(recipientActorId)
- , Preload(preload)
- {
- }
+ : RecipientActorId(recipientActorId)
+ , Preload(preload)
+ {
+ }
- virtual ~TSenderBaseActor() {
- }
+ virtual ~TSenderBaseActor() {
+ }
- virtual void Bootstrap(const TActorContext& ctx) {
- Become(&TSenderBaseActor::StateFunc);
+ virtual void Bootstrap(const TActorContext& ctx) {
+ Become(&TSenderBaseActor::StateFunc);
ctx.Send(ctx.ExecutorThread.ActorSystem->InterconnectProxy(RecipientActorId.NodeId()), new TEvInterconnect::TEvConnectNode);
- }
+ }
- virtual void SendMessagesIfPossible(const TActorContext& ctx) {
- while (InFlySize < Preload) {
- SendMessage(ctx);
- }
+ virtual void SendMessagesIfPossible(const TActorContext& ctx) {
+ while (InFlySize < Preload) {
+ SendMessage(ctx);
+ }
}
- virtual void SendMessage(const TActorContext& /*ctx*/) {
- ++SequenceNumber;
- }
+ virtual void SendMessage(const TActorContext& /*ctx*/) {
+ ++SequenceNumber;
+ }
- virtual void Handle(TEvents::TEvUndelivered::TPtr& /*ev*/, const TActorContext& ctx) {
- SendMessage(ctx);
- }
+ virtual void Handle(TEvents::TEvUndelivered::TPtr& /*ev*/, const TActorContext& ctx) {
+ SendMessage(ctx);
+ }
- virtual void Handle(TEvTestResponse::TPtr& /*ev*/, const TActorContext& ctx) {
- SendMessagesIfPossible(ctx);
- }
+ virtual void Handle(TEvTestResponse::TPtr& /*ev*/, const TActorContext& ctx) {
+ SendMessagesIfPossible(ctx);
+ }
void Handle(TEvInterconnect::TEvNodeConnected::TPtr& /*ev*/, const TActorContext& ctx) {
SendMessagesIfPossible(ctx);
- }
+ }
- void Handle(TEvInterconnect::TEvNodeDisconnected::TPtr& /*ev*/, const TActorContext& /*ctx*/) {
- }
+ void Handle(TEvInterconnect::TEvNodeDisconnected::TPtr& /*ev*/, const TActorContext& /*ctx*/) {
+ }
- virtual void Handle(TEvents::TEvPoisonPill::TPtr& /*ev*/, const TActorContext& ctx) {
- Die(ctx);
- }
+ virtual void Handle(TEvents::TEvPoisonPill::TPtr& /*ev*/, const TActorContext& ctx) {
+ Die(ctx);
+ }
virtual STRICT_STFUNC(StateFunc,
HFunc(TEvTestResponse, Handle)
@@ -59,25 +59,25 @@ namespace NActors {
HFunc(TEvInterconnect::TEvNodeConnected, Handle)
HFunc(TEvInterconnect::TEvNodeDisconnected, Handle)
)
- };
+ };
- class TReceiverBaseActor: public TActor<TReceiverBaseActor> {
- protected:
- ui64 ReceivedCount = 0;
+ class TReceiverBaseActor: public TActor<TReceiverBaseActor> {
+ protected:
+ ui64 ReceivedCount = 0;
- public:
- TReceiverBaseActor()
- : TActor(&TReceiverBaseActor::StateFunc)
- {
- }
+ public:
+ TReceiverBaseActor()
+ : TActor(&TReceiverBaseActor::StateFunc)
+ {
+ }
- virtual ~TReceiverBaseActor() {
- }
+ virtual ~TReceiverBaseActor() {
+ }
virtual STRICT_STFUNC(StateFunc,
HFunc(TEvTest, Handle)
)
virtual void Handle(TEvTest::TPtr& /*ev*/, const TActorContext& /*ctx*/) {}
- };
+ };
}
diff --git a/library/cpp/actors/interconnect/ut/lib/test_events.h b/library/cpp/actors/interconnect/ut/lib/test_events.h
index cd0d9e0152..29d52b20af 100644
--- a/library/cpp/actors/interconnect/ut/lib/test_events.h
+++ b/library/cpp/actors/interconnect/ut/lib/test_events.h
@@ -2,7 +2,7 @@
#include <library/cpp/actors/interconnect/ut/protos/interconnect_test.pb.h>
-namespace NActors {
+namespace NActors {
enum {
EvTest = EventSpaceBegin(TEvents::ES_PRIVATE),
EvTestChan,