public java.lang.Object getFieldValue(_Fields field) { switch (field) { case ACKED: return get_acked(); case FAILED: return get_failed(); case COMPLETE_MS_AVG: return get_complete_ms_avg(); } throw new java.lang.IllegalStateException(); }
@Override protected java.lang.Object tupleSchemeReadValue(org.apache.storm.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.storm.thrift.TException { _Fields setField = _Fields.findByThriftId(fieldID); if (setField != null) { switch (setField) { case BOLT: BoltStats bolt; bolt = new BoltStats(); bolt.read(iprot); return bolt; case SPOUT: SpoutStats spout; spout = new SpoutStats(); spout.read(iprot); return spout; default: throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); } } else { throw new org.apache.storm.thrift.protocol.TProtocolException("Couldn't find a field with field id " + fieldID); } }
public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case ACKED: if (value == null) { unset_acked(); } else { set_acked((java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Long>>)value); } break; case FAILED: if (value == null) { unset_failed(); } else { set_failed((java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Long>>)value); } break; case COMPLETE_MS_AVG: if (value == null) { unset_complete_ms_avg(); } else { set_complete_ms_avg((java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Double>>)value); } break; } }
&& exec.get_stats().get_specific().is_set_spout()) { SpoutStats stats = exec.get_stats().get_specific().get_spout(); Map<String, Long> failedMap = stats.get_failed().get(":all-time"); Map<String, Long> ackedMap = stats.get_acked().get(":all-time"); if (ackedMap != null) { for (String key : ackedMap.keySet()) {
private static ExecutorSpecificStats thriftifySpecificStats(Map stats) { ExecutorSpecificStats specificStats = new ExecutorSpecificStats(); String compType = (String) stats.get(TYPE); if (ClientStatsUtil.BOLT.equals(compType)) { BoltStats boltStats = new BoltStats(); boltStats.set_acked( ClientStatsUtil.windowSetConverter(ClientStatsUtil.getMapByKey(stats, ACKED), ClientStatsUtil.TO_GSID, TO_STRING)); boltStats.set_executed( ClientStatsUtil.windowSetConverter(ClientStatsUtil.getMapByKey(stats, EXECUTED), ClientStatsUtil.TO_GSID, TO_STRING)); boltStats.set_execute_ms_avg( ClientStatsUtil.windowSetConverter(ClientStatsUtil.getMapByKey(stats, EXEC_LATENCIES), ClientStatsUtil.TO_GSID, TO_STRING)); boltStats.set_failed( ClientStatsUtil.windowSetConverter(ClientStatsUtil.getMapByKey(stats, FAILED), ClientStatsUtil.TO_GSID, TO_STRING)); boltStats.set_process_ms_avg( ClientStatsUtil.windowSetConverter(ClientStatsUtil.getMapByKey(stats, PROC_LATENCIES), ClientStatsUtil.TO_GSID, TO_STRING)); specificStats.set_bolt(boltStats); } else { SpoutStats spoutStats = new SpoutStats(); spoutStats.set_acked(ClientStatsUtil.windowSetConverter(ClientStatsUtil.getMapByKey(stats, ACKED), TO_STRING, TO_STRING)); spoutStats.set_failed(ClientStatsUtil.windowSetConverter(ClientStatsUtil.getMapByKey(stats, FAILED), TO_STRING, TO_STRING)); spoutStats.set_complete_ms_avg( ClientStatsUtil.windowSetConverter(ClientStatsUtil.getMapByKey(stats, COMP_LATENCIES), TO_STRING, TO_STRING)); specificStats.set_spout(spoutStats); } return specificStats; }
if (stats.get_specific().is_set_spout()) { SpoutStats ss = stats.get_specific().get_spout(); Map<String, Long> failedMap = ss.get_failed().get(":all-time"); if (failedMap != null) { for (String key: failedMap.keySet()) {
public SpoutStats deepCopy() { return new SpoutStats(this); }
@Override public ExecutorStats renderStats() { ExecutorStats ret = new ExecutorStats(); // common fields ret.set_emitted(valueStat(getEmitted())); ret.set_transferred(valueStat(getTransferred())); ret.set_rate(this.rate); // spout stats SpoutStats spoutStats = new SpoutStats( valueStat(getAcked()), valueStat(getFailed()), valueStat(completeLatencyStats)); ret.set_specific(ExecutorSpecificStats.spout(spoutStats)); return ret; } }
private static Map<String, Object> convertSpecificStats(SpoutStats stats) { Map<String, Object> ret = new HashMap<>(); ret.put(ACKED, stats.get_acked()); ret.put(FAILED, stats.get_failed()); ret.put(COMP_LATENCIES, stats.get_complete_ms_avg()); return ret; }
public void setFieldValue(_Fields field, Object value) { switch (field) { case ACKED: if (value == null) { unset_acked(); } else { set_acked((Map<String,Map<String,Long>>)value); } break; case FAILED: if (value == null) { unset_failed(); } else { set_failed((Map<String,Map<String,Long>>)value); } break; case COMPLETE_MS_AVG: if (value == null) { unset_complete_ms_avg(); } else { set_complete_ms_avg((Map<String,Map<String,Double>>)value); } break; } }
if (field.type == SPOUT_FIELD_DESC.type) { SpoutStats spout; spout = new SpoutStats(); spout.read(iprot); return spout; } else {
public SpoutStats deepCopy() { return new SpoutStats(this); }
/** * aggregate spout stats. * * @param statsSeq a seq of ExecutorStats * @param includeSys whether to include system streams * @return aggregated spout stats: {metric -> win -> global stream id -> value} */ public static Map<String, Map> aggregateSpoutStats(List<ExecutorSummary> statsSeq, boolean includeSys) { // actually Map<String, Map<String, Map<String, Long/Double>>> Map<String, Map> ret = new HashMap<>(); Map<String, Map<String, Map<String, Long>>> commonStats = aggregateCommonStats(statsSeq); // filter sys streams if necessary commonStats = preProcessStreamSummary(commonStats, includeSys); List<Map<String, Map<String, Long>>> acked = new ArrayList<>(); List<Map<String, Map<String, Long>>> failed = new ArrayList<>(); List<Map<String, Map<String, Double>>> completeLatencies = new ArrayList<>(); for (ExecutorSummary summary : statsSeq) { ExecutorStats stats = summary.get_stats(); acked.add(stats.get_specific().get_spout().get_acked()); failed.add(stats.get_specific().get_spout().get_failed()); completeLatencies.add(stats.get_specific().get_spout().get_complete_ms_avg()); } ret.putAll(commonStats); ((Map) ret).put(ACKED, aggregateCounts(acked)); ((Map) ret).put(FAILED, aggregateCounts(failed)); ((Map) ret).put(COMP_LATENCIES, aggregateAverages(completeLatencies, acked)); return ret; }
@Override protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { _Fields setField = _Fields.findByThriftId(fieldID); if (setField != null) { switch (setField) { case BOLT: BoltStats bolt; bolt = new BoltStats(); bolt.read(iprot); return bolt; case SPOUT: SpoutStats spout; spout = new SpoutStats(); spout.read(iprot); return spout; default: throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); } } else { throw new TProtocolException("Couldn't find a field with field id " + fieldID); } }
if ("spout".equals(exec.get_component_id())) { SpoutStats stats = exec.get_stats().get_specific().get_spout(); Map<String, Long> failedMap = stats.get_failed().get(":all-time"); Map<String, Long> ackedMap = stats.get_acked().get(":all-time"); Map<String, Double> avgLatMap = stats.get_complete_ms_avg().get(":all-time"); for (String key : ackedMap.keySet()) { if (failedMap != null) {
if (field.type == SPOUT_FIELD_DESC.type) { SpoutStats spout; spout = new SpoutStats(); spout.read(iprot); return spout; } else {
if ("spout".equals(exec.get_component_id())) { SpoutStats stats = exec.get_stats().get_specific().get_spout(); Map<String, Long> failedMap = stats.get_failed().get(":all-time"); Map<String, Long> ackedMap = stats.get_acked().get(":all-time"); Map<String, Double> avgLatMap = stats.get_complete_ms_avg().get(":all-time"); for (String key : ackedMap.keySet()) { if (failedMap != null) {
if ("spout".equals(exec.get_component_id())) { SpoutStats stats = exec.get_stats().get_specific().get_spout(); Map<String, Long> failedMap = stats.get_failed().get(":all-time"); Map<String, Long> ackedMap = stats.get_acked().get(":all-time"); Map<String, Double> avgLatMap = stats.get_complete_ms_avg().get(":all-time"); for (String key : ackedMap.keySet()) { if (failedMap != null) {
Map<String, Long> acked = spoutStats.get_acked().get(":all-time"); if (acked != null) { for (String key : acked.keySet()) { Map<String, Long> failed = spoutStats.get_failed().get(":all-time"); if (failed != null) { for (String key : failed.keySet()) { Map<String, Double> vals = spoutStats.get_complete_ms_avg().get(":all-time"); if (vals != null) { for (String key : vals.keySet()) {
public Object getFieldValue(_Fields field) { switch (field) { case ACKED: return get_acked(); case FAILED: return get_failed(); case COMPLETE_MS_AVG: return get_complete_ms_avg(); } throw new IllegalStateException(); }