Source:
private void addSpoutAggStats(TopologyPageInfo topoPageInfo, StormTopology topology, Map<String, Object> topoConf) { Map<String, NormalizedResourceRequest> spoutResources = ResourceUtils.getSpoutsResources(topology, topoConf); if (topoPageInfo.get_id_to_spout_agg_stats().isEmpty()) { for (Entry<String, SpoutSpec> entry : topology.get_spouts().entrySet()) { String spoutName = entry.getKey(); SpoutSpec spoutSpec = entry.getValue(); ComponentAggregateStats placeholderComponentStats = new ComponentAggregateStats(); placeholderComponentStats.set_type(ComponentType.SPOUT); CommonAggregateStats commonStats = getPlaceholderCommonAggregateStats(spoutSpec); commonStats.set_resources_map(spoutResources.getOrDefault(spoutName, new NormalizedResourceRequest()) .toNormalizedMap()); placeholderComponentStats.set_common_stats(commonStats); SpoutAggregateStats spoutAggStats = new SpoutAggregateStats(); spoutAggStats.set_complete_latency_ms(0); SpecificAggregateStats specificStats = new SpecificAggregateStats(); specificStats.set_spout(spoutAggStats); placeholderComponentStats.set_specific_stats(specificStats); 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()); entry.getValue().set_last_error(stormClusterState.lastError(topoPageInfo.get_id(), entry.getKey())); } } }

Target:
private void addSpoutAggStats(TopologyPageInfo topoPageInfo, StormTopology topology, Map<String, Object> topoConf) { Map<String, NormalizedResourceRequest> spoutResources = ResourceUtils.getSpoutsResources(topology, topoConf); if (topoPageInfo.get_id_to_spout_agg_stats().isEmpty()) { for (Entry<String, SpoutSpec> entry : topology.get_spouts().entrySet()) { String spoutName = entry.getKey(); SpoutSpec spoutSpec = entry.getValue(); ComponentAggregateStats placeholderComponentStats = new ComponentAggregateStats(); placeholderComponentStats.set_type(ComponentType.SPOUT); CommonAggregateStats commonStats = getPlaceholderCommonAggregateStats(spoutSpec); commonStats.set_resources_map(spoutResources.getOrDefault(spoutName, new NormalizedResourceRequest()) .toNormalizedMap()); placeholderComponentStats.set_common_stats(commonStats); SpoutAggregateStats spoutAggStats = new SpoutAggregateStats(); spoutAggStats.set_complete_latency_ms(0); SpecificAggregateStats specificStats = new SpecificAggregateStats(); specificStats.set_spout(spoutAggStats); placeholderComponentStats.set_specific_stats(specificStats); 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()); } } }