You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/05/27 16:10:44 UTC

[GitHub] [ozone] umamaheswararao commented on a diff in pull request #3462: HDDS-6816. SCMContainerPlacementRackScatter should use original required node num to validate placement policy

umamaheswararao commented on code in PR #3462:
URL: https://github.com/apache/ozone/pull/3462#discussion_r883754671


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/placement/algorithms/SCMContainerPlacementRackScatter.java:
##########
@@ -98,6 +98,7 @@ public List<DatanodeDetails> chooseDatanodes(
       throws SCMException {
     Preconditions.checkArgument(nodesRequired > 0);
     metrics.incrDatanodeRequestCount(nodesRequired);

Review Comment:
   I think the changes looks good to me.
   To keep the better practice: How about we make all the passed params final. And have a separate counter before while loop?
   
   int nodesRequiredToChoose = nodesRequired;
   while (nodesRequiredToChoose > 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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org