You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2019/10/23 05:55:22 UTC

[GitHub] [helix] jiajunwang commented on a change in pull request #520: Refactoring soft constraints to simply the algorithm and fix potential issues.

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_r337860395
 
 

 ##########
 File path: helix-core/src/main/java/org/apache/helix/controller/rebalancer/waged/constraints/ConstraintBasedAlgorithmFactory.java
 ##########
 @@ -24,31 +24,25 @@
 import java.util.Map;
 import java.util.Properties;
 
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Maps;
 import org.apache.helix.HelixManagerProperties;
 import org.apache.helix.SystemPropertyKeys;
 import org.apache.helix.controller.rebalancer.waged.RebalanceAlgorithm;
 import org.apache.helix.model.ClusterConfig;
 
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Maps;
-
 /**
  * The factory class to create an instance of {@link ConstraintBasedAlgorithm}
  */
 public class ConstraintBasedAlgorithmFactory {
-  // Evenness constraints tend to score within a smaller range.
-  // In order to let their scores cause enough difference in the final evaluation result, we need to
-  // enlarge the overall weight of the evenness constraints compared with the movement constraint.
-  // TODO: Tune or make the following factor configurable.
-  private static final int EVENNESS_PREFERENCE_NORMALIZE_FACTOR = 50;
   private static final Map<String, Float> MODEL = new HashMap<String, Float>() {
     {
       // The default setting
       put(PartitionMovementConstraint.class.getSimpleName(), 1f);
-      put(InstancePartitionsCountConstraint.class.getSimpleName(), 0.3f);
-      put(ResourcePartitionAntiAffinityConstraint.class.getSimpleName(), 0.1f);
-      put(ResourceTopStateAntiAffinityConstraint.class.getSimpleName(), 0.1f);
-      put(MaxCapacityUsageInstanceConstraint.class.getSimpleName(), 0.5f);
+      put(InstancePartitionsCountConstraint.class.getSimpleName(), 5f);
+      put(ResourcePartitionAntiAffinityConstraint.class.getSimpleName(), 5f);
+      put(ResourceTopStateAntiAffinityConstraint.class.getSimpleName(), 15f);
+      put(MaxCapacityUsageInstanceConstraint.class.getSimpleName(), 30f);
 
 Review comment:
   Not tuned. Manually set intuitively. Maybe bad. It is configurable with a resource file.
   But we will need to tune a default set of values.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org