sodonnel commented on a change in pull request #2497:
URL: https://github.com/apache/ozone/pull/2497#discussion_r696351712



##########
File path: 
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/placement/algorithms/SCMContainerPlacementRackScatter.java
##########
@@ -205,8 +206,16 @@ public SCMContainerPlacementRackScatter(final NodeManager 
nodeManager,
         retryCount = 0;
       }
     }
-
-    return Arrays.asList(chosenNodes.toArray(new DatanodeDetails[0]));
+    List<DatanodeDetails> results = Arrays.asList(
+        chosenNodes.toArray(new DatanodeDetails[0]));
+    ContainerPlacementStatus placementStatus =
+        validateContainerPlacement(results, nodesRequired);
+    if (!placementStatus.isPolicySatisfied()) {
+      LOG.warn("ContainerPlacementPolicy not met, currentRacks is " +
+          placementStatus.actualPlacementCount() + ", desired racks is " +
+          placementStatus.expectedPlacementCount() + ".");

Review comment:
       Looks good, but can you change the log to use placeholders rather than 
concatenation:
   
   ```
         LOG.warn("ContainerPlacementPolicy not met, currentRacks is {}, 
desired racks is {},", placementStatus.actualPlacementCount(), 
placementStatus.expectedPlacementCount());
   ```




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