RuiLi8080 commented on a change in pull request #3195: [STORM-3567] fix UI 
showing wrong resource info when topo is not scheduled
URL: https://github.com/apache/storm/pull/3195#discussion_r368154224
 
 

 ##########
 File path: 
storm-server/src/main/java/org/apache/storm/daemon/nimbus/Nimbus.java
 ##########
 @@ -4264,23 +4263,35 @@ private void 
maybeAddPlaceholderSpoutAggStats(TopologyPageInfo topoPageInfo, Sto
                 SpecificAggregateStats specificStats = new 
SpecificAggregateStats();
                 specificStats.set_spout(spoutAggStats);
                 placeholderComponentStats.set_specific_stats(specificStats);
-
-                topoPageInfo.get_id_to_spout_agg_stats().put(entry.getKey(), 
placeholderComponentStats);
+                topoPageInfo.get_id_to_spout_agg_stats().put(spoutName, 
placeholderComponentStats);
+            }
+        } else {
+            for (Entry<String, ComponentAggregateStats> entry : 
topoPageInfo.get_id_to_spout_agg_stats().entrySet()) {
+                CommonAggregateStats commonStats = 
entry.getValue().get_common_stats();
+                setResourcesDefaultIfNotSet(spoutResources, entry.getKey(), 
topoConf);
+                
commonStats.set_resources_map(spoutResources.get(entry.getKey()).toNormalizedMap());
             }
         }
     }
 
     /**
-     * Add placeholder AggStats allowing topology page to show components 
before AggStats are populated.
+     * If aggStats are not populated, compute common and component(bolt) agg 
and create placeholder stat.
+     * This allow the topology page to show component spec even the topo is 
not scheduled.
+     * Otherwise, just fetch data from current topoPageInfo.
      *
      * @param topoPageInfo  topology page info holding bolt AggStats
      * @param topology      storm topology used to get bolt names
      * @param includeSys    whether to show system bolts
      */
-    private void maybeAddPlaceholderBoltAggStats(TopologyPageInfo 
topoPageInfo, StormTopology topology, boolean includeSys) {
+    private void addBoltAggStats(TopologyPageInfo topoPageInfo, StormTopology 
topology,
 
 Review comment:
   Corrected both and force-push.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to