StevenLuMT commented on code in PR #3723:
URL: https://github.com/apache/bookkeeper/pull/3723#discussion_r1059266434


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/RackawareEnsemblePlacementPolicyImpl.java:
##########
@@ -444,6 +440,33 @@ protected PlacementResult<List<BookieId>> 
newEnsembleInternal(
         }
     }
 
+    private void selectBookieNode(int ensembleSize, Set<Node> excludeNodes,
+            RRTopologyAwareCoverageEnsemble ensemble, boolean 
pickCommonRackFirst)
+            throws BKNotEnoughBookiesException {
+        BookieNode prevNode = null;
+
+        for (int i = 0; i < ensembleSize; i++) {
+            String curRack;
+            if (null == prevNode) {
+                if ((null == localNode) || 
defaultRack.equals(localNode.getNetworkLocation())) {
+                    curRack = NodeBase.ROOT;
+                } else {
+                    curRack = localNode.getNetworkLocation();
+                }
+            } else {
+                curRack = "~" + prevNode.getNetworkLocation();

Review Comment:
   "~" is the magic string



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

Reply via email to