Skip to content

Commit c56118c

Browse files
authored
add no-rack no-dc flags to nodes response (#6004)
1 parent 6cf4565 commit c56118c

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

ydb/core/viewer/json_nodes.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -749,6 +749,9 @@ class TJsonNodes : public TViewerPipeClient<TJsonNodes> {
749749
}
750750
}
751751

752+
bool noDC = true;
753+
bool noRack = true;
754+
752755
for (TNodeId nodeId : NodeIds) {
753756
if (!CheckNodeFilters(nodeId)) {
754757
continue;
@@ -799,6 +802,19 @@ class TJsonNodes : public TViewerPipeClient<TJsonNodes> {
799802
}
800803
}
801804
}
805+
806+
if (!nodeInfo.GetSystemState().GetLocation().GetDataCenter().empty()) {
807+
noDC = false;
808+
}
809+
if (nodeInfo.GetSystemState().GetSystemLocation().GetDataCenter() != 0) {
810+
noDC = false;
811+
}
812+
if (!nodeInfo.GetSystemState().GetLocation().GetRack().empty()) {
813+
noRack = false;
814+
}
815+
if (nodeInfo.GetSystemState().GetSystemLocation().GetRack() != 0) {
816+
noRack = false;
817+
}
802818
}
803819

804820
if (!SortedNodeList) {
@@ -883,6 +899,12 @@ class TJsonNodes : public TViewerPipeClient<TJsonNodes> {
883899
if (MaximumDisksPerNode.has_value()) {
884900
result.SetMaximumDisksPerNode(MaximumDisksPerNode.value());
885901
}
902+
if (noDC) {
903+
result.SetNoDC(true);
904+
}
905+
if (noRack) {
906+
result.SetNoRack(true);
907+
}
886908

887909
TStringStream json;
888910
TProtoToJson::ProtoToJson(json, result, JsonSettings);

ydb/core/viewer/protos/viewer.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,8 @@ message TNodesInfo {
439439
optional uint64 TotalNodes = 3;
440440
optional uint64 FoundNodes = 4;
441441
optional uint64 MaximumDisksPerNode = 5;
442+
optional bool NoDC = 6;
443+
optional bool NoRack = 7;
442444
}
443445

444446
enum ENodeType {

0 commit comments

Comments
 (0)