private static List<Double> extractBoltValues(List<ExecutorSummary> summaries, GlobalStreamId id, Function<BoltStats, Map<String, Map<GlobalStreamId, Double>>> func) { List<Double> ret = new ArrayList<>(); if (summaries != null) { for (ExecutorSummary summ : summaries) { if (summ != null && summ.is_set_stats()) { Map<String, Map<GlobalStreamId, Double>> data = func.apply(summ.get_stats().get_specific().get_bolt()); if (data != null) { List<Double> subvalues = data.values().stream() .map((subMap) -> subMap.get(id)) .filter((value) -> value != null) .collect(Collectors.toList()); ret.addAll(subvalues); } } } } return ret; }
sb.append(this.uptime_secs); first = false; if (is_set_stats()) { if (!first) sb.append(", "); sb.append("stats:");
/** * getStatMapFromExecutorSummary. * @param executorSummary executorSummary * @return getStatMapFromExecutorSummary */ public static Map<String, Object> getStatMapFromExecutorSummary(ExecutorSummary executorSummary) { Map<String, Object> result = new HashMap(); result.put(":host", executorSummary.get_host()); result.put(":port", executorSummary.get_port()); result.put(":uptime_secs", executorSummary.get_uptime_secs()); result.put(":transferred", null); if (executorSummary.is_set_stats()) { result.put(":transferred", sanitizeTransferredStats(executorSummary.get_stats().get_transferred())); } return result; }
@Override public void write(org.apache.storm.thrift.protocol.TProtocol prot, ExecutorSummary struct) throws org.apache.storm.thrift.TException { org.apache.storm.thrift.protocol.TTupleProtocol oprot = (org.apache.storm.thrift.protocol.TTupleProtocol) prot; struct.executor_info.write(oprot); oprot.writeString(struct.component_id); oprot.writeString(struct.host); oprot.writeI32(struct.port); oprot.writeI32(struct.uptime_secs); java.util.BitSet optionals = new java.util.BitSet(); if (struct.is_set_stats()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.is_set_stats()) { struct.stats.write(oprot); } }
@Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((is_set_executor_info()) ? 131071 : 524287); if (is_set_executor_info()) hashCode = hashCode * 8191 + executor_info.hashCode(); hashCode = hashCode * 8191 + ((is_set_component_id()) ? 131071 : 524287); if (is_set_component_id()) hashCode = hashCode * 8191 + component_id.hashCode(); hashCode = hashCode * 8191 + ((is_set_host()) ? 131071 : 524287); if (is_set_host()) hashCode = hashCode * 8191 + host.hashCode(); hashCode = hashCode * 8191 + port; hashCode = hashCode * 8191 + uptime_secs; hashCode = hashCode * 8191 + ((is_set_stats()) ? 131071 : 524287); if (is_set_stats()) hashCode = hashCode * 8191 + stats.hashCode(); return hashCode; }
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new java.lang.IllegalArgumentException(); } switch (field) { case EXECUTOR_INFO: return is_set_executor_info(); case COMPONENT_ID: return is_set_component_id(); case HOST: return is_set_host(); case PORT: return is_set_port(); case UPTIME_SECS: return is_set_uptime_secs(); case STATS: return is_set_stats(); } throw new java.lang.IllegalStateException(); }
lastComparison = java.lang.Boolean.valueOf(is_set_stats()).compareTo(other.is_set_stats()); if (lastComparison != 0) { return lastComparison; if (is_set_stats()) { lastComparison = org.apache.storm.thrift.TBaseHelper.compareTo(this.stats, other.stats); if (lastComparison != 0) {
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))
/** * Performs a deep copy on <i>other</i>. */ public ExecutorSummary(ExecutorSummary other) { __isset_bitfield = other.__isset_bitfield; if (other.is_set_executor_info()) { this.executor_info = new ExecutorInfo(other.executor_info); } if (other.is_set_component_id()) { this.component_id = other.component_id; } if (other.is_set_host()) { this.host = other.host; } this.port = other.port; this.uptime_secs = other.uptime_secs; if (other.is_set_stats()) { this.stats = new ExecutorStats(other.stats); } }
if (summaries != null) { for (ExecutorSummary summary: summaries) { if (summary.is_set_stats()) { int uptime = summary.get_uptime_secs(); LOG.debug("UPTIME {}", uptime);
oprot.writeFieldEnd(); if (struct.stats != null) { if (struct.is_set_stats()) { oprot.writeFieldBegin(STATS_FIELD_DESC); struct.stats.write(oprot);
sb.append(this.uptime_secs); first = false; if (is_set_stats()) { if (!first) sb.append(", "); sb.append("stats:");
@Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_executor_info = true && (is_set_executor_info()); list.add(present_executor_info); if (present_executor_info) list.add(executor_info); boolean present_component_id = true && (is_set_component_id()); list.add(present_component_id); if (present_component_id) list.add(component_id); boolean present_host = true && (is_set_host()); list.add(present_host); if (present_host) list.add(host); boolean present_port = true; list.add(present_port); if (present_port) list.add(port); boolean present_uptime_secs = true; list.add(present_uptime_secs); if (present_uptime_secs) list.add(uptime_secs); boolean present_stats = true && (is_set_stats()); list.add(present_stats); if (present_stats) list.add(stats); return list.hashCode(); }
@Override public void write(org.apache.thrift.protocol.TProtocol prot, ExecutorSummary struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; struct.executor_info.write(oprot); oprot.writeString(struct.component_id); oprot.writeString(struct.host); oprot.writeI32(struct.port); oprot.writeI32(struct.uptime_secs); BitSet optionals = new BitSet(); if (struct.is_set_stats()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.is_set_stats()) { struct.stats.write(oprot); } }
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case EXECUTOR_INFO: return is_set_executor_info(); case COMPONENT_ID: return is_set_component_id(); case HOST: return is_set_host(); case PORT: return is_set_port(); case UPTIME_SECS: return is_set_uptime_secs(); case STATS: return is_set_stats(); } throw new IllegalStateException(); }
lastComparison = Boolean.valueOf(is_set_stats()).compareTo(other.is_set_stats()); if (lastComparison != 0) { return lastComparison; if (is_set_stats()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stats, other.stats); if (lastComparison != 0) {
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))
/** * Performs a deep copy on <i>other</i>. */ public ExecutorSummary(ExecutorSummary other) { __isset_bitfield = other.__isset_bitfield; if (other.is_set_executor_info()) { this.executor_info = new ExecutorInfo(other.executor_info); } if (other.is_set_component_id()) { this.component_id = other.component_id; } if (other.is_set_host()) { this.host = other.host; } this.port = other.port; this.uptime_secs = other.uptime_secs; if (other.is_set_stats()) { this.stats = new ExecutorStats(other.stats); } }
oprot.writeFieldEnd(); if (struct.stats != null) { if (struct.is_set_stats()) { oprot.writeFieldBegin(STATS_FIELD_DESC); struct.stats.write(oprot);