xyuanlu commented on code in PR #2661:
URL: https://github.com/apache/helix/pull/2661#discussion_r1377116563


##########
helix-core/src/main/java/org/apache/helix/controller/rebalancer/DelayedAutoRebalancer.java:
##########
@@ -158,40 +166,56 @@ public IdealState computeNewIdealState(String 
resourceName,
             stateCountMap, maxPartition);
 
     // sort node lists to ensure consistent preferred assignments
-    List<String> allNodeList = new ArrayList<>(allNodes);
+    List<String> allNodeList = new ArrayList<>(allNodesDeduped);
     // We will not assign partition to instances with evacuation and wap-out 
tag.

Review Comment:
   Please help fix typo. THX :D



##########
helix-core/src/main/java/org/apache/helix/controller/rebalancer/DelayedAutoRebalancer.java:
##########
@@ -113,9 +114,16 @@ public IdealState computeNewIdealState(String resourceName,
       allNodes = clusterData.getAllInstances();
     }
 
+    Set<String> allNodesDeduped = 
DelayedRebalanceUtil.filterOutInstancesWithDuplicateLogicalIds(

Review Comment:
   Do you think we could integrate the logic into `getEnabledLiveInstances`?  
   Probably with better name when we work on consolidating operation and 
disable/enable in one enum and we redesign all the getters. 



##########
helix-core/src/main/java/org/apache/helix/controller/dataproviders/BaseControllerDataProvider.java:
##########
@@ -617,6 +625,24 @@ public Set<String> getDisabledInstances() {
     return Collections.unmodifiableSet(_disabledInstanceSet);
   }
 
+  /**
+   * Get all swapping instance pairs.
+   *
+   * @return a map of SWAP_OUT instanceNames and their corresponding SWAP_IN 
instanceNames.
+   */
+  public Map<String, String> getSwapOutToSwapInInstancePairs() {
+    return 
Collections.unmodifiableMap(_swapOutInstanceNameToSwapInInstanceName);
+  }
+
+  /**
+   * Get all the enabled and live SWAP_IN instances.
+   *
+   * @return a set of SWAP_IN instanceNames that have a corresponding SWAP_OUT 
instance.
+   */
+  public Set<String> getEnabledLiveSwapInInstanceNames() {

Review Comment:
   Question: when we tag SWAP_IN instanceNames, don't we already check if there 
is already an paring SWAP_OUT instance? 



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