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_nameserver_table.cpp | |
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_nameserver_table.cpp')
-rw-r--r-- | library/cpp/actors/interconnect/interconnect_nameserver_table.cpp | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/library/cpp/actors/interconnect/interconnect_nameserver_table.cpp b/library/cpp/actors/interconnect/interconnect_nameserver_table.cpp index 43419bf70d..a2071bbc80 100644 --- a/library/cpp/actors/interconnect/interconnect_nameserver_table.cpp +++ b/library/cpp/actors/interconnect/interconnect_nameserver_table.cpp @@ -10,57 +10,57 @@ namespace NActors { class TInterconnectNameserverTable: public TInterconnectNameserverBase<TInterconnectNameserverTable> { - TIntrusivePtr<TTableNameserverSetup> Config; + TIntrusivePtr<TTableNameserverSetup> Config; - public: - static constexpr EActivityType ActorActivityType() { + public: + static constexpr EActivityType ActorActivityType() { return NAMESERVICE; - } + } TInterconnectNameserverTable(const TIntrusivePtr<TTableNameserverSetup>& setup, ui32 /*resolvePoolId*/) : TInterconnectNameserverBase<TInterconnectNameserverTable>(&TInterconnectNameserverTable::StateFunc, setup->StaticNodeTable) - , Config(setup) - { - Y_VERIFY(Config->IsEntriesUnique()); - } + , Config(setup) + { + Y_VERIFY(Config->IsEntriesUnique()); + } - STFUNC(StateFunc) { - try { + STFUNC(StateFunc) { + try { switch (ev->GetTypeRewrite()) { HFunc(TEvInterconnect::TEvResolveNode, Handle); HFunc(TEvResolveAddress, Handle); HFunc(TEvInterconnect::TEvListNodes, Handle); HFunc(TEvInterconnect::TEvGetNode, Handle); - } - } catch (...) { - // on error - do nothing + } + } catch (...) { + // on error - do nothing } } - }; + }; IActor* CreateNameserverTable(const TIntrusivePtr<TTableNameserverSetup>& setup, ui32 poolId) { - return new TInterconnectNameserverTable(setup, poolId); + return new TInterconnectNameserverTable(setup, poolId); } - bool TTableNameserverSetup::IsEntriesUnique() const { - TVector<const TNodeInfo*> infos; - infos.reserve(StaticNodeTable.size()); - for (const auto& x : StaticNodeTable) - infos.push_back(&x.second); + bool TTableNameserverSetup::IsEntriesUnique() const { + TVector<const TNodeInfo*> infos; + infos.reserve(StaticNodeTable.size()); + for (const auto& x : StaticNodeTable) + infos.push_back(&x.second); auto CompareAddressLambda = - [](const TNodeInfo* left, const TNodeInfo* right) { - return left->Port == right->Port ? left->Address < right->Address : left->Port < right->Port; - }; + [](const TNodeInfo* left, const TNodeInfo* right) { + return left->Port == right->Port ? left->Address < right->Address : left->Port < right->Port; + }; Sort(infos, CompareAddressLambda); - for (ui32 idx = 1, end = StaticNodeTable.size(); idx < end; ++idx) { - const TNodeInfo* left = infos[idx - 1]; - const TNodeInfo* right = infos[idx]; + for (ui32 idx = 1, end = StaticNodeTable.size(); idx < end; ++idx) { + const TNodeInfo* left = infos[idx - 1]; + const TNodeInfo* right = infos[idx]; if (left->Address && left->Address == right->Address && left->Port == right->Port) - return false; - } + return false; + } auto CompareHostLambda = [](const TNodeInfo* left, const TNodeInfo* right) { @@ -76,8 +76,8 @@ namespace NActors { return false; } - return true; - } + return true; + } TActorId GetNameserviceActorId() { return TActorId(0, "namesvc"); |