vivekratnavel commented on a change in pull request #2321:
URL: https://github.com/apache/ozone/pull/2321#discussion_r649418700
##########
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;
+ }
+ }
+
+ int containers = allContainers.size();
+ int closedContainers = containers - openContainers;
builder.withContainers(containers);
+ builder.withOpenContainers(openContainers);
+ builder.withClosedContainers(closedContainers);
} catch (NodeNotFoundException ex) {
LOG.warn("Cannot get containers, datanode {} not found.",
datanode.getUuid(), ex);
+ } catch (ContainerNotFoundException cnfe) {
+ LOG.warn("Cannot found container.", cnfe);
Review comment:
nit:
```suggestion
LOG.warn("Cannot find container.", cnfe);
```
--
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]