diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:15 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:15 +0300 |
commit | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch) | |
tree | da2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /library/cpp/actors/interconnect/interconnect_channel.h | |
parent | 778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff) | |
download | ydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/actors/interconnect/interconnect_channel.h')
-rw-r--r-- | library/cpp/actors/interconnect/interconnect_channel.h | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/library/cpp/actors/interconnect/interconnect_channel.h b/library/cpp/actors/interconnect/interconnect_channel.h index e4a0ae3cda..e4a4c89ba5 100644 --- a/library/cpp/actors/interconnect/interconnect_channel.h +++ b/library/cpp/actors/interconnect/interconnect_channel.h @@ -18,18 +18,18 @@ namespace NActors { #pragma pack(push, 1) - struct TChannelPart { - ui16 Channel; - ui16 Size; + struct TChannelPart { + ui16 Channel; + ui16 Size; - static constexpr ui16 LastPartFlag = ui16(1) << 15; + static constexpr ui16 LastPartFlag = ui16(1) << 15; TString ToString() const { return TStringBuilder() << "{Channel# " << (Channel & ~LastPartFlag) << " LastPartFlag# " << ((Channel & LastPartFlag) ? "true" : "false") << " Size# " << Size << "}"; } - }; + }; #pragma pack(pop) struct TExSerializedEventTooLarge : std::exception { @@ -41,13 +41,13 @@ namespace NActors { }; class TEventOutputChannel : public TInterconnectLoggingBase { - public: + public: TEventOutputChannel(TEventHolderPool& pool, ui16 id, ui32 peerNodeId, ui32 maxSerializedEventSize, std::shared_ptr<IInterconnectMetrics> metrics, TSessionParams params) : TInterconnectLoggingBase(Sprintf("OutputChannel %" PRIu16 " [node %" PRIu32 "]", id, peerNodeId)) - , Pool(pool) + , Pool(pool) , PeerNodeId(peerNodeId) - , ChannelId(id) + , ChannelId(id) , Metrics(std::move(metrics)) , Params(std::move(params)) , MaxSerializedEventSize(maxSerializedEventSize) @@ -61,33 +61,33 @@ namespace NActors { const ui32 bytes = event.Fill(ev) + sizeof(TEventDescr); OutputQueueSize += bytes; return std::make_pair(bytes, &event); - } + } void DropConfirmed(ui64 confirm); bool FeedBuf(TTcpPacketOutTask& task, ui64 serial, ui64 *weightConsumed); - bool IsEmpty() const { + bool IsEmpty() const { return Queue.empty(); - } + } bool IsWorking() const { return !IsEmpty(); } - ui32 GetQueueSize() const { - return (ui32)Queue.size(); - } + ui32 GetQueueSize() const { + return (ui32)Queue.size(); + } ui64 GetBufferedAmountOfData() const { - return OutputQueueSize; - } + return OutputQueueSize; + } void NotifyUndelivered(); - TEventHolderPool& Pool; + TEventHolderPool& Pool; const ui32 PeerNodeId; - const ui16 ChannelId; + const ui16 ChannelId; std::shared_ptr<IInterconnectMetrics> Metrics; const TSessionParams Params; const ui32 MaxSerializedEventSize; @@ -105,7 +105,7 @@ namespace NActors { static constexpr ui16 MinimumFreeSpace = sizeof(TChannelPart) + sizeof(TEventDescr); - protected: + protected: ui64 OutputQueueSize = 0; std::list<TEventHolder> Queue; @@ -120,8 +120,8 @@ namespace NActors { if (const ui64 amount = std::exchange(UnaccountedTraffic, 0)) { Metrics->UpdateOutputChannelTraffic(ChannelId, amount); } - } + } - friend class TInterconnectSessionTCP; - }; + friend class TInterconnectSessionTCP; + }; } |