jiajunwang commented on a change in pull request #492: Load soft constraint weight from resources/properties file URL: https://github.com/apache/helix/pull/492#discussion_r330330270
########## File path: helix-core/src/main/java/org/apache/helix/controller/rebalancer/waged/constraints/ConstraintBasedAlgorithmFactory.java ########## @@ -19,19 +19,34 @@ * under the License. */ +import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Properties; +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.ImmutableMap; +import com.google.common.collect.Maps; /** * The factory class to create an instance of {@link ConstraintBasedAlgorithm} */ public class ConstraintBasedAlgorithmFactory { + private static final String PARTITION_MOVEMENT_CONSTRAINT = "PartitionMovementConstraint"; + private static final Map<String, Float> MODEL; + + static { + MODEL = new HashMap<>(); Review comment: Let's have a default value set in case there are something wrong with the property file. ---------------------------------------------------------------- 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