aboutsummaryrefslogtreecommitdiffstats
path: root/ydb/core/cms/cluster_info.cpp
diff options
context:
space:
mode:
authorArtem Zuikov <chertus@gmail.com>2022-02-10 16:46:27 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:27 +0300
commitd23c9e2333524245de2f721e04136f51c31411ef (patch)
tree841eba1726e3db80e41401053939b3f5ef86ab2d /ydb/core/cms/cluster_info.cpp
parent6f0f263753da4db2175d8b66d02619f6a476d319 (diff)
downloadydb-d23c9e2333524245de2f721e04136f51c31411ef.tar.gz
Restoring authorship annotation for Artem Zuikov <chertus@gmail.com>. Commit 1 of 2.
Diffstat (limited to 'ydb/core/cms/cluster_info.cpp')
-rw-r--r--ydb/core/cms/cluster_info.cpp106
1 files changed, 53 insertions, 53 deletions
diff --git a/ydb/core/cms/cluster_info.cpp b/ydb/core/cms/cluster_info.cpp
index a1dc8a0b95..d53613c6a8 100644
--- a/ydb/core/cms/cluster_info.cpp
+++ b/ydb/core/cms/cluster_info.cpp
@@ -144,21 +144,21 @@ void TLockableItem::DebugLocksDump(IOutputStream &ss, const TString &prefix) con
}
void TNodeInfo::MigrateOldInfo(const TLockableItem &old)
-{
+{
TLockableItem::MigrateOldInfo(old);
- if (auto * oldNode = dynamic_cast<const TNodeInfo *>(&old)) {
- if (oldNode->State == UP) {
- PreviousTenant = oldNode->Tenant;
- } else {
- PreviousTenant = oldNode->PreviousTenant;
- }
-
- if (!HasTenantInfo || State != UP)
- Tenant = PreviousTenant;
- HasTenantInfo = true;
- }
-}
-
+ if (auto * oldNode = dynamic_cast<const TNodeInfo *>(&old)) {
+ if (oldNode->State == UP) {
+ PreviousTenant = oldNode->Tenant;
+ } else {
+ PreviousTenant = oldNode->PreviousTenant;
+ }
+
+ if (!HasTenantInfo || State != UP)
+ Tenant = PreviousTenant;
+ HasTenantInfo = true;
+ }
+}
+
TString TPDiskInfo::ItemName() const
{
return Sprintf("PDisk %s", PDiskId.ToString().data());
@@ -370,28 +370,28 @@ void TClusterInfo::ClearNode(ui32 nodeId)
node.State = NKikimrCms::DOWN;
}
-void TClusterInfo::ApplyInitialNodeTenants(const TActorContext& ctx, const THashMap<ui32, TString>& nodeTenants)
-{
- for (const auto& pr : nodeTenants) {
- ui32 nodeId = pr.first;
- TString tenant = pr.second;
-
- if (!HasNode(nodeId)) {
- LOG_ERROR(ctx, NKikimrServices::CMS,
- "Forgoten node tenant '%s' at node %" PRIu32 ". Node is unknown.",
+void TClusterInfo::ApplyInitialNodeTenants(const TActorContext& ctx, const THashMap<ui32, TString>& nodeTenants)
+{
+ for (const auto& pr : nodeTenants) {
+ ui32 nodeId = pr.first;
+ TString tenant = pr.second;
+
+ if (!HasNode(nodeId)) {
+ LOG_ERROR(ctx, NKikimrServices::CMS,
+ "Forgoten node tenant '%s' at node %" PRIu32 ". Node is unknown.",
tenant.data(), nodeId);
- continue;
- }
-
- TNodeInfo& node = NodeRef(nodeId);
- node.PreviousTenant = tenant;
-
- LOG_DEBUG(ctx, NKikimrServices::CMS,
- "Initial node tenant '%s' at node %" PRIu32,
+ continue;
+ }
+
+ TNodeInfo& node = NodeRef(nodeId);
+ node.PreviousTenant = tenant;
+
+ LOG_DEBUG(ctx, NKikimrServices::CMS,
+ "Initial node tenant '%s' at node %" PRIu32,
tenant.data(), nodeId);
- }
-}
-
+ }
+}
+
void TClusterInfo::AddTablet(ui32 nodeId, const NKikimrWhiteboard::TTabletStateInfo &info)
{
if (!HasNode(nodeId))
@@ -533,27 +533,27 @@ void TClusterInfo::AddBSGroup(const NKikimrBlobStorage::TBaseConfig::TGroup &inf
BSGroups[bsgroup.GroupId] = std::move(bsgroup);
}
-void TClusterInfo::AddNodeTenants(ui32 nodeId, const NKikimrTenantPool::TTenantPoolStatus &info)
-{
- if (!HasNode(nodeId))
- return;
-
- auto& node = NodeRef(nodeId);
- TString nodeTenant;
-
- for (const auto& slot : info.GetSlots()) {
- TString slotTenant = slot.GetAssignedTenant();
- Y_VERIFY(slotTenant.empty() || nodeTenant.empty() || slotTenant == nodeTenant);
- if (!slotTenant.empty())
- nodeTenant = slotTenant;
- }
-
- node.Tenant = nodeTenant;
- node.HasTenantInfo = true;
+void TClusterInfo::AddNodeTenants(ui32 nodeId, const NKikimrTenantPool::TTenantPoolStatus &info)
+{
+ if (!HasNode(nodeId))
+ return;
+
+ auto& node = NodeRef(nodeId);
+ TString nodeTenant;
+
+ for (const auto& slot : info.GetSlots()) {
+ TString slotTenant = slot.GetAssignedTenant();
+ Y_VERIFY(slotTenant.empty() || nodeTenant.empty() || slotTenant == nodeTenant);
+ if (!slotTenant.empty())
+ nodeTenant = slotTenant;
+ }
+
+ node.Tenant = nodeTenant;
+ node.HasTenantInfo = true;
TenantToNodeId.emplace(nodeTenant, nodeId);
-}
-
+}
+
void TClusterInfo::AddNodeTempLock(ui32 nodeId, const NKikimrCms::TAction &action)
{
auto &node = NodeRef(nodeId);