http://git-wip-us.apache.org/repos/asf/storm/blob/1fd1e17f/storm-client/src/jvm/org/apache/storm/generated/ClusterWorkerHeartbeat.java ---------------------------------------------------------------------- diff --git a/storm-client/src/jvm/org/apache/storm/generated/ClusterWorkerHeartbeat.java b/storm-client/src/jvm/org/apache/storm/generated/ClusterWorkerHeartbeat.java index a2651cd..3c2d031 100644 --- a/storm-client/src/jvm/org/apache/storm/generated/ClusterWorkerHeartbeat.java +++ b/storm-client/src/jvm/org/apache/storm/generated/ClusterWorkerHeartbeat.java @@ -16,42 +16,15 @@ * limitations under the License. */ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.11.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.storm.generated; -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 org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -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 javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) [email protected](value = "Autogenerated by Thrift Compiler (0.11.0)") public class ClusterWorkerHeartbeat implements org.apache.thrift.TBase<ClusterWorkerHeartbeat, ClusterWorkerHeartbeat._Fields>, java.io.Serializable, Cloneable, Comparable<ClusterWorkerHeartbeat> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ClusterWorkerHeartbeat"); @@ -60,14 +33,11 @@ public class ClusterWorkerHeartbeat implements org.apache.thrift.TBase<ClusterWo private static final org.apache.thrift.protocol.TField TIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("time_secs", org.apache.thrift.protocol.TType.I32, (short)3); private static final org.apache.thrift.protocol.TField UPTIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("uptime_secs", org.apache.thrift.protocol.TType.I32, (short)4); - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new ClusterWorkerHeartbeatStandardSchemeFactory()); - schemes.put(TupleScheme.class, new ClusterWorkerHeartbeatTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new ClusterWorkerHeartbeatStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new ClusterWorkerHeartbeatTupleSchemeFactory(); - private String storm_id; // required - private Map<ExecutorInfo,ExecutorStats> executor_stats; // required + private java.lang.String storm_id; // required + private java.util.Map<ExecutorInfo,ExecutorStats> executor_stats; // required private int time_secs; // required private int uptime_secs; // required @@ -78,10 +48,10 @@ public class ClusterWorkerHeartbeat implements org.apache.thrift.TBase<ClusterWo TIME_SECS((short)3, "time_secs"), UPTIME_SECS((short)4, "uptime_secs"); - private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -110,21 +80,21 @@ public class ClusterWorkerHeartbeat implements org.apache.thrift.TBase<ClusterWo */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -133,7 +103,7 @@ public class ClusterWorkerHeartbeat implements org.apache.thrift.TBase<ClusterWo return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } @@ -142,9 +112,9 @@ public class ClusterWorkerHeartbeat implements org.apache.thrift.TBase<ClusterWo private static final int __TIME_SECS_ISSET_ID = 0; private static final int __UPTIME_SECS_ISSET_ID = 1; private byte __isset_bitfield = 0; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.STORM_ID, new org.apache.thrift.meta_data.FieldMetaData("storm_id", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.EXECUTOR_STATS, new org.apache.thrift.meta_data.FieldMetaData("executor_stats", org.apache.thrift.TFieldRequirementType.REQUIRED, @@ -155,7 +125,7 @@ public class ClusterWorkerHeartbeat implements org.apache.thrift.TBase<ClusterWo new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.UPTIME_SECS, new org.apache.thrift.meta_data.FieldMetaData("uptime_secs", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ClusterWorkerHeartbeat.class, metaDataMap); } @@ -163,8 +133,8 @@ public class ClusterWorkerHeartbeat implements org.apache.thrift.TBase<ClusterWo } public ClusterWorkerHeartbeat( - String storm_id, - Map<ExecutorInfo,ExecutorStats> executor_stats, + java.lang.String storm_id, + java.util.Map<ExecutorInfo,ExecutorStats> executor_stats, int time_secs, int uptime_secs) { @@ -186,8 +156,8 @@ public class ClusterWorkerHeartbeat implements org.apache.thrift.TBase<ClusterWo this.storm_id = other.storm_id; } if (other.is_set_executor_stats()) { - Map<ExecutorInfo,ExecutorStats> __this__executor_stats = new HashMap<ExecutorInfo,ExecutorStats>(other.executor_stats.size()); - for (Map.Entry<ExecutorInfo, ExecutorStats> other_element : other.executor_stats.entrySet()) { + java.util.Map<ExecutorInfo,ExecutorStats> __this__executor_stats = new java.util.HashMap<ExecutorInfo,ExecutorStats>(other.executor_stats.size()); + for (java.util.Map.Entry<ExecutorInfo, ExecutorStats> other_element : other.executor_stats.entrySet()) { ExecutorInfo other_element_key = other_element.getKey(); ExecutorStats other_element_value = other_element.getValue(); @@ -218,11 +188,11 @@ public class ClusterWorkerHeartbeat implements org.apache.thrift.TBase<ClusterWo this.uptime_secs = 0; } - public String get_storm_id() { + public java.lang.String get_storm_id() { return this.storm_id; } - public void set_storm_id(String storm_id) { + public void set_storm_id(java.lang.String storm_id) { this.storm_id = storm_id; } @@ -247,16 +217,16 @@ public class ClusterWorkerHeartbeat implements org.apache.thrift.TBase<ClusterWo public void put_to_executor_stats(ExecutorInfo key, ExecutorStats val) { if (this.executor_stats == null) { - this.executor_stats = new HashMap<ExecutorInfo,ExecutorStats>(); + this.executor_stats = new java.util.HashMap<ExecutorInfo,ExecutorStats>(); } this.executor_stats.put(key, val); } - public Map<ExecutorInfo,ExecutorStats> get_executor_stats() { + public java.util.Map<ExecutorInfo,ExecutorStats> get_executor_stats() { return this.executor_stats; } - public void set_executor_stats(Map<ExecutorInfo,ExecutorStats> executor_stats) { + public void set_executor_stats(java.util.Map<ExecutorInfo,ExecutorStats> executor_stats) { this.executor_stats = executor_stats; } @@ -285,16 +255,16 @@ public class ClusterWorkerHeartbeat implements org.apache.thrift.TBase<ClusterWo } public void unset_time_secs() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIME_SECS_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TIME_SECS_ISSET_ID); } /** Returns true if field time_secs is set (has been assigned a value) and false otherwise */ public boolean is_set_time_secs() { - return EncodingUtils.testBit(__isset_bitfield, __TIME_SECS_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TIME_SECS_ISSET_ID); } public void set_time_secs_isSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIME_SECS_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TIME_SECS_ISSET_ID, value); } public int get_uptime_secs() { @@ -307,25 +277,25 @@ public class ClusterWorkerHeartbeat implements org.apache.thrift.TBase<ClusterWo } public void unset_uptime_secs() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UPTIME_SECS_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __UPTIME_SECS_ISSET_ID); } /** Returns true if field uptime_secs is set (has been assigned a value) and false otherwise */ public boolean is_set_uptime_secs() { - return EncodingUtils.testBit(__isset_bitfield, __UPTIME_SECS_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __UPTIME_SECS_ISSET_ID); } public void set_uptime_secs_isSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UPTIME_SECS_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __UPTIME_SECS_ISSET_ID, value); } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case STORM_ID: if (value == null) { unset_storm_id(); } else { - set_storm_id((String)value); + set_storm_id((java.lang.String)value); } break; @@ -333,7 +303,7 @@ public class ClusterWorkerHeartbeat implements org.apache.thrift.TBase<ClusterWo if (value == null) { unset_executor_stats(); } else { - set_executor_stats((Map<ExecutorInfo,ExecutorStats>)value); + set_executor_stats((java.util.Map<ExecutorInfo,ExecutorStats>)value); } break; @@ -341,7 +311,7 @@ public class ClusterWorkerHeartbeat implements org.apache.thrift.TBase<ClusterWo if (value == null) { unset_time_secs(); } else { - set_time_secs((Integer)value); + set_time_secs((java.lang.Integer)value); } break; @@ -349,14 +319,14 @@ public class ClusterWorkerHeartbeat implements org.apache.thrift.TBase<ClusterWo if (value == null) { unset_uptime_secs(); } else { - set_uptime_secs((Integer)value); + set_uptime_secs((java.lang.Integer)value); } break; } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case STORM_ID: return get_storm_id(); @@ -371,13 +341,13 @@ public class ClusterWorkerHeartbeat implements org.apache.thrift.TBase<ClusterWo return get_uptime_secs(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -390,11 +360,11 @@ public class ClusterWorkerHeartbeat implements org.apache.thrift.TBase<ClusterWo case UPTIME_SECS: return is_set_uptime_secs(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof ClusterWorkerHeartbeat) @@ -405,6 +375,8 @@ public class ClusterWorkerHeartbeat implements org.apache.thrift.TBase<ClusterWo public boolean equals(ClusterWorkerHeartbeat that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_storm_id = true && this.is_set_storm_id(); boolean that_present_storm_id = true && that.is_set_storm_id(); @@ -447,29 +419,21 @@ public class ClusterWorkerHeartbeat implements org.apache.thrift.TBase<ClusterWo @Override public int hashCode() { - List<Object> list = new ArrayList<Object>(); + int hashCode = 1; - boolean present_storm_id = true && (is_set_storm_id()); - list.add(present_storm_id); - if (present_storm_id) - list.add(storm_id); + hashCode = hashCode * 8191 + ((is_set_storm_id()) ? 131071 : 524287); + if (is_set_storm_id()) + hashCode = hashCode * 8191 + storm_id.hashCode(); - boolean present_executor_stats = true && (is_set_executor_stats()); - list.add(present_executor_stats); - if (present_executor_stats) - list.add(executor_stats); + hashCode = hashCode * 8191 + ((is_set_executor_stats()) ? 131071 : 524287); + if (is_set_executor_stats()) + hashCode = hashCode * 8191 + executor_stats.hashCode(); - boolean present_time_secs = true; - list.add(present_time_secs); - if (present_time_secs) - list.add(time_secs); + hashCode = hashCode * 8191 + time_secs; - boolean present_uptime_secs = true; - list.add(present_uptime_secs); - if (present_uptime_secs) - list.add(uptime_secs); + hashCode = hashCode * 8191 + uptime_secs; - return list.hashCode(); + return hashCode; } @Override @@ -480,7 +444,7 @@ public class ClusterWorkerHeartbeat implements org.apache.thrift.TBase<ClusterWo int lastComparison = 0; - lastComparison = Boolean.valueOf(is_set_storm_id()).compareTo(other.is_set_storm_id()); + lastComparison = java.lang.Boolean.valueOf(is_set_storm_id()).compareTo(other.is_set_storm_id()); if (lastComparison != 0) { return lastComparison; } @@ -490,7 +454,7 @@ public class ClusterWorkerHeartbeat implements org.apache.thrift.TBase<ClusterWo return lastComparison; } } - lastComparison = Boolean.valueOf(is_set_executor_stats()).compareTo(other.is_set_executor_stats()); + lastComparison = java.lang.Boolean.valueOf(is_set_executor_stats()).compareTo(other.is_set_executor_stats()); if (lastComparison != 0) { return lastComparison; } @@ -500,7 +464,7 @@ public class ClusterWorkerHeartbeat implements org.apache.thrift.TBase<ClusterWo return lastComparison; } } - lastComparison = Boolean.valueOf(is_set_time_secs()).compareTo(other.is_set_time_secs()); + lastComparison = java.lang.Boolean.valueOf(is_set_time_secs()).compareTo(other.is_set_time_secs()); if (lastComparison != 0) { return lastComparison; } @@ -510,7 +474,7 @@ public class ClusterWorkerHeartbeat implements org.apache.thrift.TBase<ClusterWo return lastComparison; } } - lastComparison = Boolean.valueOf(is_set_uptime_secs()).compareTo(other.is_set_uptime_secs()); + lastComparison = java.lang.Boolean.valueOf(is_set_uptime_secs()).compareTo(other.is_set_uptime_secs()); if (lastComparison != 0) { return lastComparison; } @@ -528,16 +492,16 @@ public class ClusterWorkerHeartbeat implements org.apache.thrift.TBase<ClusterWo } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("ClusterWorkerHeartbeat("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("ClusterWorkerHeartbeat("); boolean first = true; sb.append("storm_id:"); @@ -596,7 +560,7 @@ public class ClusterWorkerHeartbeat implements org.apache.thrift.TBase<ClusterWo } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -606,13 +570,13 @@ public class ClusterWorkerHeartbeat implements org.apache.thrift.TBase<ClusterWo } } - private static class ClusterWorkerHeartbeatStandardSchemeFactory implements SchemeFactory { + private static class ClusterWorkerHeartbeatStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public ClusterWorkerHeartbeatStandardScheme getScheme() { return new ClusterWorkerHeartbeatStandardScheme(); } } - private static class ClusterWorkerHeartbeatStandardScheme extends StandardScheme<ClusterWorkerHeartbeat> { + private static class ClusterWorkerHeartbeatStandardScheme extends org.apache.thrift.scheme.StandardScheme<ClusterWorkerHeartbeat> { public void read(org.apache.thrift.protocol.TProtocol iprot, ClusterWorkerHeartbeat struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -636,7 +600,7 @@ public class ClusterWorkerHeartbeat implements org.apache.thrift.TBase<ClusterWo if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { org.apache.thrift.protocol.TMap _map772 = iprot.readMapBegin(); - struct.executor_stats = new HashMap<ExecutorInfo,ExecutorStats>(2*_map772.size); + struct.executor_stats = new java.util.HashMap<ExecutorInfo,ExecutorStats>(2*_map772.size); ExecutorInfo _key773; ExecutorStats _val774; for (int _i775 = 0; _i775 < _map772.size; ++_i775) @@ -692,7 +656,7 @@ public class ClusterWorkerHeartbeat implements org.apache.thrift.TBase<ClusterWo oprot.writeFieldBegin(EXECUTOR_STATS_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.STRUCT, struct.executor_stats.size())); - for (Map.Entry<ExecutorInfo, ExecutorStats> _iter776 : struct.executor_stats.entrySet()) + for (java.util.Map.Entry<ExecutorInfo, ExecutorStats> _iter776 : struct.executor_stats.entrySet()) { _iter776.getKey().write(oprot); _iter776.getValue().write(oprot); @@ -713,21 +677,21 @@ public class ClusterWorkerHeartbeat implements org.apache.thrift.TBase<ClusterWo } - private static class ClusterWorkerHeartbeatTupleSchemeFactory implements SchemeFactory { + private static class ClusterWorkerHeartbeatTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public ClusterWorkerHeartbeatTupleScheme getScheme() { return new ClusterWorkerHeartbeatTupleScheme(); } } - private static class ClusterWorkerHeartbeatTupleScheme extends TupleScheme<ClusterWorkerHeartbeat> { + private static class ClusterWorkerHeartbeatTupleScheme extends org.apache.thrift.scheme.TupleScheme<ClusterWorkerHeartbeat> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, ClusterWorkerHeartbeat struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; oprot.writeString(struct.storm_id); { oprot.writeI32(struct.executor_stats.size()); - for (Map.Entry<ExecutorInfo, ExecutorStats> _iter777 : struct.executor_stats.entrySet()) + for (java.util.Map.Entry<ExecutorInfo, ExecutorStats> _iter777 : struct.executor_stats.entrySet()) { _iter777.getKey().write(oprot); _iter777.getValue().write(oprot); @@ -739,12 +703,12 @@ public class ClusterWorkerHeartbeat implements org.apache.thrift.TBase<ClusterWo @Override public void read(org.apache.thrift.protocol.TProtocol prot, ClusterWorkerHeartbeat struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.storm_id = iprot.readString(); struct.set_storm_id_isSet(true); { org.apache.thrift.protocol.TMap _map778 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.executor_stats = new HashMap<ExecutorInfo,ExecutorStats>(2*_map778.size); + struct.executor_stats = new java.util.HashMap<ExecutorInfo,ExecutorStats>(2*_map778.size); ExecutorInfo _key779; ExecutorStats _val780; for (int _i781 = 0; _i781 < _map778.size; ++_i781) @@ -764,5 +728,8 @@ public class ClusterWorkerHeartbeat implements org.apache.thrift.TBase<ClusterWo } } + private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } }
http://git-wip-us.apache.org/repos/asf/storm/blob/1fd1e17f/storm-client/src/jvm/org/apache/storm/generated/CommonAggregateStats.java ---------------------------------------------------------------------- diff --git a/storm-client/src/jvm/org/apache/storm/generated/CommonAggregateStats.java b/storm-client/src/jvm/org/apache/storm/generated/CommonAggregateStats.java index 991ac60..44be3cc 100644 --- a/storm-client/src/jvm/org/apache/storm/generated/CommonAggregateStats.java +++ b/storm-client/src/jvm/org/apache/storm/generated/CommonAggregateStats.java @@ -16,42 +16,15 @@ * limitations under the License. */ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.11.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.storm.generated; -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 org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -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 javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) [email protected](value = "Autogenerated by Thrift Compiler (0.11.0)") public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggregateStats, CommonAggregateStats._Fields>, java.io.Serializable, Cloneable, Comparable<CommonAggregateStats> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CommonAggregateStats"); @@ -63,11 +36,8 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre private static final org.apache.thrift.protocol.TField FAILED_FIELD_DESC = new org.apache.thrift.protocol.TField("failed", org.apache.thrift.protocol.TType.I64, (short)6); private static final org.apache.thrift.protocol.TField RESOURCES_MAP_FIELD_DESC = new org.apache.thrift.protocol.TField("resources_map", org.apache.thrift.protocol.TType.MAP, (short)7); - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new CommonAggregateStatsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new CommonAggregateStatsTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new CommonAggregateStatsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new CommonAggregateStatsTupleSchemeFactory(); private int num_executors; // optional private int num_tasks; // optional @@ -75,7 +45,7 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre private long transferred; // optional private long acked; // optional private long failed; // optional - private Map<String,Double> resources_map; // optional + private java.util.Map<java.lang.String,java.lang.Double> resources_map; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -87,10 +57,10 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre FAILED((short)6, "failed"), RESOURCES_MAP((short)7, "resources_map"); - private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -125,21 +95,21 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -148,7 +118,7 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } @@ -162,9 +132,9 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre private static final int __FAILED_ISSET_ID = 5; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.NUM_EXECUTORS,_Fields.NUM_TASKS,_Fields.EMITTED,_Fields.TRANSFERRED,_Fields.ACKED,_Fields.FAILED,_Fields.RESOURCES_MAP}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.NUM_EXECUTORS, new org.apache.thrift.meta_data.FieldMetaData("num_executors", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.NUM_TASKS, new org.apache.thrift.meta_data.FieldMetaData("num_tasks", org.apache.thrift.TFieldRequirementType.OPTIONAL, @@ -181,7 +151,7 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre 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.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CommonAggregateStats.class, metaDataMap); } @@ -200,7 +170,7 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre this.acked = other.acked; this.failed = other.failed; if (other.is_set_resources_map()) { - Map<String,Double> __this__resources_map = new HashMap<String,Double>(other.resources_map); + java.util.Map<java.lang.String,java.lang.Double> __this__resources_map = new java.util.HashMap<java.lang.String,java.lang.Double>(other.resources_map); this.resources_map = __this__resources_map; } } @@ -236,16 +206,16 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre } public void unset_num_executors() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NUM_EXECUTORS_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __NUM_EXECUTORS_ISSET_ID); } /** Returns true if field num_executors is set (has been assigned a value) and false otherwise */ public boolean is_set_num_executors() { - return EncodingUtils.testBit(__isset_bitfield, __NUM_EXECUTORS_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __NUM_EXECUTORS_ISSET_ID); } public void set_num_executors_isSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NUM_EXECUTORS_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __NUM_EXECUTORS_ISSET_ID, value); } public int get_num_tasks() { @@ -258,16 +228,16 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre } public void unset_num_tasks() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NUM_TASKS_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __NUM_TASKS_ISSET_ID); } /** Returns true if field num_tasks is set (has been assigned a value) and false otherwise */ public boolean is_set_num_tasks() { - return EncodingUtils.testBit(__isset_bitfield, __NUM_TASKS_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __NUM_TASKS_ISSET_ID); } public void set_num_tasks_isSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NUM_TASKS_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __NUM_TASKS_ISSET_ID, value); } public long get_emitted() { @@ -280,16 +250,16 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre } public void unset_emitted() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __EMITTED_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __EMITTED_ISSET_ID); } /** Returns true if field emitted is set (has been assigned a value) and false otherwise */ public boolean is_set_emitted() { - return EncodingUtils.testBit(__isset_bitfield, __EMITTED_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __EMITTED_ISSET_ID); } public void set_emitted_isSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __EMITTED_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __EMITTED_ISSET_ID, value); } public long get_transferred() { @@ -302,16 +272,16 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre } public void unset_transferred() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TRANSFERRED_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TRANSFERRED_ISSET_ID); } /** Returns true if field transferred is set (has been assigned a value) and false otherwise */ public boolean is_set_transferred() { - return EncodingUtils.testBit(__isset_bitfield, __TRANSFERRED_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TRANSFERRED_ISSET_ID); } public void set_transferred_isSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TRANSFERRED_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TRANSFERRED_ISSET_ID, value); } public long get_acked() { @@ -324,16 +294,16 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre } public void unset_acked() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ACKED_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ACKED_ISSET_ID); } /** Returns true if field acked is set (has been assigned a value) and false otherwise */ public boolean is_set_acked() { - return EncodingUtils.testBit(__isset_bitfield, __ACKED_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ACKED_ISSET_ID); } public void set_acked_isSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ACKED_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ACKED_ISSET_ID, value); } public long get_failed() { @@ -346,34 +316,34 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre } public void unset_failed() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FAILED_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __FAILED_ISSET_ID); } /** Returns true if field failed is set (has been assigned a value) and false otherwise */ public boolean is_set_failed() { - return EncodingUtils.testBit(__isset_bitfield, __FAILED_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __FAILED_ISSET_ID); } public void set_failed_isSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FAILED_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __FAILED_ISSET_ID, value); } public int get_resources_map_size() { return (this.resources_map == null) ? 0 : this.resources_map.size(); } - public void put_to_resources_map(String key, double val) { + public void put_to_resources_map(java.lang.String key, double val) { if (this.resources_map == null) { - this.resources_map = new HashMap<String,Double>(); + this.resources_map = new java.util.HashMap<java.lang.String,java.lang.Double>(); } this.resources_map.put(key, val); } - public Map<String,Double> get_resources_map() { + public java.util.Map<java.lang.String,java.lang.Double> get_resources_map() { return this.resources_map; } - public void set_resources_map(Map<String,Double> resources_map) { + public void set_resources_map(java.util.Map<java.lang.String,java.lang.Double> resources_map) { this.resources_map = resources_map; } @@ -392,13 +362,13 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case NUM_EXECUTORS: if (value == null) { unset_num_executors(); } else { - set_num_executors((Integer)value); + set_num_executors((java.lang.Integer)value); } break; @@ -406,7 +376,7 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre if (value == null) { unset_num_tasks(); } else { - set_num_tasks((Integer)value); + set_num_tasks((java.lang.Integer)value); } break; @@ -414,7 +384,7 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre if (value == null) { unset_emitted(); } else { - set_emitted((Long)value); + set_emitted((java.lang.Long)value); } break; @@ -422,7 +392,7 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre if (value == null) { unset_transferred(); } else { - set_transferred((Long)value); + set_transferred((java.lang.Long)value); } break; @@ -430,7 +400,7 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre if (value == null) { unset_acked(); } else { - set_acked((Long)value); + set_acked((java.lang.Long)value); } break; @@ -438,7 +408,7 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre if (value == null) { unset_failed(); } else { - set_failed((Long)value); + set_failed((java.lang.Long)value); } break; @@ -446,14 +416,14 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre if (value == null) { unset_resources_map(); } else { - set_resources_map((Map<String,Double>)value); + set_resources_map((java.util.Map<java.lang.String,java.lang.Double>)value); } break; } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case NUM_EXECUTORS: return get_num_executors(); @@ -477,13 +447,13 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre return get_resources_map(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -502,11 +472,11 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre case RESOURCES_MAP: return is_set_resources_map(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof CommonAggregateStats) @@ -517,6 +487,8 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre public boolean equals(CommonAggregateStats that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_num_executors = true && this.is_set_num_executors(); boolean that_present_num_executors = true && that.is_set_num_executors(); @@ -586,44 +558,37 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre @Override public int hashCode() { - List<Object> list = new ArrayList<Object>(); - - boolean present_num_executors = true && (is_set_num_executors()); - list.add(present_num_executors); - if (present_num_executors) - list.add(num_executors); - - boolean present_num_tasks = true && (is_set_num_tasks()); - list.add(present_num_tasks); - if (present_num_tasks) - list.add(num_tasks); - - boolean present_emitted = true && (is_set_emitted()); - list.add(present_emitted); - if (present_emitted) - list.add(emitted); - - boolean present_transferred = true && (is_set_transferred()); - list.add(present_transferred); - if (present_transferred) - list.add(transferred); - - boolean present_acked = true && (is_set_acked()); - list.add(present_acked); - if (present_acked) - list.add(acked); - - boolean present_failed = true && (is_set_failed()); - list.add(present_failed); - if (present_failed) - list.add(failed); - - boolean present_resources_map = true && (is_set_resources_map()); - list.add(present_resources_map); - if (present_resources_map) - list.add(resources_map); - - return list.hashCode(); + int hashCode = 1; + + hashCode = hashCode * 8191 + ((is_set_num_executors()) ? 131071 : 524287); + if (is_set_num_executors()) + hashCode = hashCode * 8191 + num_executors; + + hashCode = hashCode * 8191 + ((is_set_num_tasks()) ? 131071 : 524287); + if (is_set_num_tasks()) + hashCode = hashCode * 8191 + num_tasks; + + hashCode = hashCode * 8191 + ((is_set_emitted()) ? 131071 : 524287); + if (is_set_emitted()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(emitted); + + hashCode = hashCode * 8191 + ((is_set_transferred()) ? 131071 : 524287); + if (is_set_transferred()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(transferred); + + hashCode = hashCode * 8191 + ((is_set_acked()) ? 131071 : 524287); + if (is_set_acked()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(acked); + + hashCode = hashCode * 8191 + ((is_set_failed()) ? 131071 : 524287); + if (is_set_failed()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(failed); + + hashCode = hashCode * 8191 + ((is_set_resources_map()) ? 131071 : 524287); + if (is_set_resources_map()) + hashCode = hashCode * 8191 + resources_map.hashCode(); + + return hashCode; } @Override @@ -634,7 +599,7 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre int lastComparison = 0; - lastComparison = Boolean.valueOf(is_set_num_executors()).compareTo(other.is_set_num_executors()); + lastComparison = java.lang.Boolean.valueOf(is_set_num_executors()).compareTo(other.is_set_num_executors()); if (lastComparison != 0) { return lastComparison; } @@ -644,7 +609,7 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre return lastComparison; } } - lastComparison = Boolean.valueOf(is_set_num_tasks()).compareTo(other.is_set_num_tasks()); + lastComparison = java.lang.Boolean.valueOf(is_set_num_tasks()).compareTo(other.is_set_num_tasks()); if (lastComparison != 0) { return lastComparison; } @@ -654,7 +619,7 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre return lastComparison; } } - lastComparison = Boolean.valueOf(is_set_emitted()).compareTo(other.is_set_emitted()); + lastComparison = java.lang.Boolean.valueOf(is_set_emitted()).compareTo(other.is_set_emitted()); if (lastComparison != 0) { return lastComparison; } @@ -664,7 +629,7 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre return lastComparison; } } - lastComparison = Boolean.valueOf(is_set_transferred()).compareTo(other.is_set_transferred()); + lastComparison = java.lang.Boolean.valueOf(is_set_transferred()).compareTo(other.is_set_transferred()); if (lastComparison != 0) { return lastComparison; } @@ -674,7 +639,7 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre return lastComparison; } } - lastComparison = Boolean.valueOf(is_set_acked()).compareTo(other.is_set_acked()); + lastComparison = java.lang.Boolean.valueOf(is_set_acked()).compareTo(other.is_set_acked()); if (lastComparison != 0) { return lastComparison; } @@ -684,7 +649,7 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre return lastComparison; } } - lastComparison = Boolean.valueOf(is_set_failed()).compareTo(other.is_set_failed()); + lastComparison = java.lang.Boolean.valueOf(is_set_failed()).compareTo(other.is_set_failed()); if (lastComparison != 0) { return lastComparison; } @@ -694,7 +659,7 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre return lastComparison; } } - lastComparison = Boolean.valueOf(is_set_resources_map()).compareTo(other.is_set_resources_map()); + lastComparison = java.lang.Boolean.valueOf(is_set_resources_map()).compareTo(other.is_set_resources_map()); if (lastComparison != 0) { return lastComparison; } @@ -712,16 +677,16 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("CommonAggregateStats("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("CommonAggregateStats("); boolean first = true; if (is_set_num_executors()) { @@ -786,7 +751,7 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -796,13 +761,13 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre } } - private static class CommonAggregateStatsStandardSchemeFactory implements SchemeFactory { + private static class CommonAggregateStatsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public CommonAggregateStatsStandardScheme getScheme() { return new CommonAggregateStatsStandardScheme(); } } - private static class CommonAggregateStatsStandardScheme extends StandardScheme<CommonAggregateStats> { + private static class CommonAggregateStatsStandardScheme extends org.apache.thrift.scheme.StandardScheme<CommonAggregateStats> { public void read(org.apache.thrift.protocol.TProtocol iprot, CommonAggregateStats struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -866,8 +831,8 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { org.apache.thrift.protocol.TMap _map396 = iprot.readMapBegin(); - struct.resources_map = new HashMap<String,Double>(2*_map396.size); - String _key397; + struct.resources_map = new java.util.HashMap<java.lang.String,java.lang.Double>(2*_map396.size); + java.lang.String _key397; double _val398; for (int _i399 = 0; _i399 < _map396.size; ++_i399) { @@ -930,7 +895,7 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre oprot.writeFieldBegin(RESOURCES_MAP_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.DOUBLE, struct.resources_map.size())); - for (Map.Entry<String, Double> _iter400 : struct.resources_map.entrySet()) + for (java.util.Map.Entry<java.lang.String, java.lang.Double> _iter400 : struct.resources_map.entrySet()) { oprot.writeString(_iter400.getKey()); oprot.writeDouble(_iter400.getValue()); @@ -946,18 +911,18 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre } - private static class CommonAggregateStatsTupleSchemeFactory implements SchemeFactory { + private static class CommonAggregateStatsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public CommonAggregateStatsTupleScheme getScheme() { return new CommonAggregateStatsTupleScheme(); } } - private static class CommonAggregateStatsTupleScheme extends TupleScheme<CommonAggregateStats> { + private static class CommonAggregateStatsTupleScheme extends org.apache.thrift.scheme.TupleScheme<CommonAggregateStats> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, CommonAggregateStats struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.is_set_num_executors()) { optionals.set(0); } @@ -1001,7 +966,7 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre if (struct.is_set_resources_map()) { { oprot.writeI32(struct.resources_map.size()); - for (Map.Entry<String, Double> _iter401 : struct.resources_map.entrySet()) + for (java.util.Map.Entry<java.lang.String, java.lang.Double> _iter401 : struct.resources_map.entrySet()) { oprot.writeString(_iter401.getKey()); oprot.writeDouble(_iter401.getValue()); @@ -1012,8 +977,8 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre @Override public void read(org.apache.thrift.protocol.TProtocol prot, CommonAggregateStats struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(7); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(7); if (incoming.get(0)) { struct.num_executors = iprot.readI32(); struct.set_num_executors_isSet(true); @@ -1041,8 +1006,8 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre if (incoming.get(6)) { { org.apache.thrift.protocol.TMap _map402 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.DOUBLE, iprot.readI32()); - struct.resources_map = new HashMap<String,Double>(2*_map402.size); - String _key403; + struct.resources_map = new java.util.HashMap<java.lang.String,java.lang.Double>(2*_map402.size); + java.lang.String _key403; double _val404; for (int _i405 = 0; _i405 < _map402.size; ++_i405) { @@ -1056,5 +1021,8 @@ public class CommonAggregateStats implements org.apache.thrift.TBase<CommonAggre } } + private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } http://git-wip-us.apache.org/repos/asf/storm/blob/1fd1e17f/storm-client/src/jvm/org/apache/storm/generated/ComponentAggregateStats.java ---------------------------------------------------------------------- diff --git a/storm-client/src/jvm/org/apache/storm/generated/ComponentAggregateStats.java b/storm-client/src/jvm/org/apache/storm/generated/ComponentAggregateStats.java index 2c68331..83a7fae 100644 --- a/storm-client/src/jvm/org/apache/storm/generated/ComponentAggregateStats.java +++ b/storm-client/src/jvm/org/apache/storm/generated/ComponentAggregateStats.java @@ -16,42 +16,15 @@ * limitations under the License. */ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.11.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.storm.generated; -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 org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -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 javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) [email protected](value = "Autogenerated by Thrift Compiler (0.11.0)") public class ComponentAggregateStats implements org.apache.thrift.TBase<ComponentAggregateStats, ComponentAggregateStats._Fields>, java.io.Serializable, Cloneable, Comparable<ComponentAggregateStats> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ComponentAggregateStats"); @@ -60,11 +33,8 @@ public class ComponentAggregateStats implements org.apache.thrift.TBase<Componen private static final org.apache.thrift.protocol.TField SPECIFIC_STATS_FIELD_DESC = new org.apache.thrift.protocol.TField("specific_stats", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final org.apache.thrift.protocol.TField LAST_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("last_error", org.apache.thrift.protocol.TType.STRUCT, (short)4); - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new ComponentAggregateStatsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new ComponentAggregateStatsTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new ComponentAggregateStatsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new ComponentAggregateStatsTupleSchemeFactory(); private ComponentType type; // optional private CommonAggregateStats common_stats; // optional @@ -82,10 +52,10 @@ public class ComponentAggregateStats implements org.apache.thrift.TBase<Componen SPECIFIC_STATS((short)3, "specific_stats"), LAST_ERROR((short)4, "last_error"); - private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -114,21 +84,21 @@ public class ComponentAggregateStats implements org.apache.thrift.TBase<Componen */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -137,16 +107,16 @@ public class ComponentAggregateStats implements org.apache.thrift.TBase<Componen return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.TYPE,_Fields.COMMON_STATS,_Fields.SPECIFIC_STATS,_Fields.LAST_ERROR}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ComponentType.class))); tmpMap.put(_Fields.COMMON_STATS, new org.apache.thrift.meta_data.FieldMetaData("common_stats", org.apache.thrift.TFieldRequirementType.OPTIONAL, @@ -155,7 +125,7 @@ public class ComponentAggregateStats implements org.apache.thrift.TBase<Componen new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SpecificAggregateStats.class))); tmpMap.put(_Fields.LAST_ERROR, new org.apache.thrift.meta_data.FieldMetaData("last_error", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ErrorInfo.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ComponentAggregateStats.class, metaDataMap); } @@ -292,7 +262,7 @@ public class ComponentAggregateStats implements org.apache.thrift.TBase<Componen } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case TYPE: if (value == null) { @@ -329,7 +299,7 @@ public class ComponentAggregateStats implements org.apache.thrift.TBase<Componen } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case TYPE: return get_type(); @@ -344,13 +314,13 @@ public class ComponentAggregateStats implements org.apache.thrift.TBase<Componen return get_last_error(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -363,11 +333,11 @@ public class ComponentAggregateStats implements org.apache.thrift.TBase<Componen case LAST_ERROR: return is_set_last_error(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof ComponentAggregateStats) @@ -378,6 +348,8 @@ public class ComponentAggregateStats implements org.apache.thrift.TBase<Componen public boolean equals(ComponentAggregateStats that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_type = true && this.is_set_type(); boolean that_present_type = true && that.is_set_type(); @@ -420,29 +392,25 @@ public class ComponentAggregateStats implements org.apache.thrift.TBase<Componen @Override public int hashCode() { - List<Object> list = new ArrayList<Object>(); + int hashCode = 1; - boolean present_type = true && (is_set_type()); - list.add(present_type); - if (present_type) - list.add(type.getValue()); + hashCode = hashCode * 8191 + ((is_set_type()) ? 131071 : 524287); + if (is_set_type()) + hashCode = hashCode * 8191 + type.getValue(); - boolean present_common_stats = true && (is_set_common_stats()); - list.add(present_common_stats); - if (present_common_stats) - list.add(common_stats); + hashCode = hashCode * 8191 + ((is_set_common_stats()) ? 131071 : 524287); + if (is_set_common_stats()) + hashCode = hashCode * 8191 + common_stats.hashCode(); - boolean present_specific_stats = true && (is_set_specific_stats()); - list.add(present_specific_stats); - if (present_specific_stats) - list.add(specific_stats); + hashCode = hashCode * 8191 + ((is_set_specific_stats()) ? 131071 : 524287); + if (is_set_specific_stats()) + hashCode = hashCode * 8191 + specific_stats.hashCode(); - boolean present_last_error = true && (is_set_last_error()); - list.add(present_last_error); - if (present_last_error) - list.add(last_error); + hashCode = hashCode * 8191 + ((is_set_last_error()) ? 131071 : 524287); + if (is_set_last_error()) + hashCode = hashCode * 8191 + last_error.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -453,7 +421,7 @@ public class ComponentAggregateStats implements org.apache.thrift.TBase<Componen int lastComparison = 0; - lastComparison = Boolean.valueOf(is_set_type()).compareTo(other.is_set_type()); + lastComparison = java.lang.Boolean.valueOf(is_set_type()).compareTo(other.is_set_type()); if (lastComparison != 0) { return lastComparison; } @@ -463,7 +431,7 @@ public class ComponentAggregateStats implements org.apache.thrift.TBase<Componen return lastComparison; } } - lastComparison = Boolean.valueOf(is_set_common_stats()).compareTo(other.is_set_common_stats()); + lastComparison = java.lang.Boolean.valueOf(is_set_common_stats()).compareTo(other.is_set_common_stats()); if (lastComparison != 0) { return lastComparison; } @@ -473,7 +441,7 @@ public class ComponentAggregateStats implements org.apache.thrift.TBase<Componen return lastComparison; } } - lastComparison = Boolean.valueOf(is_set_specific_stats()).compareTo(other.is_set_specific_stats()); + lastComparison = java.lang.Boolean.valueOf(is_set_specific_stats()).compareTo(other.is_set_specific_stats()); if (lastComparison != 0) { return lastComparison; } @@ -483,7 +451,7 @@ public class ComponentAggregateStats implements org.apache.thrift.TBase<Componen return lastComparison; } } - lastComparison = Boolean.valueOf(is_set_last_error()).compareTo(other.is_set_last_error()); + lastComparison = java.lang.Boolean.valueOf(is_set_last_error()).compareTo(other.is_set_last_error()); if (lastComparison != 0) { return lastComparison; } @@ -501,16 +469,16 @@ public class ComponentAggregateStats implements org.apache.thrift.TBase<Componen } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("ComponentAggregateStats("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("ComponentAggregateStats("); boolean first = true; if (is_set_type()) { @@ -575,7 +543,7 @@ public class ComponentAggregateStats implements org.apache.thrift.TBase<Componen } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -583,13 +551,13 @@ public class ComponentAggregateStats implements org.apache.thrift.TBase<Componen } } - private static class ComponentAggregateStatsStandardSchemeFactory implements SchemeFactory { + private static class ComponentAggregateStatsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public ComponentAggregateStatsStandardScheme getScheme() { return new ComponentAggregateStatsStandardScheme(); } } - private static class ComponentAggregateStatsStandardScheme extends StandardScheme<ComponentAggregateStats> { + private static class ComponentAggregateStatsStandardScheme extends org.apache.thrift.scheme.StandardScheme<ComponentAggregateStats> { public void read(org.apache.thrift.protocol.TProtocol iprot, ComponentAggregateStats struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -683,18 +651,18 @@ public class ComponentAggregateStats implements org.apache.thrift.TBase<Componen } - private static class ComponentAggregateStatsTupleSchemeFactory implements SchemeFactory { + private static class ComponentAggregateStatsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public ComponentAggregateStatsTupleScheme getScheme() { return new ComponentAggregateStatsTupleScheme(); } } - private static class ComponentAggregateStatsTupleScheme extends TupleScheme<ComponentAggregateStats> { + private static class ComponentAggregateStatsTupleScheme extends org.apache.thrift.scheme.TupleScheme<ComponentAggregateStats> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, ComponentAggregateStats struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.is_set_type()) { optionals.set(0); } @@ -724,8 +692,8 @@ public class ComponentAggregateStats implements org.apache.thrift.TBase<Componen @Override public void read(org.apache.thrift.protocol.TProtocol prot, ComponentAggregateStats struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(4); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { struct.type = org.apache.storm.generated.ComponentType.findByValue(iprot.readI32()); struct.set_type_isSet(true); @@ -748,5 +716,8 @@ public class ComponentAggregateStats implements org.apache.thrift.TBase<Componen } } + private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } }
