You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@helix.apache.org by GitBox <gi...@apache.org> on 2019/07/25 18:32:29 UTC

[GitHub] [helix] i3wangyi commented on a change in pull request #348: Adding the configuration items of the WAGED rebalancer.

i3wangyi commented on a change in pull request #348: Adding the configuration items of the WAGED rebalancer.
URL: https://github.com/apache/helix/pull/348#discussion_r307440208
 
 

 ##########
 File path: helix-core/src/main/java/org/apache/helix/model/InstanceConfig.java
 ##########
 @@ -505,6 +505,46 @@ public void setMaxConcurrentTask(int maxConcurrentTask) {
     _record.setIntField(InstanceConfigProperty.MAX_CONCURRENT_TASK.name(), maxConcurrentTask);
   }
 
+  /**
+   * Get the instance capacity information from the map fields
+   * @return data map if it exists, or empty map
+   */
+  public Map<String, Integer> getInstanceCapacityMap() {
+    Map<String, String> capacityData = _record.getMapField(InstanceConfigProperty.INSTANCE_CAPACITY_MAP.name());
+    Map<String, Integer> capacityDataMap = new HashMap<>();
+
+    if (capacityData != null && !capacityData.isEmpty()) {
 
 Review comment:
   Really suggest Java8 style, less error-prone and easier to read. Same applies to the rest of conversions here and there

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