aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/actors/interconnect/ut/lib
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:17 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:17 +0300
commitd3a398281c6fd1d3672036cb2d63f842d2cb28c5 (patch)
treedd4bd3ca0f36b817e96812825ffaf10d645803f2 /library/cpp/actors/interconnect/ut/lib
parent72cb13b4aff9bc9cf22e49251bc8fd143f82538f (diff)
downloadydb-d3a398281c6fd1d3672036cb2d63f842d2cb28c5.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 2 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 d17755cad1..2b6d27cd3f 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 a4a4373f3e..48851de2c5 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 cd3a39a6c0..ff30b1445e 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 bcb3504ebe..7591200471 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 29d52b20af..cd0d9e0152 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,