ashishkumar50 commented on code in PR #9339:
URL: https://github.com/apache/ozone/pull/9339#discussion_r2562989472
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/SCMNodeManager.java:
##########
@@ -1360,6 +1369,57 @@ private void nodeSpaceStatistics(Map<String, String>
nodeStatics) {
nodeStatics.put(SpaceStatistics.NON_SCM_USED.getLabel(), nonScmUsed);
}
+ private void nodeReadOnlyStatistics(Map<String, String> nodeStatics) {
+ List<DatanodeInfo> allNodes = getAllNodes();
+ int readOnlyCount = 0;
+ long blockSize = (long) conf.getStorageSize(
+ OzoneConfigKeys.OZONE_SCM_BLOCK_SIZE,
+ OzoneConfigKeys.OZONE_SCM_BLOCK_SIZE_DEFAULT,
+ StorageUnit.BYTES);
+ long minRatisVolumeSizeBytes = (long) conf.getStorageSize(
+ ScmConfigKeys.OZONE_DATANODE_RATIS_VOLUME_FREE_SPACE_MIN,
+ ScmConfigKeys.OZONE_DATANODE_RATIS_VOLUME_FREE_SPACE_MIN_DEFAULT,
+ StorageUnit.BYTES);
+ long containerSize = (long) conf.getStorageSize(
+ ScmConfigKeys.OZONE_SCM_CONTAINER_SIZE,
+ ScmConfigKeys.OZONE_SCM_CONTAINER_SIZE_DEFAULT,
+ StorageUnit.BYTES);
+
+ for (DatanodeInfo dnInfo : allNodes) {
+ boolean hasWritableContainer = hasContainerWithSpace(dnInfo, blockSize,
containerSize);
+ if (hasWritableContainer) {
Review Comment:
This compute can be slow in large cluster with many DNs full(no open
container). Can you use `parallelStream` here to speed up the processing.
--
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]