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

    https://github.com/apache/storm/pull/2774#discussion_r204981713
  
    --- Diff: 
storm-server/src/main/java/org/apache/storm/scheduler/resource/strategies/scheduling/BaseResourceAwareStrategy.java
 ---
    @@ -357,9 +357,12 @@ private AllResources createClusterAllResources() {
                 ObjectResources rack = new ObjectResources(rackId);
                 racks.add(rack);
                 for (String nodeHost : nodeHosts) {
    -                for (RAS_Node node : hostnameToNodes(nodeHost)) {
    -                    
rack.availableResources.add(node.getTotalAvailableResources());
    -                    
rack.totalResources.add(node.getTotalAvailableResources());
    +                List<RAS_Node> nodes = hostnameToNodes(nodeHost);
    +                if(nodes != null) {
    +                    for (RAS_Node node : nodes) {
    --- End diff --
    
    we initialize the nodes with new HashMap<>(), so it will never be a null, 
and this fix is not necessary


---

Reply via email to