sumitagrawl commented on code in PR #9339:
URL: https://github.com/apache/ozone/pull/9339#discussion_r2553071617
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/SCMNodeManager.java:
##########
@@ -1360,6 +1367,22 @@ 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 containerSize = (long)
conf.getStorageSize(ScmConfigKeys.OZONE_SCM_CONTAINER_SIZE,
+ ScmConfigKeys.OZONE_SCM_CONTAINER_SIZE_DEFAULT, StorageUnit.BYTES);
+
+ for (DatanodeInfo dnInfo : allNodes) {
+ if (!SCMCommonPlacementPolicy.hasEnoughSpace(dnInfo, blockSize,
containerSize, conf)) {
+ readOnlyCount++;
Review Comment:
datanode is available for write if committed space is available, >
SCM_BLOCK_SIZE
and metadata space must be followed with this also to have space.
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/SCMNodeManager.java:
##########
@@ -1360,6 +1367,22 @@ 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,
Review Comment:
metadata size is using below logic,
this.minRatisVolumeSizeBytes = (long) this.conf.getStorageSize(
ScmConfigKeys.OZONE_DATANODE_RATIS_VOLUME_FREE_SPACE_MIN,
ScmConfigKeys.OZONE_DATANODE_RATIS_VOLUME_FREE_SPACE_MIN_DEFAULT,
StorageUnit.BYTES);
--
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]