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_r337824637
 
 

 ##########
 File path: 
helix-core/src/main/java/org/apache/helix/controller/rebalancer/waged/constraints/ResourceTopStateAntiAffinityConstraint.java
 ##########
 @@ -28,26 +28,17 @@
  * The higher number the number of top state partitions assigned to the 
instance, the lower the
  * score, vice versa.
  */
-class ResourceTopStateAntiAffinityConstraint extends SoftConstraint {
-  private static final float MAX_SCORE = 1f;
-  private static final float MIN_SCORE = 0f;
-
-  ResourceTopStateAntiAffinityConstraint() {
-    super(MAX_SCORE, MIN_SCORE);
-  }
-
+class ResourceTopStateAntiAffinityConstraint extends UsageSoftConstraint {
   @Override
   protected float getAssignmentScore(AssignableNode node, AssignableReplica 
replica,
       ClusterContext clusterContext) {
     if (!replica.isReplicaTopState()) {
-      return (getMaxScore() + getMinScore()) / 2.0f;
+      return 0;
 
 Review comment:
   No smoothing?

----------------------------------------------------------------
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

Reply via email to