You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/06/10 20:00:26 UTC

[GitHub] [ozone] smengcl commented on a change in pull request #2321: HDDS-5314. Show number of Open vs Closed containers per Node in Recon UI

smengcl commented on a change in pull request #2321:
URL: https://github.com/apache/ozone/pull/2321#discussion_r649488357



##########
File path: hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/NodeEndpoint.java
##########
@@ -117,11 +123,26 @@ public Response getDatanodes() {
         }
       });
       try {
-        int containers = nodeManager.getContainers(datanode).size();
+        Set<ContainerID> allContainers = nodeManager.getContainers(datanode);
+
+        int openContainers = 0;
+        for (ContainerID containerID: allContainers) {
+          ContainerInfo containerInfo = reconContainerManager.getContainer(containerID);
+          if (containerInfo.isOpen()) {
+            ++openContainers;
+          }
+        }

Review comment:
       Could this loop be eliminated? There might be an existing count lying somewhere.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org