jiajunwang commented on a change in pull request #422: Redefine the hard/soft 
constraints
URL: https://github.com/apache/helix/pull/422#discussion_r315425615
 
 

 ##########
 File path: 
helix-core/src/main/java/org/apache/helix/controller/rebalancer/waged/constraints/SoftConstraint.java
 ##########
 @@ -27,23 +27,31 @@
  * Evaluate a partition allocation proposal and return a score within the 
normalized range.
  * A higher score means the proposal is more preferred.
  */
-public interface SoftConstraint {
-  float MIN_SCORE = -1000.0f;
-  float MAX_SCORE = 1000.0f;
+public abstract class SoftConstraint {
+  private Type _type;
 
-  /**
-   * The scoring function returns a score between MINIMAL_SCORE and 
MAXIMUM_SCORE, which is then weighted by the
-   * individual normalized constraint weights.
-   * Each individual constraint will define the meaning of MINIMAL_SCORE to 
MAXIMUM_SCORE differently.
-   */
-  float assignmentScore(AssignableNode node, AssignableReplica rep, 
ClusterContext clusterContext);
+  public SoftConstraint(Type type) {
+    _type = type;
+  }
+
+  enum Type {
 
 Review comment:
   If we have 2 constraints with the same type defined, how to separately 
weight them?

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