jiajunwang commented on a change in pull request #632: Asynchronously
calculating the Baseline
URL: https://github.com/apache/helix/pull/632#discussion_r360554397
##########
File path:
helix-core/src/main/java/org/apache/helix/controller/rebalancer/waged/AssignmentMetadataStore.java
##########
@@ -92,11 +92,14 @@ protected AssignmentMetadataStore(BucketDataAccessor
bucketDataAccessor, String
return _bestPossibleAssignment;
}
- public void persistBaseline(Map<String, ResourceAssignment> globalBaseline) {
+ /**
+ * @return true if a new baseline was persisted.
+ */
+ public boolean persistBaseline(Map<String, ResourceAssignment>
globalBaseline) {
// TODO: Make the write async?
// If baseline hasn't changed, skip writing to metadata store
if (compareAssignments(_globalBaseline, globalBaseline)) {
- return;
+ return false;
Review comment:
I just removed my previous comment about ZK updater. That was not right.
What @pkuwm mentioned in the other comment can help with it. But moving this
check outside is too verbose and complicated the store class design.
Let me know if you think the following behavior is acceptable or not:
Write failure -> throws exception
Write skipped -> return false
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]