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:
[email protected]



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

Reply via email to