narendly commented on a change in pull request #514: The WAGED rebalancer 
returns the previously calculated assignment on calculation failure
URL: https://github.com/apache/helix/pull/514#discussion_r337308669
 
 

 ##########
 File path: 
helix-core/src/main/java/org/apache/helix/controller/rebalancer/waged/WagedRebalancer.java
 ##########
 @@ -593,37 +610,32 @@ private void 
delayedRebalanceSchedule(ResourceControllerDataProvider clusterData
    * @param clusterData the cluster data cache.
    * @param resourceMap the rebalanaced resource map.
    * @param clusterChanges the detected cluster changes that triggeres the 
rebalance.
-   * @param resourceStatePriorityMap the state priority map for each resource.
    * @param baseline the baseline assignment
    */
   private void applyRebalanceOverwrite(Map<String, IdealState> idealStateMap,
       ResourceControllerDataProvider clusterData, Map<String, Resource> 
resourceMap,
       Map<HelixConstants.ChangeType, Set<String>> clusterChanges,
-      Map<String, Map<String, Integer>> resourceStatePriorityMap,
       Map<String, ResourceAssignment> baseline) throws HelixRebalanceException 
{
     Set<String> enabledLiveInstances = clusterData.getEnabledLiveInstances();
     // Note that the calculation used the baseline as the input only. This is 
for minimizing
     // unnecessary partition movement.
-    Map<String, ResourceAssignment> activeAssignment = 
calculateAssignment(clusterData,
-        clusterChanges, resourceMap, enabledLiveInstances, 
Collections.emptyMap(), baseline);
+    Map<String, IdealState> activeIdealStates = 
convertResourceAssignment(clusterData,
+        calculateAssignment(clusterData, clusterChanges, resourceMap, 
enabledLiveInstances,
+            Collections.emptyMap(), baseline));
     for (String resourceName : idealStateMap.keySet()) {
       IdealState is = idealStateMap.get(resourceName);
-      if (!activeAssignment.containsKey(resourceName)) {
+      if (!activeIdealStates.containsKey(resourceName)) {
         throw new HelixRebalanceException(
             "Failed to calculate the complete partition assignment with all 
active nodes. Cannot find the resource assignment for "
-                + resourceName,
-            HelixRebalanceException.Type.FAILED_TO_CALCULATE);
+                + resourceName, 
HelixRebalanceException.Type.FAILED_TO_CALCULATE);
       }
+      IdealState newActiveIdealState = activeIdealStates.get(resourceName);
 
 Review comment:
   What is the difference among the following 3?
   
   newActiveIdealState
   currentIdealState
   is (from idealStateMap).
   
   Could you define them clearly as an inline comment please?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@helix.apache.org
For additional commands, e-mail: reviews-h...@helix.apache.org

Reply via email to