jiajunwang 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_r337860562
##########
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:
No, I'm trying to remove all the "magic" and hardcoded parts.
----------------------------------------------------------------
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]