/** * 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; }
@Override public void read(org.apache.storm.thrift.protocol.TProtocol prot, ExecutorAggregateStats struct) throws org.apache.storm.thrift.TException { org.apache.storm.thrift.protocol.TTupleProtocol iprot = (org.apache.storm.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.exec_summary = new ExecutorSummary(); struct.exec_summary.read(iprot); struct.set_exec_summary_isSet(true); } if (incoming.get(1)) { struct.stats = new ComponentAggregateStats(); struct.stats.read(iprot); struct.set_stats_isSet(true); } } }
case TYPE: if (value == null) { unset_type(); } else { set_type((ComponentType)value); unset_common_stats(); } else { set_common_stats((CommonAggregateStats)value); unset_specific_stats(); } else { set_specific_stats((SpecificAggregateStats)value); unset_last_error(); } else { set_last_error((ErrorInfo)value);
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(); }
private static ComponentAggregateStats thriftifySpoutAggStats(Map m) { ComponentAggregateStats stats = new ComponentAggregateStats(); stats.set_type(ComponentType.SPOUT); stats.set_last_error((ErrorInfo) m.get(LAST_ERROR)); thriftifyCommonAggStats(stats, m); SpoutAggregateStats spoutAggStats = new SpoutAggregateStats(); spoutAggStats.set_complete_latency_ms(getByKeyOr0(m, COMP_LATENCY).doubleValue()); SpecificAggregateStats specificStats = SpecificAggregateStats.spout(spoutAggStats); stats.set_specific_stats(specificStats); return stats; }
/** * getSpoutOutputStats. * @param streamId streamId * @param componentAggregateStats componentAggregateStats * @return getSpoutOutputStats */ private static Map<String, Object> getSpoutOutputStats(String streamId, ComponentAggregateStats componentAggregateStats) { SpecificAggregateStats specificAggregateStats = componentAggregateStats.get_specific_stats(); SpoutAggregateStats spoutAggregateStats = specificAggregateStats.get_spout(); Map<String, Object> result = new HashMap(); result.put("stream", streamId); CommonAggregateStats commonStats = componentAggregateStats.get_common_stats(); result.put("emitted", nullToZero(commonStats.get_emitted())); result.put("transferred", nullToZero(commonStats.get_transferred())); result.put("completeLatency", StatsUtil.floatStr(spoutAggregateStats.get_complete_latency_ms())); result.put("acked", nullToZero(commonStats.get_acked())); result.put("failed", nullToZero(commonStats.get_failed())); return result; }
public ComponentAggregateStats deepCopy() { return new ComponentAggregateStats(this); }
/** * getBoltOutputStats. * @param streamId streamId * @param componentAggregateStats componentAggregateStats * @return getBoltOutputStats */ private static Map<String, Object> getBoltOutputStats(String streamId, ComponentAggregateStats componentAggregateStats) { Map<String, Object> result = new HashMap(); result.put("stream", streamId); CommonAggregateStats commonStats = componentAggregateStats.get_common_stats(); result.put("emitted", nullToZero(commonStats.get_emitted())); result.put("transferred", nullToZero(commonStats.get_transferred())); return result; }
private static ComponentAggregateStats thriftifyCommonAggStats(ComponentAggregateStats stats, Map m) { CommonAggregateStats commonStats = new CommonAggregateStats(); commonStats.set_num_tasks(getByKeyOr0(m, NUM_TASKS).intValue()); commonStats.set_num_executors(getByKeyOr0(m, NUM_EXECUTORS).intValue()); commonStats.set_emitted(getByKeyOr0(m, EMITTED).longValue()); commonStats.set_transferred(getByKeyOr0(m, TRANSFERRED).longValue()); commonStats.set_acked(getByKeyOr0(m, ACKED).longValue()); commonStats.set_failed(getByKeyOr0(m, FAILED).longValue()); stats.set_common_stats(commonStats); return stats; }
@Override public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof ComponentAggregateStats) return this.equals((ComponentAggregateStats)that); return false; }
private static ComponentAggregateStats thriftifyBoltAggStats(Map m) { ComponentAggregateStats stats = new ComponentAggregateStats(); stats.set_type(ComponentType.BOLT); stats.set_last_error((ErrorInfo) m.get(LAST_ERROR)); thriftifyCommonAggStats(stats, m); BoltAggregateStats boltAggStats = new BoltAggregateStats(); boltAggStats.set_execute_latency_ms(getByKeyOr0(m, EXEC_LATENCY).doubleValue()); boltAggStats.set_process_latency_ms(getByKeyOr0(m, PROC_LATENCY).doubleValue()); boltAggStats.set_executed(getByKeyOr0(m, EXECUTED).longValue()); boltAggStats.set_capacity(getByKeyOr0(m, CAPACITY).doubleValue()); SpecificAggregateStats specificStats = SpecificAggregateStats.bolt(boltAggStats); stats.set_specific_stats(specificStats); return stats; }
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(); }
/** * getBoltAggStatsMap. * @param componentAggregateStats componentAggregateStats * @param window window * @return getBoltAggStatsMap */ private static Map<String, Object> getBoltAggStatsMap( ComponentAggregateStats componentAggregateStats, String window) { Map<String, Object> result = new HashMap(); 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()); BoltAggregateStats boltAggregateStats = componentAggregateStats.get_specific_stats().get_bolt(); 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())); result.put("capacity", StatsUtil.floatStr(boltAggregateStats.get_capacity())); return result; }
/** * Performs a deep copy on <i>other</i>. */ public ExecutorAggregateStats(ExecutorAggregateStats other) { if (other.is_set_exec_summary()) { this.exec_summary = new ExecutorSummary(other.exec_summary); } if (other.is_set_stats()) { this.stats = new ComponentAggregateStats(other.stats); } }
CommonAggregateStats commonStats = entry.getValue().get_common_stats(); setResourcesDefaultIfNotSet(spoutResources, entry.getKey(), topoConf); commonStats.set_resources_map(spoutResources.get(entry.getKey()).toNormalizedMap()); CommonAggregateStats commonStats = entry.getValue().get_common_stats(); setResourcesDefaultIfNotSet(boltResources, entry.getKey(), topoConf); commonStats.set_resources_map(boltResources.get(entry.getKey()).toNormalizedMap());
public boolean equals(ExecutorAggregateStats that) { if (that == null) return false; if (this == that) return true; boolean this_present_exec_summary = true && this.is_set_exec_summary(); boolean that_present_exec_summary = true && that.is_set_exec_summary(); if (this_present_exec_summary || that_present_exec_summary) { if (!(this_present_exec_summary && that_present_exec_summary)) return false; if (!this.exec_summary.equals(that.exec_summary)) return false; } boolean this_present_stats = true && this.is_set_stats(); boolean that_present_stats = true && that.is_set_stats(); if (this_present_stats || that_present_stats) { if (!(this_present_stats && that_present_stats)) return false; if (!this.stats.equals(that.stats)) return false; } return true; }
case TYPE: if (value == null) { unset_type(); } else { set_type((ComponentType)value); unset_common_stats(); } else { set_common_stats((CommonAggregateStats)value); unset_specific_stats(); } else { set_specific_stats((SpecificAggregateStats)value); unset_last_error(); } else { set_last_error((ErrorInfo)value);
_val546 = new ComponentAggregateStats(); _val546.read(iprot); struct.window_to_stats.put(_key545, _val546); _val550 = new ComponentAggregateStats(); _val550.read(iprot); struct.gsid_to_input_stats.put(_key549, _val550); _val554 = new ComponentAggregateStats(); _val554.read(iprot); struct.sid_to_output_stats.put(_key553, _val554);
/** * 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; }
/** * getBoltInputStats. * @param globalStreamId globalStreamId * @param componentAggregateStats componentAggregateStats * @return getBoltInputStats */ private static Map<String, Object> getBoltInputStats(GlobalStreamId globalStreamId, ComponentAggregateStats componentAggregateStats) { Map<String, Object> result = new HashMap(); SpecificAggregateStats specificAggregateStats = componentAggregateStats.get_specific_stats(); BoltAggregateStats boltAggregateStats = specificAggregateStats.get_bolt(); CommonAggregateStats commonAggregateStats = componentAggregateStats.get_common_stats(); String componentId = globalStreamId.get_componentId(); result.put("component", componentId); result.put("encodedComponentId", URLEncoder.encode(componentId)); result.put("stream", globalStreamId.get_streamId()); result.put("executeLatency", StatsUtil.floatStr(boltAggregateStats.get_execute_latency_ms())); result.put("processLatency", StatsUtil.floatStr(boltAggregateStats.get_process_latency_ms())); result.put("executed", nullToZero(boltAggregateStats.get_executed())); result.put("acked", nullToZero(commonAggregateStats.get_acked())); result.put("failed", nullToZero(commonAggregateStats.get_failed())); return result; }