adoroszlai commented on code in PR #9439:
URL: https://github.com/apache/ozone/pull/9439#discussion_r2616175853


##########
hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/TestSCMDatanodeCapacityInfo.java:
##########
@@ -0,0 +1,90 @@
+package org.apache.hadoop.hdds.scm;

Review Comment:
   License header is needed in all files.  Example:
   
   
https://github.com/apache/ozone/blob/131eec0587adefa9131eadef046dd20dc7a0dda9/hadoop-hdds/config/src/main/java/org/apache/hadoop/hdds/conf/ConfigFileAppender.java#L1-L17



##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineManagerImpl.java:
##########
@@ -641,6 +641,7 @@ public boolean hasEnoughSpace(Pipeline pipeline, long 
containerSize) {
       if (!(node instanceof DatanodeInfo)) {
         node = nodeManager.getDatanodeInfo(node);
       }
+

Review Comment:
   nit: avoid whitespace-only change
   
   ```suggestion
   ```



##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/SCMNodeManager.java:
##########
@@ -1384,9 +1386,10 @@ private void nodeOutOfSpaceStatistics(Map<String, 
String> nodeStatics) {
         StorageUnit.BYTES);
 
     int nodeOutOfSpaceCount = (int) allNodes.parallelStream()
-        .filter(dn -> !hasEnoughSpace(dn, minRatisVolumeSizeBytes, 
containerSize, conf)
-            && !hasEnoughCommittedVolumeSpace(dn, blockSize))
-        .count();
+        .filter((dn) -> {
+          SCMDatanodeCapacityInfo info = checkSpace(dn, 
minRatisVolumeSizeBytes, containerSize, conf);
+          return !info.hasEnoughSpace() && !hasEnoughCommittedVolumeSpace(dn, 
blockSize);
+        }).count();

Review Comment:
   Let's keep the original code in this file since it doesn't need the 
`SCMDatanodeCapacityInfo`.



-- 
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]

Reply via email to