You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2022/11/21 19:54:34 UTC

[GitHub] [helix] jiajunwang commented on a diff in pull request #2189: WAGED pipeline change

jiajunwang commented on code in PR #2189:
URL: https://github.com/apache/helix/pull/2189#discussion_r1028462106


##########
helix-core/src/main/java/org/apache/helix/controller/rebalancer/waged/AssignmentMetadataStore.java:
##########
@@ -92,60 +93,79 @@ public synchronized Map<String, ResourceAssignment> getBestPossibleAssignment()
   }
 
   /**
-   * @return true if a new baseline was persisted.
+   * @param newAssignment
+   * @param path the path of the assignment record
+   * @param key  the key of the assignment in the record
    * @throws HelixException if the method failed to persist the baseline.
    */
-  public synchronized boolean persistBaseline(Map<String, ResourceAssignment> globalBaseline) {
-    return persistAssignment(globalBaseline, getBaseline(), _baselinePath, BASELINE_KEY);
+  private void persistAssignmentToMetadataStore(Map<String, ResourceAssignment> newAssignment, String path, String key)
+      throws HelixException {
+    // TODO: Make the write async?
+    // Persist to ZK
+    HelixProperty combinedAssignments = combineAssignments(key, newAssignment);
+    try {
+      _dataAccessor.compressedBucketWrite(path, combinedAssignments);
+    } catch (IOException e) {
+      // TODO: Improve failure handling
+      throw new HelixException(String.format("Failed to persist %s assignment to path %s", key, path), e);

Review Comment:
   I guess that means you can just remove it. Was it referring to some transactional support that on error, we should keep the data in a consistent way?



-- 
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: reviews-unsubscribe@helix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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