jiajunwang commented on a change in pull request #520: Refactor soft
constraints to simply the algorithm and fix potential issues.
URL: https://github.com/apache/helix/pull/520#discussion_r339246574
##########
File path:
helix-core/src/main/java/org/apache/helix/controller/rebalancer/waged/model/ClusterContext.java
##########
@@ -55,12 +55,15 @@
/**
* Construct the cluster context based on the current instance status.
* @param replicaSet All the partition replicas that are managed by the
rebalancer
- * @param instanceCount The count of all the active instances that can be
used to host partitions.
+ * @param nodeSet All the active nodes that are managed by the rebalancer
*/
- ClusterContext(Set<AssignableReplica> replicaSet, int instanceCount,
+ ClusterContext(Set<AssignableReplica> replicaSet, Set<AssignableNode>
nodeSet,
Map<String, ResourceAssignment> baselineAssignment, Map<String,
ResourceAssignment> bestPossibleAssignment) {
+ int instanceCount = nodeSet.size();
int totalReplicas = 0;
int totalTopStateReplicas = 0;
+ Map<String, Integer> totalUsage = new HashMap<>();
+ Map<String, Integer> totalCapacity = new HashMap<>();
for (Map.Entry<String, List<AssignableReplica>> entry : replicaSet.stream()
.collect(Collectors.groupingBy(AssignableReplica::getResourceName))
Review comment:
In short, this is for calculating _estimatedMaxPartitionByResource.
----------------------------------------------------------------
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]