http://git-wip-us.apache.org/repos/asf/storm/blob/1fd1e17f/storm-client/src/jvm/org/apache/storm/generated/SupervisorWorkerHeartbeats.java ---------------------------------------------------------------------- diff --git a/storm-client/src/jvm/org/apache/storm/generated/SupervisorWorkerHeartbeats.java b/storm-client/src/jvm/org/apache/storm/generated/SupervisorWorkerHeartbeats.java index 2856869..bc10f7f 100644 --- a/storm-client/src/jvm/org/apache/storm/generated/SupervisorWorkerHeartbeats.java +++ b/storm-client/src/jvm/org/apache/storm/generated/SupervisorWorkerHeartbeats.java @@ -16,66 +16,36 @@ * 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 SupervisorWorkerHeartbeats implements org.apache.thrift.TBase<SupervisorWorkerHeartbeats, SupervisorWorkerHeartbeats._Fields>, java.io.Serializable, Cloneable, Comparable<SupervisorWorkerHeartbeats> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SupervisorWorkerHeartbeats"); private static final org.apache.thrift.protocol.TField SUPERVISOR_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("supervisor_id", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField WORKER_HEARTBEATS_FIELD_DESC = new org.apache.thrift.protocol.TField("worker_heartbeats", org.apache.thrift.protocol.TType.LIST, (short)2); - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new SupervisorWorkerHeartbeatsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new SupervisorWorkerHeartbeatsTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new SupervisorWorkerHeartbeatsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new SupervisorWorkerHeartbeatsTupleSchemeFactory(); - private String supervisor_id; // required - private List<SupervisorWorkerHeartbeat> worker_heartbeats; // required + private java.lang.String supervisor_id; // required + private java.util.List<SupervisorWorkerHeartbeat> worker_heartbeats; // 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 { SUPERVISOR_ID((short)1, "supervisor_id"), WORKER_HEARTBEATS((short)2, "worker_heartbeats"); - 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); } } @@ -100,21 +70,21 @@ public class SupervisorWorkerHeartbeats implements org.apache.thrift.TBase<Super */ 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; } @@ -123,21 +93,21 @@ public class SupervisorWorkerHeartbeats implements org.apache.thrift.TBase<Super return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - 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.SUPERVISOR_ID, new org.apache.thrift.meta_data.FieldMetaData("supervisor_id", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.WORKER_HEARTBEATS, new org.apache.thrift.meta_data.FieldMetaData("worker_heartbeats", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SupervisorWorkerHeartbeat.class)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SupervisorWorkerHeartbeats.class, metaDataMap); } @@ -145,8 +115,8 @@ public class SupervisorWorkerHeartbeats implements org.apache.thrift.TBase<Super } public SupervisorWorkerHeartbeats( - String supervisor_id, - List<SupervisorWorkerHeartbeat> worker_heartbeats) + java.lang.String supervisor_id, + java.util.List<SupervisorWorkerHeartbeat> worker_heartbeats) { this(); this.supervisor_id = supervisor_id; @@ -161,7 +131,7 @@ public class SupervisorWorkerHeartbeats implements org.apache.thrift.TBase<Super this.supervisor_id = other.supervisor_id; } if (other.is_set_worker_heartbeats()) { - List<SupervisorWorkerHeartbeat> __this__worker_heartbeats = new ArrayList<SupervisorWorkerHeartbeat>(other.worker_heartbeats.size()); + java.util.List<SupervisorWorkerHeartbeat> __this__worker_heartbeats = new java.util.ArrayList<SupervisorWorkerHeartbeat>(other.worker_heartbeats.size()); for (SupervisorWorkerHeartbeat other_element : other.worker_heartbeats) { __this__worker_heartbeats.add(new SupervisorWorkerHeartbeat(other_element)); } @@ -179,11 +149,11 @@ public class SupervisorWorkerHeartbeats implements org.apache.thrift.TBase<Super this.worker_heartbeats = null; } - public String get_supervisor_id() { + public java.lang.String get_supervisor_id() { return this.supervisor_id; } - public void set_supervisor_id(String supervisor_id) { + public void set_supervisor_id(java.lang.String supervisor_id) { this.supervisor_id = supervisor_id; } @@ -212,16 +182,16 @@ public class SupervisorWorkerHeartbeats implements org.apache.thrift.TBase<Super public void add_to_worker_heartbeats(SupervisorWorkerHeartbeat elem) { if (this.worker_heartbeats == null) { - this.worker_heartbeats = new ArrayList<SupervisorWorkerHeartbeat>(); + this.worker_heartbeats = new java.util.ArrayList<SupervisorWorkerHeartbeat>(); } this.worker_heartbeats.add(elem); } - public List<SupervisorWorkerHeartbeat> get_worker_heartbeats() { + public java.util.List<SupervisorWorkerHeartbeat> get_worker_heartbeats() { return this.worker_heartbeats; } - public void set_worker_heartbeats(List<SupervisorWorkerHeartbeat> worker_heartbeats) { + public void set_worker_heartbeats(java.util.List<SupervisorWorkerHeartbeat> worker_heartbeats) { this.worker_heartbeats = worker_heartbeats; } @@ -240,13 +210,13 @@ public class SupervisorWorkerHeartbeats implements org.apache.thrift.TBase<Super } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case SUPERVISOR_ID: if (value == null) { unset_supervisor_id(); } else { - set_supervisor_id((String)value); + set_supervisor_id((java.lang.String)value); } break; @@ -254,14 +224,14 @@ public class SupervisorWorkerHeartbeats implements org.apache.thrift.TBase<Super if (value == null) { unset_worker_heartbeats(); } else { - set_worker_heartbeats((List<SupervisorWorkerHeartbeat>)value); + set_worker_heartbeats((java.util.List<SupervisorWorkerHeartbeat>)value); } break; } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SUPERVISOR_ID: return get_supervisor_id(); @@ -270,13 +240,13 @@ public class SupervisorWorkerHeartbeats implements org.apache.thrift.TBase<Super return get_worker_heartbeats(); } - 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) { @@ -285,11 +255,11 @@ public class SupervisorWorkerHeartbeats implements org.apache.thrift.TBase<Super case WORKER_HEARTBEATS: return is_set_worker_heartbeats(); } - 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 SupervisorWorkerHeartbeats) @@ -300,6 +270,8 @@ public class SupervisorWorkerHeartbeats implements org.apache.thrift.TBase<Super public boolean equals(SupervisorWorkerHeartbeats that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_supervisor_id = true && this.is_set_supervisor_id(); boolean that_present_supervisor_id = true && that.is_set_supervisor_id(); @@ -324,19 +296,17 @@ public class SupervisorWorkerHeartbeats implements org.apache.thrift.TBase<Super @Override public int hashCode() { - List<Object> list = new ArrayList<Object>(); + int hashCode = 1; - boolean present_supervisor_id = true && (is_set_supervisor_id()); - list.add(present_supervisor_id); - if (present_supervisor_id) - list.add(supervisor_id); + hashCode = hashCode * 8191 + ((is_set_supervisor_id()) ? 131071 : 524287); + if (is_set_supervisor_id()) + hashCode = hashCode * 8191 + supervisor_id.hashCode(); - boolean present_worker_heartbeats = true && (is_set_worker_heartbeats()); - list.add(present_worker_heartbeats); - if (present_worker_heartbeats) - list.add(worker_heartbeats); + hashCode = hashCode * 8191 + ((is_set_worker_heartbeats()) ? 131071 : 524287); + if (is_set_worker_heartbeats()) + hashCode = hashCode * 8191 + worker_heartbeats.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -347,7 +317,7 @@ public class SupervisorWorkerHeartbeats implements org.apache.thrift.TBase<Super int lastComparison = 0; - lastComparison = Boolean.valueOf(is_set_supervisor_id()).compareTo(other.is_set_supervisor_id()); + lastComparison = java.lang.Boolean.valueOf(is_set_supervisor_id()).compareTo(other.is_set_supervisor_id()); if (lastComparison != 0) { return lastComparison; } @@ -357,7 +327,7 @@ public class SupervisorWorkerHeartbeats implements org.apache.thrift.TBase<Super return lastComparison; } } - lastComparison = Boolean.valueOf(is_set_worker_heartbeats()).compareTo(other.is_set_worker_heartbeats()); + lastComparison = java.lang.Boolean.valueOf(is_set_worker_heartbeats()).compareTo(other.is_set_worker_heartbeats()); if (lastComparison != 0) { return lastComparison; } @@ -375,16 +345,16 @@ public class SupervisorWorkerHeartbeats implements org.apache.thrift.TBase<Super } 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("SupervisorWorkerHeartbeats("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("SupervisorWorkerHeartbeats("); boolean first = true; sb.append("supervisor_id:"); @@ -427,7 +397,7 @@ public class SupervisorWorkerHeartbeats implements org.apache.thrift.TBase<Super } } - 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) { @@ -435,13 +405,13 @@ public class SupervisorWorkerHeartbeats implements org.apache.thrift.TBase<Super } } - private static class SupervisorWorkerHeartbeatsStandardSchemeFactory implements SchemeFactory { + private static class SupervisorWorkerHeartbeatsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public SupervisorWorkerHeartbeatsStandardScheme getScheme() { return new SupervisorWorkerHeartbeatsStandardScheme(); } } - private static class SupervisorWorkerHeartbeatsStandardScheme extends StandardScheme<SupervisorWorkerHeartbeats> { + private static class SupervisorWorkerHeartbeatsStandardScheme extends org.apache.thrift.scheme.StandardScheme<SupervisorWorkerHeartbeats> { public void read(org.apache.thrift.protocol.TProtocol iprot, SupervisorWorkerHeartbeats struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -465,7 +435,7 @@ public class SupervisorWorkerHeartbeats implements org.apache.thrift.TBase<Super if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list878 = iprot.readListBegin(); - struct.worker_heartbeats = new ArrayList<SupervisorWorkerHeartbeat>(_list878.size); + struct.worker_heartbeats = new java.util.ArrayList<SupervisorWorkerHeartbeat>(_list878.size); SupervisorWorkerHeartbeat _elem879; for (int _i880 = 0; _i880 < _list878.size; ++_i880) { @@ -516,17 +486,17 @@ public class SupervisorWorkerHeartbeats implements org.apache.thrift.TBase<Super } - private static class SupervisorWorkerHeartbeatsTupleSchemeFactory implements SchemeFactory { + private static class SupervisorWorkerHeartbeatsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public SupervisorWorkerHeartbeatsTupleScheme getScheme() { return new SupervisorWorkerHeartbeatsTupleScheme(); } } - private static class SupervisorWorkerHeartbeatsTupleScheme extends TupleScheme<SupervisorWorkerHeartbeats> { + private static class SupervisorWorkerHeartbeatsTupleScheme extends org.apache.thrift.scheme.TupleScheme<SupervisorWorkerHeartbeats> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, SupervisorWorkerHeartbeats 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.supervisor_id); { oprot.writeI32(struct.worker_heartbeats.size()); @@ -539,12 +509,12 @@ public class SupervisorWorkerHeartbeats implements org.apache.thrift.TBase<Super @Override public void read(org.apache.thrift.protocol.TProtocol prot, SupervisorWorkerHeartbeats struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.supervisor_id = iprot.readString(); struct.set_supervisor_id_isSet(true); { org.apache.thrift.protocol.TList _list883 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.worker_heartbeats = new ArrayList<SupervisorWorkerHeartbeat>(_list883.size); + struct.worker_heartbeats = new java.util.ArrayList<SupervisorWorkerHeartbeat>(_list883.size); SupervisorWorkerHeartbeat _elem884; for (int _i885 = 0; _i885 < _list883.size; ++_i885) { @@ -557,5 +527,8 @@ public class SupervisorWorkerHeartbeats implements org.apache.thrift.TBase<Super } } + 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/ThriftSerializedObject.java ---------------------------------------------------------------------- diff --git a/storm-client/src/jvm/org/apache/storm/generated/ThriftSerializedObject.java b/storm-client/src/jvm/org/apache/storm/generated/ThriftSerializedObject.java index 4aee162..8a44842 100644 --- a/storm-client/src/jvm/org/apache/storm/generated/ThriftSerializedObject.java +++ b/storm-client/src/jvm/org/apache/storm/generated/ThriftSerializedObject.java @@ -16,66 +16,36 @@ * 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 ThriftSerializedObject implements org.apache.thrift.TBase<ThriftSerializedObject, ThriftSerializedObject._Fields>, java.io.Serializable, Cloneable, Comparable<ThriftSerializedObject> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ThriftSerializedObject"); private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField BITS_FIELD_DESC = new org.apache.thrift.protocol.TField("bits", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new ThriftSerializedObjectStandardSchemeFactory()); - schemes.put(TupleScheme.class, new ThriftSerializedObjectTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new ThriftSerializedObjectStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new ThriftSerializedObjectTupleSchemeFactory(); - private String name; // required - private ByteBuffer bits; // required + private java.lang.String name; // required + private java.nio.ByteBuffer bits; // 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 { NAME((short)1, "name"), BITS((short)2, "bits"); - 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); } } @@ -100,21 +70,21 @@ public class ThriftSerializedObject implements org.apache.thrift.TBase<ThriftSer */ 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; } @@ -123,20 +93,20 @@ public class ThriftSerializedObject implements org.apache.thrift.TBase<ThriftSer return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - 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.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.BITS, new org.apache.thrift.meta_data.FieldMetaData("bits", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ThriftSerializedObject.class, metaDataMap); } @@ -144,8 +114,8 @@ public class ThriftSerializedObject implements org.apache.thrift.TBase<ThriftSer } public ThriftSerializedObject( - String name, - ByteBuffer bits) + java.lang.String name, + java.nio.ByteBuffer bits) { this(); this.name = name; @@ -174,11 +144,11 @@ public class ThriftSerializedObject implements org.apache.thrift.TBase<ThriftSer this.bits = null; } - public String get_name() { + public java.lang.String get_name() { return this.name; } - public void set_name(String name) { + public void set_name(java.lang.String name) { this.name = name; } @@ -202,15 +172,15 @@ public class ThriftSerializedObject implements org.apache.thrift.TBase<ThriftSer return bits == null ? null : bits.array(); } - public ByteBuffer buffer_for_bits() { + public java.nio.ByteBuffer buffer_for_bits() { return org.apache.thrift.TBaseHelper.copyBinary(bits); } public void set_bits(byte[] bits) { - this.bits = bits == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(bits, bits.length)); + this.bits = bits == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(bits.clone()); } - public void set_bits(ByteBuffer bits) { + public void set_bits(java.nio.ByteBuffer bits) { this.bits = org.apache.thrift.TBaseHelper.copyBinary(bits); } @@ -229,13 +199,13 @@ public class ThriftSerializedObject implements org.apache.thrift.TBase<ThriftSer } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case NAME: if (value == null) { unset_name(); } else { - set_name((String)value); + set_name((java.lang.String)value); } break; @@ -243,14 +213,18 @@ public class ThriftSerializedObject implements org.apache.thrift.TBase<ThriftSer if (value == null) { unset_bits(); } else { - set_bits((ByteBuffer)value); + if (value instanceof byte[]) { + set_bits((byte[])value); + } else { + set_bits((java.nio.ByteBuffer)value); + } } break; } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case NAME: return get_name(); @@ -259,13 +233,13 @@ public class ThriftSerializedObject implements org.apache.thrift.TBase<ThriftSer return get_bits(); } - 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) { @@ -274,11 +248,11 @@ public class ThriftSerializedObject implements org.apache.thrift.TBase<ThriftSer case BITS: return is_set_bits(); } - 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 ThriftSerializedObject) @@ -289,6 +263,8 @@ public class ThriftSerializedObject implements org.apache.thrift.TBase<ThriftSer public boolean equals(ThriftSerializedObject that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_name = true && this.is_set_name(); boolean that_present_name = true && that.is_set_name(); @@ -313,19 +289,17 @@ public class ThriftSerializedObject implements org.apache.thrift.TBase<ThriftSer @Override public int hashCode() { - List<Object> list = new ArrayList<Object>(); + int hashCode = 1; - boolean present_name = true && (is_set_name()); - list.add(present_name); - if (present_name) - list.add(name); + hashCode = hashCode * 8191 + ((is_set_name()) ? 131071 : 524287); + if (is_set_name()) + hashCode = hashCode * 8191 + name.hashCode(); - boolean present_bits = true && (is_set_bits()); - list.add(present_bits); - if (present_bits) - list.add(bits); + hashCode = hashCode * 8191 + ((is_set_bits()) ? 131071 : 524287); + if (is_set_bits()) + hashCode = hashCode * 8191 + bits.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -336,7 +310,7 @@ public class ThriftSerializedObject implements org.apache.thrift.TBase<ThriftSer int lastComparison = 0; - lastComparison = Boolean.valueOf(is_set_name()).compareTo(other.is_set_name()); + lastComparison = java.lang.Boolean.valueOf(is_set_name()).compareTo(other.is_set_name()); if (lastComparison != 0) { return lastComparison; } @@ -346,7 +320,7 @@ public class ThriftSerializedObject implements org.apache.thrift.TBase<ThriftSer return lastComparison; } } - lastComparison = Boolean.valueOf(is_set_bits()).compareTo(other.is_set_bits()); + lastComparison = java.lang.Boolean.valueOf(is_set_bits()).compareTo(other.is_set_bits()); if (lastComparison != 0) { return lastComparison; } @@ -364,16 +338,16 @@ public class ThriftSerializedObject implements org.apache.thrift.TBase<ThriftSer } 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("ThriftSerializedObject("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("ThriftSerializedObject("); boolean first = true; sb.append("name:"); @@ -416,7 +390,7 @@ public class ThriftSerializedObject implements org.apache.thrift.TBase<ThriftSer } } - 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) { @@ -424,13 +398,13 @@ public class ThriftSerializedObject implements org.apache.thrift.TBase<ThriftSer } } - private static class ThriftSerializedObjectStandardSchemeFactory implements SchemeFactory { + private static class ThriftSerializedObjectStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public ThriftSerializedObjectStandardScheme getScheme() { return new ThriftSerializedObjectStandardScheme(); } } - private static class ThriftSerializedObjectStandardScheme extends StandardScheme<ThriftSerializedObject> { + private static class ThriftSerializedObjectStandardScheme extends org.apache.thrift.scheme.StandardScheme<ThriftSerializedObject> { public void read(org.apache.thrift.protocol.TProtocol iprot, ThriftSerializedObject struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -487,24 +461,24 @@ public class ThriftSerializedObject implements org.apache.thrift.TBase<ThriftSer } - private static class ThriftSerializedObjectTupleSchemeFactory implements SchemeFactory { + private static class ThriftSerializedObjectTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public ThriftSerializedObjectTupleScheme getScheme() { return new ThriftSerializedObjectTupleScheme(); } } - private static class ThriftSerializedObjectTupleScheme extends TupleScheme<ThriftSerializedObject> { + private static class ThriftSerializedObjectTupleScheme extends org.apache.thrift.scheme.TupleScheme<ThriftSerializedObject> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, ThriftSerializedObject 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.name); oprot.writeBinary(struct.bits); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, ThriftSerializedObject struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.name = iprot.readString(); struct.set_name_isSet(true); struct.bits = iprot.readBinary(); @@ -512,5 +486,8 @@ public class ThriftSerializedObject implements org.apache.thrift.TBase<ThriftSer } } + 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/TopologyActionOptions.java ---------------------------------------------------------------------- diff --git a/storm-client/src/jvm/org/apache/storm/generated/TopologyActionOptions.java b/storm-client/src/jvm/org/apache/storm/generated/TopologyActionOptions.java index 1b6b69d..a0755aa 100644 --- a/storm-client/src/jvm/org/apache/storm/generated/TopologyActionOptions.java +++ b/storm-client/src/jvm/org/apache/storm/generated/TopologyActionOptions.java @@ -16,41 +16,14 @@ * 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"}) +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public class TopologyActionOptions extends org.apache.thrift.TUnion<TopologyActionOptions, TopologyActionOptions._Fields> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TopologyActionOptions"); private static final org.apache.thrift.protocol.TField KILL_OPTIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("kill_options", org.apache.thrift.protocol.TType.STRUCT, (short)1); @@ -61,10 +34,10 @@ public class TopologyActionOptions extends org.apache.thrift.TUnion<TopologyActi KILL_OPTIONS((short)1, "kill_options"), REBALANCE_OPTIONS((short)2, "rebalance_options"); - 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); } } @@ -89,21 +62,21 @@ public class TopologyActionOptions extends org.apache.thrift.TUnion<TopologyActi */ 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; } @@ -112,19 +85,19 @@ public class TopologyActionOptions extends org.apache.thrift.TUnion<TopologyActi return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } - 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.KILL_OPTIONS, new org.apache.thrift.meta_data.FieldMetaData("kill_options", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, KillOptions.class))); tmpMap.put(_Fields.REBALANCE_OPTIONS, new org.apache.thrift.meta_data.FieldMetaData("rebalance_options", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RebalanceOptions.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TopologyActionOptions.class, metaDataMap); } @@ -132,7 +105,7 @@ public class TopologyActionOptions extends org.apache.thrift.TUnion<TopologyActi super(); } - public TopologyActionOptions(_Fields setField, Object value) { + public TopologyActionOptions(_Fields setField, java.lang.Object value) { super(setField, value); } @@ -157,25 +130,25 @@ public class TopologyActionOptions extends org.apache.thrift.TUnion<TopologyActi @Override - protected void checkType(_Fields setField, Object value) throws ClassCastException { + protected void checkType(_Fields setField, java.lang.Object value) throws java.lang.ClassCastException { switch (setField) { case KILL_OPTIONS: if (value instanceof KillOptions) { break; } - throw new ClassCastException("Was expecting value of type KillOptions for field 'kill_options', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type KillOptions for field 'kill_options', but got " + value.getClass().getSimpleName()); case REBALANCE_OPTIONS: if (value instanceof RebalanceOptions) { break; } - throw new ClassCastException("Was expecting value of type RebalanceOptions for field 'rebalance_options', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type RebalanceOptions for field 'rebalance_options', but got " + value.getClass().getSimpleName()); default: - throw new IllegalArgumentException("Unknown field id " + setField); + throw new java.lang.IllegalArgumentException("Unknown field id " + setField); } } @Override - protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { + protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { _Fields setField = _Fields.findByThriftId(field.id); if (setField != null) { switch (setField) { @@ -200,7 +173,7 @@ public class TopologyActionOptions extends org.apache.thrift.TUnion<TopologyActi return null; } default: - throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); } } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); @@ -220,12 +193,12 @@ public class TopologyActionOptions extends org.apache.thrift.TUnion<TopologyActi rebalance_options.write(oprot); return; default: - throw new IllegalStateException("Cannot write union with unknown field " + setField_); + throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); } } @Override - protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { + protected java.lang.Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { _Fields setField = _Fields.findByThriftId(fieldID); if (setField != null) { switch (setField) { @@ -240,10 +213,10 @@ public class TopologyActionOptions extends org.apache.thrift.TUnion<TopologyActi rebalance_options.read(iprot); return rebalance_options; default: - throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); } } else { - throw new TProtocolException("Couldn't find a field with field id " + fieldID); + throw new org.apache.thrift.protocol.TProtocolException("Couldn't find a field with field id " + fieldID); } } @@ -259,7 +232,7 @@ public class TopologyActionOptions extends org.apache.thrift.TUnion<TopologyActi rebalance_options.write(oprot); return; default: - throw new IllegalStateException("Cannot write union with unknown field " + setField_); + throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); } } @@ -271,7 +244,7 @@ public class TopologyActionOptions extends org.apache.thrift.TUnion<TopologyActi case REBALANCE_OPTIONS: return REBALANCE_OPTIONS_FIELD_DESC; default: - throw new IllegalArgumentException("Unknown field id " + setField); + throw new java.lang.IllegalArgumentException("Unknown field id " + setField); } } @@ -294,12 +267,12 @@ public class TopologyActionOptions extends org.apache.thrift.TUnion<TopologyActi if (getSetField() == _Fields.KILL_OPTIONS) { return (KillOptions)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'kill_options' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'kill_options' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void set_kill_options(KillOptions value) { - if (value == null) throw new NullPointerException(); + if (value == null) throw new java.lang.NullPointerException(); setField_ = _Fields.KILL_OPTIONS; value_ = value; } @@ -308,12 +281,12 @@ public class TopologyActionOptions extends org.apache.thrift.TUnion<TopologyActi if (getSetField() == _Fields.REBALANCE_OPTIONS) { return (RebalanceOptions)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'rebalance_options' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'rebalance_options' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void set_rebalance_options(RebalanceOptions value) { - if (value == null) throw new NullPointerException(); + if (value == null) throw new java.lang.NullPointerException(); setField_ = _Fields.REBALANCE_OPTIONS; value_ = value; } @@ -328,7 +301,7 @@ public class TopologyActionOptions extends org.apache.thrift.TUnion<TopologyActi } - public boolean equals(Object other) { + public boolean equals(java.lang.Object other) { if (other instanceof TopologyActionOptions) { return equals((TopologyActionOptions)other); } else { @@ -352,12 +325,12 @@ public class TopologyActionOptions extends org.apache.thrift.TUnion<TopologyActi @Override public int hashCode() { - List<Object> list = new ArrayList<Object>(); + java.util.List<java.lang.Object> list = new java.util.ArrayList<java.lang.Object>(); list.add(this.getClass().getName()); org.apache.thrift.TFieldIdEnum setField = getSetField(); if (setField != null) { list.add(setField.getThriftFieldId()); - Object value = getFieldValue(); + java.lang.Object value = getFieldValue(); if (value instanceof org.apache.thrift.TEnum) { list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue()); } else { @@ -375,7 +348,7 @@ public class TopologyActionOptions extends org.apache.thrift.TUnion<TopologyActi } - 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) { http://git-wip-us.apache.org/repos/asf/storm/blob/1fd1e17f/storm-client/src/jvm/org/apache/storm/generated/TopologyHistoryInfo.java ---------------------------------------------------------------------- diff --git a/storm-client/src/jvm/org/apache/storm/generated/TopologyHistoryInfo.java b/storm-client/src/jvm/org/apache/storm/generated/TopologyHistoryInfo.java index 51a7625..2986a0c 100644 --- a/storm-client/src/jvm/org/apache/storm/generated/TopologyHistoryInfo.java +++ b/storm-client/src/jvm/org/apache/storm/generated/TopologyHistoryInfo.java @@ -16,63 +16,33 @@ * 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 TopologyHistoryInfo implements org.apache.thrift.TBase<TopologyHistoryInfo, TopologyHistoryInfo._Fields>, java.io.Serializable, Cloneable, Comparable<TopologyHistoryInfo> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TopologyHistoryInfo"); private static final org.apache.thrift.protocol.TField TOPO_IDS_FIELD_DESC = new org.apache.thrift.protocol.TField("topo_ids", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TopologyHistoryInfoStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TopologyHistoryInfoTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TopologyHistoryInfoStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TopologyHistoryInfoTupleSchemeFactory(); - private List<String> topo_ids; // required + private java.util.List<java.lang.String> topo_ids; // 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 { TOPO_IDS((short)1, "topo_ids"); - 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); } } @@ -95,21 +65,21 @@ public class TopologyHistoryInfo implements org.apache.thrift.TBase<TopologyHist */ 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; } @@ -118,19 +88,19 @@ public class TopologyHistoryInfo implements org.apache.thrift.TBase<TopologyHist return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - 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.TOPO_IDS, new org.apache.thrift.meta_data.FieldMetaData("topo_ids", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TopologyHistoryInfo.class, metaDataMap); } @@ -138,7 +108,7 @@ public class TopologyHistoryInfo implements org.apache.thrift.TBase<TopologyHist } public TopologyHistoryInfo( - List<String> topo_ids) + java.util.List<java.lang.String> topo_ids) { this(); this.topo_ids = topo_ids; @@ -149,7 +119,7 @@ public class TopologyHistoryInfo implements org.apache.thrift.TBase<TopologyHist */ public TopologyHistoryInfo(TopologyHistoryInfo other) { if (other.is_set_topo_ids()) { - List<String> __this__topo_ids = new ArrayList<String>(other.topo_ids); + java.util.List<java.lang.String> __this__topo_ids = new java.util.ArrayList<java.lang.String>(other.topo_ids); this.topo_ids = __this__topo_ids; } } @@ -167,22 +137,22 @@ public class TopologyHistoryInfo implements org.apache.thrift.TBase<TopologyHist return (this.topo_ids == null) ? 0 : this.topo_ids.size(); } - public java.util.Iterator<String> get_topo_ids_iterator() { + public java.util.Iterator<java.lang.String> get_topo_ids_iterator() { return (this.topo_ids == null) ? null : this.topo_ids.iterator(); } - public void add_to_topo_ids(String elem) { + public void add_to_topo_ids(java.lang.String elem) { if (this.topo_ids == null) { - this.topo_ids = new ArrayList<String>(); + this.topo_ids = new java.util.ArrayList<java.lang.String>(); } this.topo_ids.add(elem); } - public List<String> get_topo_ids() { + public java.util.List<java.lang.String> get_topo_ids() { return this.topo_ids; } - public void set_topo_ids(List<String> topo_ids) { + public void set_topo_ids(java.util.List<java.lang.String> topo_ids) { this.topo_ids = topo_ids; } @@ -201,43 +171,43 @@ public class TopologyHistoryInfo implements org.apache.thrift.TBase<TopologyHist } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case TOPO_IDS: if (value == null) { unset_topo_ids(); } else { - set_topo_ids((List<String>)value); + set_topo_ids((java.util.List<java.lang.String>)value); } break; } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case TOPO_IDS: return get_topo_ids(); } - 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) { case TOPO_IDS: return is_set_topo_ids(); } - 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 TopologyHistoryInfo) @@ -248,6 +218,8 @@ public class TopologyHistoryInfo implements org.apache.thrift.TBase<TopologyHist public boolean equals(TopologyHistoryInfo that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_topo_ids = true && this.is_set_topo_ids(); boolean that_present_topo_ids = true && that.is_set_topo_ids(); @@ -263,14 +235,13 @@ public class TopologyHistoryInfo implements org.apache.thrift.TBase<TopologyHist @Override public int hashCode() { - List<Object> list = new ArrayList<Object>(); + int hashCode = 1; - boolean present_topo_ids = true && (is_set_topo_ids()); - list.add(present_topo_ids); - if (present_topo_ids) - list.add(topo_ids); + hashCode = hashCode * 8191 + ((is_set_topo_ids()) ? 131071 : 524287); + if (is_set_topo_ids()) + hashCode = hashCode * 8191 + topo_ids.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -281,7 +252,7 @@ public class TopologyHistoryInfo implements org.apache.thrift.TBase<TopologyHist int lastComparison = 0; - lastComparison = Boolean.valueOf(is_set_topo_ids()).compareTo(other.is_set_topo_ids()); + lastComparison = java.lang.Boolean.valueOf(is_set_topo_ids()).compareTo(other.is_set_topo_ids()); if (lastComparison != 0) { return lastComparison; } @@ -299,16 +270,16 @@ public class TopologyHistoryInfo implements org.apache.thrift.TBase<TopologyHist } 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("TopologyHistoryInfo("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TopologyHistoryInfo("); boolean first = true; sb.append("topo_ids:"); @@ -335,7 +306,7 @@ public class TopologyHistoryInfo implements org.apache.thrift.TBase<TopologyHist } } - 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) { @@ -343,13 +314,13 @@ public class TopologyHistoryInfo implements org.apache.thrift.TBase<TopologyHist } } - private static class TopologyHistoryInfoStandardSchemeFactory implements SchemeFactory { + private static class TopologyHistoryInfoStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TopologyHistoryInfoStandardScheme getScheme() { return new TopologyHistoryInfoStandardScheme(); } } - private static class TopologyHistoryInfoStandardScheme extends StandardScheme<TopologyHistoryInfo> { + private static class TopologyHistoryInfoStandardScheme extends org.apache.thrift.scheme.StandardScheme<TopologyHistoryInfo> { public void read(org.apache.thrift.protocol.TProtocol iprot, TopologyHistoryInfo struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -365,8 +336,8 @@ public class TopologyHistoryInfo implements org.apache.thrift.TBase<TopologyHist if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list862 = iprot.readListBegin(); - struct.topo_ids = new ArrayList<String>(_list862.size); - String _elem863; + struct.topo_ids = new java.util.ArrayList<java.lang.String>(_list862.size); + java.lang.String _elem863; for (int _i864 = 0; _i864 < _list862.size; ++_i864) { _elem863 = iprot.readString(); @@ -396,7 +367,7 @@ public class TopologyHistoryInfo implements org.apache.thrift.TBase<TopologyHist oprot.writeFieldBegin(TOPO_IDS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.topo_ids.size())); - for (String _iter865 : struct.topo_ids) + for (java.lang.String _iter865 : struct.topo_ids) { oprot.writeString(_iter865); } @@ -410,18 +381,18 @@ public class TopologyHistoryInfo implements org.apache.thrift.TBase<TopologyHist } - private static class TopologyHistoryInfoTupleSchemeFactory implements SchemeFactory { + private static class TopologyHistoryInfoTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TopologyHistoryInfoTupleScheme getScheme() { return new TopologyHistoryInfoTupleScheme(); } } - private static class TopologyHistoryInfoTupleScheme extends TupleScheme<TopologyHistoryInfo> { + private static class TopologyHistoryInfoTupleScheme extends org.apache.thrift.scheme.TupleScheme<TopologyHistoryInfo> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TopologyHistoryInfo 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_topo_ids()) { optionals.set(0); } @@ -429,7 +400,7 @@ public class TopologyHistoryInfo implements org.apache.thrift.TBase<TopologyHist if (struct.is_set_topo_ids()) { { oprot.writeI32(struct.topo_ids.size()); - for (String _iter866 : struct.topo_ids) + for (java.lang.String _iter866 : struct.topo_ids) { oprot.writeString(_iter866); } @@ -439,13 +410,13 @@ public class TopologyHistoryInfo implements org.apache.thrift.TBase<TopologyHist @Override public void read(org.apache.thrift.protocol.TProtocol prot, TopologyHistoryInfo struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list867 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.topo_ids = new ArrayList<String>(_list867.size); - String _elem868; + struct.topo_ids = new java.util.ArrayList<java.lang.String>(_list867.size); + java.lang.String _elem868; for (int _i869 = 0; _i869 < _list867.size; ++_i869) { _elem868 = iprot.readString(); @@ -457,5 +428,8 @@ public class TopologyHistoryInfo implements org.apache.thrift.TBase<TopologyHist } } + 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(); + } }
