narendly commented on a change in pull request #466: Integrate the WAGED 
rebalancer with all the related components.
URL: https://github.com/apache/helix/pull/466#discussion_r323535310
 
 

 ##########
 File path: 
helix-core/src/main/java/org/apache/helix/controller/rebalancer/waged/WagedRebalancer.java
 ##########
 @@ -349,4 +338,61 @@ private IdealState 
generateIdealStateWithAssignment(String resourceName,
     }
     return preferenceList;
   }
+
+  private Map<String, ResourceAssignment> getBaseline(
+      AssignmentMetadataStore assignmentMetadataStore, CurrentStateOutput 
currentStateOutput,
+      Set<String> resources) throws HelixRebalanceException {
+    Map<String, ResourceAssignment> currentBaseline;
+    try {
+      currentBaseline = assignmentMetadataStore.getBaseline();
+    } catch (HelixException hex) {
+      LOG.warn("Failed to get the current baseline assignment. Use the current 
states instead",
+          hex);
+      currentBaseline = getCurrentStateAssingment(currentStateOutput, 
resources);
+    } catch (Exception ex) {
+      throw new HelixRebalanceException(
+          "Failed to get the current baseline assignment because of unexpected 
error.",
+          HelixRebalanceException.Type.INVALID_REBALANCER_STATUS, ex);
+    }
+    return currentBaseline;
+  }
+
+  private Map<String, ResourceAssignment> getBestPossibleAssignment(
+      AssignmentMetadataStore assignmentMetadataStore, CurrentStateOutput 
currentStateOutput,
+      Set<String> resources) throws HelixRebalanceException {
+    Map<String, ResourceAssignment> currentBestAssignment;
+    try {
+      // TODO fix the deserialize
 
 Review comment:
   Isn't it because you never wrote to bestPossibleAssignment? Didn't we agree 
that you'll handle it in the rebalancer? @jiajunwang Note that my original 
design was to return an empty map here if nothing has been persisted in ZK 
previously.

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