jiajunwang commented on a change in pull request #639: Refine the WAGED
rebalancer to minimize the partial rebalance workload.
URL: https://github.com/apache/helix/pull/639#discussion_r352878618
##########
File path:
helix-core/src/main/java/org/apache/helix/controller/rebalancer/waged/model/ClusterModelProvider.java
##########
@@ -75,9 +154,24 @@ public static ClusterModel
generateClusterModel(ResourceControllerDataProvider d
// Check if the replicas need to be reassigned.
Map<String, Set<AssignableReplica>> allocatedReplicas =
new HashMap<>(); // <instanceName, replica set>
- Set<AssignableReplica> toBeAssignedReplicas =
- findToBeAssignedReplicas(replicaMap, clusterChanges, activeInstances,
- dataProvider.getLiveInstances().keySet(), bestPossibleAssignment,
allocatedReplicas);
+ Set<AssignableReplica> toBeAssignedReplicas;
+ switch (scopeType) {
+ case GLOBAL:
+ toBeAssignedReplicas =
findToBeAssignedReplicasByClusterChanges(replicaMap, activeInstances,
+ dataProvider.getLiveInstances().keySet(), clusterChanges,
bestPossibleAssignment,
+ allocatedReplicas);
+ break;
+ case PARTIAL:
+ // For partial rebalance, new partitions that are not in the Baseline
won't be rebalanced.
+ // Filter to remove the replicas that are not in the Baseline from the
replica map.
+ removeUnknownReplicas(replicaMap, baselineAssignment);
Review comment:
I like the name.
----------------------------------------------------------------
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]