narendly commented on a change in pull request #511: More strict partition weight validation while creating the cluster model. URL: https://github.com/apache/helix/pull/511#discussion_r334764101
########## File path: helix-core/src/main/java/org/apache/helix/model/ClusterConfig.java ########## @@ -705,49 +706,80 @@ public void setInstanceCapacityKeys(List<String> capacityKeys) { /** * Get the default instance capacity information from the map fields. + * * @return data map if it exists, or empty map */ public Map<String, Integer> getDefaultInstanceCapacityMap() { - Map<String, String> capacityData = - _record.getMapField(ClusterConfigProperty.DEFAULT_INSTANCE_CAPACITY_MAP.name()); - - if (capacityData != null) { - return capacityData.entrySet().stream().collect( - Collectors.toMap(entry -> entry.getKey(), entry -> Integer.parseInt(entry.getValue()))); - } - return Collections.emptyMap(); + return getDefaultCapacityMap(ClusterConfigProperty.DEFAULT_INSTANCE_CAPACITY_MAP); } /** * Set the default instance capacity information with an Integer mapping. + * * @param capacityDataMap - map of instance capacity data * @throws IllegalArgumentException - when any of the data value is a negative number or when the map is empty - * - * This information is required by the global rebalancer. + * This information is required by the global rebalancer. * @see <a href="Rebalance Algorithm"> - * https://github.com/apache/helix/wiki/Design-Proposal---Weight-Aware-Globally-Even-Distribute-Rebalancer#rebalance-algorithm-adapter - * </a> + * https://github.com/apache/helix/wiki/Design-Proposal---Weight-Aware-Globally-Even-Distribute-Rebalancer#rebalance-algorithm-adapter + * </a> * If the instance capacity is not configured in neither Instance Config nor Cluster Config, the * cluster topology is considered invalid. So the rebalancer may stop working. Review comment: Is this description valid anymore? We aren't throwing an exception anymore. ---------------------------------------------------------------- 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