ivandika3 commented on code in PR #7025:
URL: https://github.com/apache/ozone/pull/7025#discussion_r1703913533


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeStateManager.java:
##########
@@ -477,6 +478,22 @@ public List<DatanodeInfo> getDeadNodes() {
     return getNodes(null, NodeState.DEAD);
   }
 
+  public List<DatanodeInfo> getDecommissioningNodes() {
+    return getNodes(NodeOperationalState.DECOMMISSIONING, null);
+  }
+
+  public int getDecommissioningNodeCount() {
+    return getDecommissioningNodes().size();
+  }
+
+  public List<DatanodeInfo> getEnteringMaintenanceNodes() {
+    return getNodes(NodeOperationalState.ENTERING_MAINTENANCE, null);
+  }
+
+  public int getEnteringMaintenanceNodeCount() {
+    return getEnteringMaintenanceNodes().size();
+  }

Review Comment:
   Add Javadocs like the other methods.



##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/SCMNodeManager.java:
##########
@@ -1346,6 +1361,21 @@ public String getLabel() {
     }
   }
 
+  private enum StateStatics {

Review Comment:
   Nit: `StateStatistics`



##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/DatanodeInfo.java:
##########
@@ -227,6 +227,15 @@ public int getHealthyVolumeCount() {
     }
   }
 
+  public int getFailedVolumeCount() {

Review Comment:
   Add Java doc like the other methods.



##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeStateManager.java:
##########
@@ -501,6 +518,26 @@ public List<DatanodeInfo> getNodes(
     return nodeStateMap.getDatanodeInfos(opState, health);
   }
 
+  public List<DatanodeInfo> getVolumeFailuresNodes() {
+    List<DatanodeInfo> allNodes = nodeStateMap.getAllDatanodeInfos();
+    if (allNodes.size() < 1) {
+      return allNodes;
+    }
+
+    List<DatanodeInfo> failedVolumeNodes = new ArrayList<>();
+    for (DatanodeInfo dn : allNodes) {
+      if (dn.getFailedVolumeCount() > 0) {
+        failedVolumeNodes.add(dn);
+      }
+    }
+
+    return failedVolumeNodes;
+  }
+
+  public int getVolumeFailuresNodeCount() {

Review Comment:
   Javadoc



##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeStateManager.java:
##########
@@ -501,6 +518,26 @@ public List<DatanodeInfo> getNodes(
     return nodeStateMap.getDatanodeInfos(opState, health);
   }
 
+  public List<DatanodeInfo> getVolumeFailuresNodes() {
+    List<DatanodeInfo> allNodes = nodeStateMap.getAllDatanodeInfos();
+    if (allNodes.size() < 1) {
+      return allNodes;
+    }
+
+    List<DatanodeInfo> failedVolumeNodes = new ArrayList<>();
+    for (DatanodeInfo dn : allNodes) {
+      if (dn.getFailedVolumeCount() > 0) {
+        failedVolumeNodes.add(dn);
+      }
+    }
+
+    return failedVolumeNodes;

Review Comment:
   Nit: Can use Java Stream API filter for conciseness.



##########
hadoop-hdds/server-scm/src/main/resources/webapps/scm/scm-overview.html:
##########
@@ -51,6 +51,30 @@ <h2>Statistics</h2>
         <td>Standard Deviation</td>
         <td>{{statistics.nodes.usages.stdev}}</td>
     </tr>
+    <tr>
+        <th>Datanode State</th>
+        <th>Count</th>
+    </tr>
+    <tr>
+        <td>Healthy Nodes</td>
+        <td>{{statistics.nodes.state.healthy}}</td>
+    </tr>
+    <tr>
+        <td>Dead Nodes</td>
+        <td>{{statistics.nodes.state.dead}}</td>
+    </tr>
+    <tr>
+        <td>Decommissioning Nodes</td>
+        <td>{{statistics.nodes.state.decommissioning}}</td>
+    </tr>
+    <tr>
+        <td>Entering Maintenance Nodes</td>
+        <td>{{statistics.nodes.state.enteringmaintenance}}</td>
+    </tr>
+    <tr>
+        <td>Volume Failures Nodes</td>
+        <td>{{statistics.nodes.state.volumefailures}}</td>
+    </tr>

Review Comment:
   Let's separate this to another table.



##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeStateManager.java:
##########
@@ -501,6 +518,26 @@ public List<DatanodeInfo> getNodes(
     return nodeStateMap.getDatanodeInfos(opState, health);
   }
 
+  public List<DatanodeInfo> getVolumeFailuresNodes() {

Review Comment:
   Javadoc



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to