adoroszlai commented on code in PR #4209:
URL: https://github.com/apache/ozone/pull/4209#discussion_r1097671457
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestContainerOperations.java:
##########
@@ -132,4 +132,30 @@ public void testDatanodeUsageInfoCompatibility() throws
IOException {
.anyMatch(port -> REPLICATION.name().equals(port.getName())));
}
}
+
+ @Test
+ public void testDatanodeUsageInfoContainerCount() throws IOException {
+ DatanodeDetails dn = cluster.getStorageContainerManager()
+ .getScmNodeManager()
+ .getAllNodes()
+ .get(0);
+ dn.setCurrentVersion(0);
+
+ List<HddsProtos.DatanodeUsageInfoProto> usageInfoList =
+ storageClient.getDatanodeUsageInfo(
+ dn.getIpAddress(), dn.getUuidString());
+
+ assertEquals(1, usageInfoList.size());
+ assertEquals(0, usageInfoList.get(0).getContainerCount());
+
+ storageClient.createContainer(HddsProtos
+ .ReplicationType.STAND_ALONE, HddsProtos.ReplicationFactor
+ .ONE, OzoneConsts.OZONE);
+
+ usageInfoList = storageClient.getDatanodeUsageInfo(
+ dn.getIpAddress(), dn.getUuidString());
+
+ assertEquals(1, usageInfoList.size());
+ assertEquals(1, usageInfoList.get(0).getContainerCount());
+ }
Review Comment:
@djordje-mijatovic I don't think so. The cluster has 3 datanodes:
https://github.com/apache/ozone/blob/5a48c9e264ed9c2fdcb7ebaa0cd6d4eef8f63a86/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestContainerOperations.java#L67
The container may be created on any one of those 3 datanodes, but the usage
info is for one specific datanode. Thus container count may be 1 or 0.
--
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]