/** * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package backtype.storm.generated; import org.apache.commons.lang.builder.HashCodeBuilder; import org.apache.thrift.scheme.IScheme; import org.apache.thrift.scheme.SchemeFactory; import org.apache.thrift.scheme.StandardScheme; import org.apache.thrift.scheme.TupleScheme; import org.apache.thrift.protocol.TTupleProtocol; import org.apache.thrift.protocol.TProtocolException; import org.apache.thrift.EncodingUtils; import org.apache.thrift.TException; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.util.HashMap; import java.util.EnumMap; import java.util.Set; import java.util.HashSet; import java.util.EnumSet; import java.util.Collections; import java.util.BitSet; import java.nio.ByteBuffer; import java.util.Arrays; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class BoltStats implements org.apache.thrift.TBase<BoltStats, BoltStats._Fields>, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("BoltStats"); private static final org.apache.thrift.protocol.TField ACKED_FIELD_DESC = new org.apache.thrift.protocol.TField("acked", org.apache.thrift.protocol.TType.MAP, (short)1); private static final org.apache.thrift.protocol.TField FAILED_FIELD_DESC = new org.apache.thrift.protocol.TField("failed", org.apache.thrift.protocol.TType.MAP, (short)2); private static final org.apache.thrift.protocol.TField PROCESS_MS_AVG_FIELD_DESC = new org.apache.thrift.protocol.TField("process_ms_avg", org.apache.thrift.protocol.TType.MAP, (short)3); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new BoltStatsStandardSchemeFactory()); schemes.put(TupleScheme.class, new BoltStatsTupleSchemeFactory()); } private Map<String,Map<GlobalStreamId,Long>> acked; // required private Map<String,Map<GlobalStreamId,Long>> failed; // required private Map<String,Map<GlobalStreamId,Double>> process_ms_avg; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { ACKED((short)1, "acked"), FAILED((short)2, "failed"), PROCESS_MS_AVG((short)3, "process_ms_avg"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // ACKED return ACKED; case 2: // FAILED return FAILED; case 3: // PROCESS_MS_AVG return PROCESS_MS_AVG; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.ACKED, new org.apache.thrift.meta_data.FieldMetaData("acked", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, GlobalStreamId.class), new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))))); tmpMap.put(_Fields.FAILED, new org.apache.thrift.meta_data.FieldMetaData("failed", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, GlobalStreamId.class), new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))))); tmpMap.put(_Fields.PROCESS_MS_AVG, new org.apache.thrift.meta_data.FieldMetaData("process_ms_avg", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, GlobalStreamId.class), new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(BoltStats.class, metaDataMap); } public BoltStats() { } public BoltStats( Map<String,Map<GlobalStreamId,Long>> acked, Map<String,Map<GlobalStreamId,Long>> failed, Map<String,Map<GlobalStreamId,Double>> process_ms_avg) { this(); this.acked = acked; this.failed = failed; this.process_ms_avg = process_ms_avg; } /** * Performs a deep copy on <i>other</i>. */ public BoltStats(BoltStats other) { if (other.is_set_acked()) { Map<String,Map<GlobalStreamId,Long>> __this__acked = new HashMap<String,Map<GlobalStreamId,Long>>(); for (Map.Entry<String, Map<GlobalStreamId,Long>> other_element : other.acked.entrySet()) { String other_element_key = other_element.getKey(); Map<GlobalStreamId,Long> other_element_value = other_element.getValue(); String __this__acked_copy_key = other_element_key; Map<GlobalStreamId,Long> __this__acked_copy_value = new HashMap<GlobalStreamId,Long>(); for (Map.Entry<GlobalStreamId, Long> other_element_value_element : other_element_value.entrySet()) { GlobalStreamId other_element_value_element_key = other_element_value_element.getKey(); Long other_element_value_element_value = other_element_value_element.getValue(); GlobalStreamId __this__acked_copy_value_copy_key = new GlobalStreamId(other_element_value_element_key); Long __this__acked_copy_value_copy_value = other_element_value_element_value; __this__acked_copy_value.put(__this__acked_copy_value_copy_key, __this__acked_copy_value_copy_value); } __this__acked.put(__this__acked_copy_key, __this__acked_copy_value); } this.acked = __this__acked; } if (other.is_set_failed()) { Map<String,Map<GlobalStreamId,Long>> __this__failed = new HashMap<String,Map<GlobalStreamId,Long>>(); for (Map.Entry<String, Map<GlobalStreamId,Long>> other_element : other.failed.entrySet()) { String other_element_key = other_element.getKey(); Map<GlobalStreamId,Long> other_element_value = other_element.getValue(); String __this__failed_copy_key = other_element_key; Map<GlobalStreamId,Long> __this__failed_copy_value = new HashMap<GlobalStreamId,Long>(); for (Map.Entry<GlobalStreamId, Long> other_element_value_element : other_element_value.entrySet()) { GlobalStreamId other_element_value_element_key = other_element_value_element.getKey(); Long other_element_value_element_value = other_element_value_element.getValue(); GlobalStreamId __this__failed_copy_value_copy_key = new GlobalStreamId(other_element_value_element_key); Long __this__failed_copy_value_copy_value = other_element_value_element_value; __this__failed_copy_value.put(__this__failed_copy_value_copy_key, __this__failed_copy_value_copy_value); } __this__failed.put(__this__failed_copy_key, __this__failed_copy_value); } this.failed = __this__failed; } if (other.is_set_process_ms_avg()) { Map<String,Map<GlobalStreamId,Double>> __this__process_ms_avg = new HashMap<String,Map<GlobalStreamId,Double>>(); for (Map.Entry<String, Map<GlobalStreamId,Double>> other_element : other.process_ms_avg.entrySet()) { String other_element_key = other_element.getKey(); Map<GlobalStreamId,Double> other_element_value = other_element.getValue(); String __this__process_ms_avg_copy_key = other_element_key; Map<GlobalStreamId,Double> __this__process_ms_avg_copy_value = new HashMap<GlobalStreamId,Double>(); for (Map.Entry<GlobalStreamId, Double> other_element_value_element : other_element_value.entrySet()) { GlobalStreamId other_element_value_element_key = other_element_value_element.getKey(); Double other_element_value_element_value = other_element_value_element.getValue(); GlobalStreamId __this__process_ms_avg_copy_value_copy_key = new GlobalStreamId(other_element_value_element_key); Double __this__process_ms_avg_copy_value_copy_value = other_element_value_element_value; __this__process_ms_avg_copy_value.put(__this__process_ms_avg_copy_value_copy_key, __this__process_ms_avg_copy_value_copy_value); } __this__process_ms_avg.put(__this__process_ms_avg_copy_key, __this__process_ms_avg_copy_value); } this.process_ms_avg = __this__process_ms_avg; } } public BoltStats deepCopy() { return new BoltStats(this); } @Override public void clear() { this.acked = null; this.failed = null; this.process_ms_avg = null; } public int get_acked_size() { return (this.acked == null) ? 0 : this.acked.size(); } public void put_to_acked(String key, Map<GlobalStreamId,Long> val) { if (this.acked == null) { this.acked = new HashMap<String,Map<GlobalStreamId,Long>>(); } this.acked.put(key, val); } public Map<String,Map<GlobalStreamId,Long>> get_acked() { return this.acked; } public void set_acked(Map<String,Map<GlobalStreamId,Long>> acked) { this.acked = acked; } public void unset_acked() { this.acked = null; } /** Returns true if field acked is set (has been assigned a value) and false otherwise */ public boolean is_set_acked() { return this.acked != null; } public void set_acked_isSet(boolean value) { if (!value) { this.acked = null; } } public int get_failed_size() { return (this.failed == null) ? 0 : this.failed.size(); } public void put_to_failed(String key, Map<GlobalStreamId,Long> val) { if (this.failed == null) { this.failed = new HashMap<String,Map<GlobalStreamId,Long>>(); } this.failed.put(key, val); } public Map<String,Map<GlobalStreamId,Long>> get_failed() { return this.failed; } public void set_failed(Map<String,Map<GlobalStreamId,Long>> failed) { this.failed = failed; } public void unset_failed() { this.failed = null; } /** Returns true if field failed is set (has been assigned a value) and false otherwise */ public boolean is_set_failed() { return this.failed != null; } public void set_failed_isSet(boolean value) { if (!value) { this.failed = null; } } public int get_process_ms_avg_size() { return (this.process_ms_avg == null) ? 0 : this.process_ms_avg.size(); } public void put_to_process_ms_avg(String key, Map<GlobalStreamId,Double> val) { if (this.process_ms_avg == null) { this.process_ms_avg = new HashMap<String,Map<GlobalStreamId,Double>>(); } this.process_ms_avg.put(key, val); } public Map<String,Map<GlobalStreamId,Double>> get_process_ms_avg() { return this.process_ms_avg; } public void set_process_ms_avg(Map<String,Map<GlobalStreamId,Double>> process_ms_avg) { this.process_ms_avg = process_ms_avg; } public void unset_process_ms_avg() { this.process_ms_avg = null; } /** Returns true if field process_ms_avg is set (has been assigned a value) and false otherwise */ public boolean is_set_process_ms_avg() { return this.process_ms_avg != null; } public void set_process_ms_avg_isSet(boolean value) { if (!value) { this.process_ms_avg = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case ACKED: if (value == null) { unset_acked(); } else { set_acked((Map<String,Map<GlobalStreamId,Long>>)value); } break; case FAILED: if (value == null) { unset_failed(); } else { set_failed((Map<String,Map<GlobalStreamId,Long>>)value); } break; case PROCESS_MS_AVG: if (value == null) { unset_process_ms_avg(); } else { set_process_ms_avg((Map<String,Map<GlobalStreamId,Double>>)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case ACKED: return get_acked(); case FAILED: return get_failed(); case PROCESS_MS_AVG: return get_process_ms_avg(); } throw new IllegalStateException(); } /** 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 ACKED: return is_set_acked(); case FAILED: return is_set_failed(); case PROCESS_MS_AVG: return is_set_process_ms_avg(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof BoltStats) return this.equals((BoltStats)that); return false; } public boolean equals(BoltStats that) { if (that == null) return false; boolean this_present_acked = true && this.is_set_acked(); boolean that_present_acked = true && that.is_set_acked(); if (this_present_acked || that_present_acked) { if (!(this_present_acked && that_present_acked)) return false; if (!this.acked.equals(that.acked)) return false; } boolean this_present_failed = true && this.is_set_failed(); boolean that_present_failed = true && that.is_set_failed(); if (this_present_failed || that_present_failed) { if (!(this_present_failed && that_present_failed)) return false; if (!this.failed.equals(that.failed)) return false; } boolean this_present_process_ms_avg = true && this.is_set_process_ms_avg(); boolean that_present_process_ms_avg = true && that.is_set_process_ms_avg(); if (this_present_process_ms_avg || that_present_process_ms_avg) { if (!(this_present_process_ms_avg && that_present_process_ms_avg)) return false; if (!this.process_ms_avg.equals(that.process_ms_avg)) return false; } return true; } @Override public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(); boolean present_acked = true && (is_set_acked()); builder.append(present_acked); if (present_acked) builder.append(acked); boolean present_failed = true && (is_set_failed()); builder.append(present_failed); if (present_failed) builder.append(failed); boolean present_process_ms_avg = true && (is_set_process_ms_avg()); builder.append(present_process_ms_avg); if (present_process_ms_avg) builder.append(process_ms_avg); return builder.toHashCode(); } public int compareTo(BoltStats other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; BoltStats typedOther = (BoltStats)other; lastComparison = Boolean.valueOf(is_set_acked()).compareTo(typedOther.is_set_acked()); if (lastComparison != 0) { return lastComparison; } if (is_set_acked()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.acked, typedOther.acked); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(is_set_failed()).compareTo(typedOther.is_set_failed()); if (lastComparison != 0) { return lastComparison; } if (is_set_failed()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.failed, typedOther.failed); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(is_set_process_ms_avg()).compareTo(typedOther.is_set_process_ms_avg()); if (lastComparison != 0) { return lastComparison; } if (is_set_process_ms_avg()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.process_ms_avg, typedOther.process_ms_avg); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("BoltStats("); boolean first = true; sb.append("acked:"); if (this.acked == null) { sb.append("null"); } else { sb.append(this.acked); } first = false; if (!first) sb.append(", "); sb.append("failed:"); if (this.failed == null) { sb.append("null"); } else { sb.append(this.failed); } first = false; if (!first) sb.append(", "); sb.append("process_ms_avg:"); if (this.process_ms_avg == null) { sb.append("null"); } else { sb.append(this.process_ms_avg); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields if (!is_set_acked()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'acked' is unset! Struct:" + toString()); } if (!is_set_failed()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'failed' is unset! Struct:" + toString()); } if (!is_set_process_ms_avg()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'process_ms_avg' is unset! Struct:" + toString()); } // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class BoltStatsStandardSchemeFactory implements SchemeFactory { public BoltStatsStandardScheme getScheme() { return new BoltStatsStandardScheme(); } } private static class BoltStatsStandardScheme extends StandardScheme<BoltStats> { public void read(org.apache.thrift.protocol.TProtocol iprot, BoltStats struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // ACKED if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { org.apache.thrift.protocol.TMap _map90 = iprot.readMapBegin(); struct.acked = new HashMap<String,Map<GlobalStreamId,Long>>(2*_map90.size); for (int _i91 = 0; _i91 < _map90.size; ++_i91) { String _key92; // required Map<GlobalStreamId,Long> _val93; // required _key92 = iprot.readString(); { org.apache.thrift.protocol.TMap _map94 = iprot.readMapBegin(); _val93 = new HashMap<GlobalStreamId,Long>(2*_map94.size); for (int _i95 = 0; _i95 < _map94.size; ++_i95) { GlobalStreamId _key96; // required long _val97; // required _key96 = new GlobalStreamId(); _key96.read(iprot); _val97 = iprot.readI64(); _val93.put(_key96, _val97); } iprot.readMapEnd(); } struct.acked.put(_key92, _val93); } iprot.readMapEnd(); } struct.set_acked_isSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // FAILED if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { org.apache.thrift.protocol.TMap _map98 = iprot.readMapBegin(); struct.failed = new HashMap<String,Map<GlobalStreamId,Long>>(2*_map98.size); for (int _i99 = 0; _i99 < _map98.size; ++_i99) { String _key100; // required Map<GlobalStreamId,Long> _val101; // required _key100 = iprot.readString(); { org.apache.thrift.protocol.TMap _map102 = iprot.readMapBegin(); _val101 = new HashMap<GlobalStreamId,Long>(2*_map102.size); for (int _i103 = 0; _i103 < _map102.size; ++_i103) { GlobalStreamId _key104; // required long _val105; // required _key104 = new GlobalStreamId(); _key104.read(iprot); _val105 = iprot.readI64(); _val101.put(_key104, _val105); } iprot.readMapEnd(); } struct.failed.put(_key100, _val101); } iprot.readMapEnd(); } struct.set_failed_isSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // PROCESS_MS_AVG if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { org.apache.thrift.protocol.TMap _map106 = iprot.readMapBegin(); struct.process_ms_avg = new HashMap<String,Map<GlobalStreamId,Double>>(2*_map106.size); for (int _i107 = 0; _i107 < _map106.size; ++_i107) { String _key108; // required Map<GlobalStreamId,Double> _val109; // required _key108 = iprot.readString(); { org.apache.thrift.protocol.TMap _map110 = iprot.readMapBegin(); _val109 = new HashMap<GlobalStreamId,Double>(2*_map110.size); for (int _i111 = 0; _i111 < _map110.size; ++_i111) { GlobalStreamId _key112; // required double _val113; // required _key112 = new GlobalStreamId(); _key112.read(iprot); _val113 = iprot.readDouble(); _val109.put(_key112, _val113); } iprot.readMapEnd(); } struct.process_ms_avg.put(_key108, _val109); } iprot.readMapEnd(); } struct.set_process_ms_avg_isSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, BoltStats struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.acked != null) { oprot.writeFieldBegin(ACKED_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, struct.acked.size())); for (Map.Entry<String, Map<GlobalStreamId,Long>> _iter114 : struct.acked.entrySet()) { oprot.writeString(_iter114.getKey()); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.I64, _iter114.getValue().size())); for (Map.Entry<GlobalStreamId, Long> _iter115 : _iter114.getValue().entrySet()) { _iter115.getKey().write(oprot); oprot.writeI64(_iter115.getValue()); } oprot.writeMapEnd(); } } oprot.writeMapEnd(); } oprot.writeFieldEnd(); } if (struct.failed != null) { oprot.writeFieldBegin(FAILED_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, struct.failed.size())); for (Map.Entry<String, Map<GlobalStreamId,Long>> _iter116 : struct.failed.entrySet()) { oprot.writeString(_iter116.getKey()); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.I64, _iter116.getValue().size())); for (Map.Entry<GlobalStreamId, Long> _iter117 : _iter116.getValue().entrySet()) { _iter117.getKey().write(oprot); oprot.writeI64(_iter117.getValue()); } oprot.writeMapEnd(); } } oprot.writeMapEnd(); } oprot.writeFieldEnd(); } if (struct.process_ms_avg != null) { oprot.writeFieldBegin(PROCESS_MS_AVG_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, struct.process_ms_avg.size())); for (Map.Entry<String, Map<GlobalStreamId,Double>> _iter118 : struct.process_ms_avg.entrySet()) { oprot.writeString(_iter118.getKey()); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.DOUBLE, _iter118.getValue().size())); for (Map.Entry<GlobalStreamId, Double> _iter119 : _iter118.getValue().entrySet()) { _iter119.getKey().write(oprot); oprot.writeDouble(_iter119.getValue()); } oprot.writeMapEnd(); } } oprot.writeMapEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class BoltStatsTupleSchemeFactory implements SchemeFactory { public BoltStatsTupleScheme getScheme() { return new BoltStatsTupleScheme(); } } private static class BoltStatsTupleScheme extends TupleScheme<BoltStats> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, BoltStats struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; { oprot.writeI32(struct.acked.size()); for (Map.Entry<String, Map<GlobalStreamId,Long>> _iter120 : struct.acked.entrySet()) { oprot.writeString(_iter120.getKey()); { oprot.writeI32(_iter120.getValue().size()); for (Map.Entry<GlobalStreamId, Long> _iter121 : _iter120.getValue().entrySet()) { _iter121.getKey().write(oprot); oprot.writeI64(_iter121.getValue()); } } } } { oprot.writeI32(struct.failed.size()); for (Map.Entry<String, Map<GlobalStreamId,Long>> _iter122 : struct.failed.entrySet()) { oprot.writeString(_iter122.getKey()); { oprot.writeI32(_iter122.getValue().size()); for (Map.Entry<GlobalStreamId, Long> _iter123 : _iter122.getValue().entrySet()) { _iter123.getKey().write(oprot); oprot.writeI64(_iter123.getValue()); } } } } { oprot.writeI32(struct.process_ms_avg.size()); for (Map.Entry<String, Map<GlobalStreamId,Double>> _iter124 : struct.process_ms_avg.entrySet()) { oprot.writeString(_iter124.getKey()); { oprot.writeI32(_iter124.getValue().size()); for (Map.Entry<GlobalStreamId, Double> _iter125 : _iter124.getValue().entrySet()) { _iter125.getKey().write(oprot); oprot.writeDouble(_iter125.getValue()); } } } } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, BoltStats struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; { org.apache.thrift.protocol.TMap _map126 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, iprot.readI32()); struct.acked = new HashMap<String,Map<GlobalStreamId,Long>>(2*_map126.size); for (int _i127 = 0; _i127 < _map126.size; ++_i127) { String _key128; // required Map<GlobalStreamId,Long> _val129; // required _key128 = iprot.readString(); { org.apache.thrift.protocol.TMap _map130 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.I64, iprot.readI32()); _val129 = new HashMap<GlobalStreamId,Long>(2*_map130.size); for (int _i131 = 0; _i131 < _map130.size; ++_i131) { GlobalStreamId _key132; // required long _val133; // required _key132 = new GlobalStreamId(); _key132.read(iprot); _val133 = iprot.readI64(); _val129.put(_key132, _val133); } } struct.acked.put(_key128, _val129); } } struct.set_acked_isSet(true); { org.apache.thrift.protocol.TMap _map134 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, iprot.readI32()); struct.failed = new HashMap<String,Map<GlobalStreamId,Long>>(2*_map134.size); for (int _i135 = 0; _i135 < _map134.size; ++_i135) { String _key136; // required Map<GlobalStreamId,Long> _val137; // required _key136 = iprot.readString(); { org.apache.thrift.protocol.TMap _map138 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.I64, iprot.readI32()); _val137 = new HashMap<GlobalStreamId,Long>(2*_map138.size); for (int _i139 = 0; _i139 < _map138.size; ++_i139) { GlobalStreamId _key140; // required long _val141; // required _key140 = new GlobalStreamId(); _key140.read(iprot); _val141 = iprot.readI64(); _val137.put(_key140, _val141); } } struct.failed.put(_key136, _val137); } } struct.set_failed_isSet(true); { org.apache.thrift.protocol.TMap _map142 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, iprot.readI32()); struct.process_ms_avg = new HashMap<String,Map<GlobalStreamId,Double>>(2*_map142.size); for (int _i143 = 0; _i143 < _map142.size; ++_i143) { String _key144; // required Map<GlobalStreamId,Double> _val145; // required _key144 = iprot.readString(); { org.apache.thrift.protocol.TMap _map146 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.DOUBLE, iprot.readI32()); _val145 = new HashMap<GlobalStreamId,Double>(2*_map146.size); for (int _i147 = 0; _i147 < _map146.size; ++_i147) { GlobalStreamId _key148; // required double _val149; // required _key148 = new GlobalStreamId(); _key148.read(iprot); _val149 = iprot.readDouble(); _val145.put(_key148, _val149); } } struct.process_ms_avg.put(_key144, _val145); } } struct.set_process_ms_avg_isSet(true); } } }