narendly commented on a change in pull request #520: Refactoring soft constraints to simply the algorithm and fix potential issues. URL: https://github.com/apache/helix/pull/520#discussion_r337820908
########## File path: helix-core/src/main/java/org/apache/helix/controller/rebalancer/waged/constraints/InstancePartitionsCountConstraint.java ########## @@ -29,20 +29,13 @@ * Discourage the assignment if the instance's occupancy rate is above average * The normalized score will be within [0, 1] */ -class InstancePartitionsCountConstraint extends SoftConstraint { - private static final float MAX_SCORE = 1f; - private static final float MIN_SCORE = 0f; - - InstancePartitionsCountConstraint() { - super(MAX_SCORE, MIN_SCORE); - } +class InstancePartitionsCountConstraint extends UsageSoftConstraint { @Override protected float getAssignmentScore(AssignableNode node, AssignableReplica replica, ClusterContext clusterContext) { - float doubleEstimatedMaxPartitionCount = 2 * clusterContext.getEstimatedMaxPartitionCount(); + float estimatedMaxPartitionCount = clusterContext.getEstimatedMaxPartitionCount(); Review comment: Q: so we don't have to double it because we increased the weight? ---------------------------------------------------------------- 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