Github user revans2 commented on a diff in the pull request:

    https://github.com/apache/storm/pull/2385#discussion_r149164648
  
    --- Diff: 
storm-server/src/main/java/org/apache/storm/scheduler/resource/ResourceUtils.java
 ---
    @@ -238,4 +277,57 @@ public static double sum(Collection<Double> list) {
         public static double avg(Collection<Double> list) {
             return sum(list) / list.size();
         }
    +
    +    /**
    +     * Normalizes a supervisor resource map or topology details map's keys 
to universal resource names.
    +     * @param resourceMap resource map of either Supervisor or Topology
    +     * @return the resource map with common resource names
    +     */
    +    public static Map<String, Double> normalizedResourceMap(Map<String, 
Double> resourceMap) {
    +        Map<String, Double> result = new HashMap();
    +
    +        result.putAll(resourceMap);
    +        for(Map.Entry entry: resourceMap.entrySet()) {
    --- End diff --
    
    nit: space after the for.


---

Reply via email to