sodonnel commented on code in PR #3744:
URL: https://github.com/apache/ozone/pull/3744#discussion_r971068975


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/placement/algorithms/SCMContainerPlacementRackScatter.java:
##########
@@ -76,85 +77,22 @@ public SCMContainerPlacementRackScatter(final NodeManager 
nodeManager,
     this.metrics = metrics;
   }
 
-  /**
-   * Called by SCM to choose datanodes.
-   *
-   *
-   * @param excludedNodes - list of the datanodes to exclude.
-   * @param favoredNodes - list of nodes preferred. This is a hint to the
-   *                     allocator, whether the favored nodes will be used
-   *                     depends on whether the nodes meets the allocator's
-   *                     requirement.
-   * @param nodesRequiredToChoose - number of datanodes required.
-   * @param dataSizeRequired - size required for the container.
-   * @param metadataSizeRequired - size required for Ratis metadata.
-   * @return List of datanodes.
-   * @throws SCMException  SCMException
-   */
-  @Override
-  protected List<DatanodeDetails> chooseDatanodesInternal(
-      final List<DatanodeDetails> excludedNodes,
-      final List<DatanodeDetails> favoredNodes,
-      final int nodesRequiredToChoose, final long metadataSizeRequired,
-      final long dataSizeRequired) throws SCMException {
-    if (nodesRequiredToChoose <= 0) {
-      String errorMsg = "num of nodes required to choose should bigger" +
-          "than 0, but the given num is " + nodesRequiredToChoose;
-      throw new SCMException(errorMsg, null);
-    }
-    metrics.incrDatanodeRequestCount(nodesRequiredToChoose);
-    int nodesRequired = nodesRequiredToChoose;
-    int excludedNodesCount = excludedNodes == null ? 0 : excludedNodes.size();
-    List<Node> availableNodes = networkTopology.getNodes(
-        networkTopology.getMaxLevel());
-    int totalNodesCount = availableNodes.size();
-    if (excludedNodes != null) {
-      availableNodes.removeAll(excludedNodes);
+  public Set<DatanodeDetails> chooseNodesFromRacks(List<Node> racks,

Review Comment:
   There is a lot of change in this class - is this method copied and moved 
from already existing code, or is the logic here new?



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