JacksonYao287 commented on a change in pull request #2944:
URL: https://github.com/apache/ozone/pull/2944#discussion_r814632169



##########
File path: 
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/SCMNodeManager.java
##########
@@ -1008,6 +1009,33 @@ public void addDatanodeCommand(UUID dnId, SCMCommand 
command) {
     this.commandQueue.addCommand(dnId, command);
   }
 
+  /**
+   * send refresh command to all the healthy datanodes to refresh
+   * volume usage info immediately.
+   */
+  @Override
+  public void refreshAllHealthyDnUsageInfo() {
+    RefreshVolumeUsageCommand refreshVolumeUsageCommand =
+        new RefreshVolumeUsageCommand();
+    try {
+      refreshVolumeUsageCommand.setTerm(scmContext.getTermOfLeader());
+    } catch (NotLeaderException nle) {
+      LOG.warn("Skip sending refreshVolumeUsage command,"
+          + " since current SCM is not leader.", nle);
+      return;
+    }
+    getAllNodes().stream().filter(dn -> {
+      boolean isHealthy = false;
+      try {
+        isHealthy = getNodeStatus(dn).isHealthy();
+      } catch (NodeNotFoundException nnfe) {
+        LOG.warn("datanode {} is not found", dn.getIpAddress());
+      }
+      return isHealthy;

Review comment:
       thanks for the comment , will fix it




-- 
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