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

    https://github.com/apache/storm/pull/2385#discussion_r149162718
  
    --- Diff: 
storm-server/src/main/java/org/apache/storm/scheduler/TopologyDetails.java ---
    @@ -133,30 +136,31 @@ public StormTopology getTopology() {
     
         private void initResourceList() {
             this.resourceList = new HashMap<>();
    -        // Extract bolt memory info
    +        // Extract bolt resource info
             if (topology.get_bolts() != null) {
                 for (Map.Entry<String, Bolt> bolt : 
topology.get_bolts().entrySet()) {
                     //the json_conf is populated by TopologyBuilder (e.g. 
boltDeclarer.setMemoryLoad)
                     Map<String, Double> topologyResources =
                         
ResourceUtils.parseResources(bolt.getValue().get_common().get_json_conf());
    -                ResourceUtils.checkIntialization(topologyResources, 
bolt.getKey(), topologyConf);
    +                ResourceUtils.checkInitialization(topologyResources, 
bolt.getKey(), this.topologyConf);
                     for (Map.Entry<ExecutorDetails, String> 
anExecutorToComponent :
                         executorToComponent.entrySet()) {
    -                    if 
(bolt.getKey().equals(anExecutorToComponent.getValue())) {
    +                    if 
(bolt.getKey().equals(anExecutorToComponent.getValue())  && 
topologyResources.keySet().size() > 0) {
                             resourceList.put(anExecutorToComponent.getKey(), 
topologyResources);
                         }
                     }
                 }
             }
    -        // Extract spout memory info
    +        // Extract spout resource info
             if (topology.get_spouts() != null) {
                 for (Map.Entry<String, SpoutSpec> spout : 
topology.get_spouts().entrySet()) {
                     Map<String, Double> topologyResources =
                         
ResourceUtils.parseResources(spout.getValue().get_common().get_json_conf());
    -                ResourceUtils.checkIntialization(topologyResources, 
spout.getKey(), this.topologyConf);
    +                ResourceUtils.checkInitialization(topologyResources, 
spout.getKey(), this.topologyConf);
    +
                     for (Map.Entry<ExecutorDetails, String> 
anExecutorToComponent :
                         executorToComponent.entrySet()) {
    -                    if 
(spout.getKey().equals(anExecutorToComponent.getValue())) {
    +                    if 
(spout.getKey().equals(anExecutorToComponent.getValue()) && 
topologyResources.keySet().size() > 0) {
    --- End diff --
    
    nit: here too `!topologyResources.isEmpty()`


---

Reply via email to