public java.lang.Object getFieldValue(_Fields field) { switch (field) { case TYPE: return get_type(); case COMMON_STATS: return get_common_stats(); case SPECIFIC_STATS: return get_specific_stats(); case LAST_ERROR: return get_last_error(); } throw new java.lang.IllegalStateException(); }
/** * getTopologySpoutAggStatsMap. * @param componentAggregateStats componentAggregateStats * @param spoutId spoutId * @return getTopologySpoutAggStatsMap */ private static Map<String, Object> getTopologySpoutAggStatsMap(ComponentAggregateStats componentAggregateStats, String spoutId) { Map<String, Object> result = new HashMap(); CommonAggregateStats commonStats = componentAggregateStats.get_common_stats(); result.putAll(getCommonAggStatsMap(commonStats)); result.put("spoutId", spoutId); result.put("encodedSpoutId", URLEncoder.encode(spoutId)); SpoutAggregateStats spoutAggregateStats = componentAggregateStats.get_specific_stats().get_spout(); result.put("completeLatency", spoutAggregateStats.get_complete_latency_ms()); ErrorInfo lastError = componentAggregateStats.get_last_error(); result.put("lastError", Objects.isNull(lastError) ? "" : getTruncatedErrorString(lastError.get_error())); return result; }
/** * getSpoutAggStatsMap. * @param componentAggregateStats componentAggregateStats * @param window window * @return getSpoutAggStatsMap */ private static Map<String, Object> getSpoutAggStatsMap( ComponentAggregateStats componentAggregateStats, String window) { Map<String, Object> result = new HashMap(); SpoutAggregateStats spoutAggregateStats = componentAggregateStats.get_specific_stats().get_spout(); CommonAggregateStats commonStats = componentAggregateStats.get_common_stats(); result.put("window", window); result.put("windowPretty", getWindowHint(window)); result.put("emitted", commonStats.get_emitted()); result.put("transferred", commonStats.get_transferred()); result.put("acked", commonStats.get_acked()); result.put("failed", commonStats.get_failed()); result.put("completeLatency", spoutAggregateStats.get_complete_latency_ms()); ErrorInfo lastError = componentAggregateStats.get_last_error(); result.put("lastError", Objects.isNull(lastError) ? "" : getTruncatedErrorString(lastError.get_error())); return result; }
/** * getTopologyBoltAggStatsMap. * @param componentAggregateStats componentAggregateStats * @param boltId boltId * @return getTopologyBoltAggStatsMap */ private static Map<String, Object> getTopologyBoltAggStatsMap(ComponentAggregateStats componentAggregateStats, String boltId) { Map<String, Object> result = new HashMap(); CommonAggregateStats commonStats = componentAggregateStats.get_common_stats(); result.putAll(getCommonAggStatsMap(commonStats)); result.put("boltId", boltId); result.put("encodedBoltId", URLEncoder.encode(boltId)); BoltAggregateStats boltAggregateStats = componentAggregateStats.get_specific_stats().get_bolt(); result.put("capacity", StatsUtil.floatStr(boltAggregateStats.get_capacity())); result.put("executeLatency", StatsUtil.floatStr(boltAggregateStats.get_execute_latency_ms())); result.put("executed", boltAggregateStats.get_executed()); result.put("processLatency", StatsUtil.floatStr(boltAggregateStats.get_process_latency_ms())); ErrorInfo lastError = componentAggregateStats.get_last_error(); result.put("lastError", Objects.isNull(lastError) ? "" : getTruncatedErrorString(lastError.get_error())); return result; }
public Object getFieldValue(_Fields field) { switch (field) { case TYPE: return get_type(); case COMMON_STATS: return get_common_stats(); case SPECIFIC_STATS: return get_specific_stats(); case LAST_ERROR: return get_last_error(); } throw new IllegalStateException(); }