http://git-wip-us.apache.org/repos/asf/storm/blob/1fd1e17f/storm-client/src/jvm/org/apache/storm/generated/SharedMemory.java ---------------------------------------------------------------------- diff --git a/storm-client/src/jvm/org/apache/storm/generated/SharedMemory.java b/storm-client/src/jvm/org/apache/storm/generated/SharedMemory.java index f84f106..5efa346 100644 --- a/storm-client/src/jvm/org/apache/storm/generated/SharedMemory.java +++ b/storm-client/src/jvm/org/apache/storm/generated/SharedMemory.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 SharedMemory implements org.apache.thrift.TBase<SharedMemory, SharedMemory._Fields>, java.io.Serializable, Cloneable, Comparable<SharedMemory> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SharedMemory"); @@ -60,13 +33,10 @@ public class SharedMemory implements org.apache.thrift.TBase<SharedMemory, Share private static final org.apache.thrift.protocol.TField OFF_HEAP_WORKER_FIELD_DESC = new org.apache.thrift.protocol.TField("off_heap_worker", org.apache.thrift.protocol.TType.DOUBLE, (short)3); private static final org.apache.thrift.protocol.TField OFF_HEAP_NODE_FIELD_DESC = new org.apache.thrift.protocol.TField("off_heap_node", org.apache.thrift.protocol.TType.DOUBLE, (short)4); - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new SharedMemoryStandardSchemeFactory()); - schemes.put(TupleScheme.class, new SharedMemoryTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new SharedMemoryStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new SharedMemoryTupleSchemeFactory(); - private String name; // required + private java.lang.String name; // required private double on_heap; // optional private double off_heap_worker; // optional private double off_heap_node; // optional @@ -78,10 +48,10 @@ public class SharedMemory implements org.apache.thrift.TBase<SharedMemory, Share OFF_HEAP_WORKER((short)3, "off_heap_worker"), OFF_HEAP_NODE((short)4, "off_heap_node"); - 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 SharedMemory implements org.apache.thrift.TBase<SharedMemory, Share */ 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 SharedMemory implements org.apache.thrift.TBase<SharedMemory, Share return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } @@ -144,9 +114,9 @@ public class SharedMemory implements org.apache.thrift.TBase<SharedMemory, Share private static final int __OFF_HEAP_NODE_ISSET_ID = 2; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.ON_HEAP,_Fields.OFF_HEAP_WORKER,_Fields.OFF_HEAP_NODE}; - 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.ON_HEAP, new org.apache.thrift.meta_data.FieldMetaData("on_heap", org.apache.thrift.TFieldRequirementType.OPTIONAL, @@ -155,7 +125,7 @@ public class SharedMemory implements org.apache.thrift.TBase<SharedMemory, Share new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))); tmpMap.put(_Fields.OFF_HEAP_NODE, new org.apache.thrift.meta_data.FieldMetaData("off_heap_node", org.apache.thrift.TFieldRequirementType.OPTIONAL, 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(SharedMemory.class, metaDataMap); } @@ -163,7 +133,7 @@ public class SharedMemory implements org.apache.thrift.TBase<SharedMemory, Share } public SharedMemory( - String name) + java.lang.String name) { this(); this.name = name; @@ -197,11 +167,11 @@ public class SharedMemory implements org.apache.thrift.TBase<SharedMemory, Share this.off_heap_node = 0.0; } - 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; } @@ -230,16 +200,16 @@ public class SharedMemory implements org.apache.thrift.TBase<SharedMemory, Share } public void unset_on_heap() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ON_HEAP_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ON_HEAP_ISSET_ID); } /** Returns true if field on_heap is set (has been assigned a value) and false otherwise */ public boolean is_set_on_heap() { - return EncodingUtils.testBit(__isset_bitfield, __ON_HEAP_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ON_HEAP_ISSET_ID); } public void set_on_heap_isSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ON_HEAP_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ON_HEAP_ISSET_ID, value); } public double get_off_heap_worker() { @@ -252,16 +222,16 @@ public class SharedMemory implements org.apache.thrift.TBase<SharedMemory, Share } public void unset_off_heap_worker() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __OFF_HEAP_WORKER_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __OFF_HEAP_WORKER_ISSET_ID); } /** Returns true if field off_heap_worker is set (has been assigned a value) and false otherwise */ public boolean is_set_off_heap_worker() { - return EncodingUtils.testBit(__isset_bitfield, __OFF_HEAP_WORKER_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __OFF_HEAP_WORKER_ISSET_ID); } public void set_off_heap_worker_isSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __OFF_HEAP_WORKER_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __OFF_HEAP_WORKER_ISSET_ID, value); } public double get_off_heap_node() { @@ -274,25 +244,25 @@ public class SharedMemory implements org.apache.thrift.TBase<SharedMemory, Share } public void unset_off_heap_node() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __OFF_HEAP_NODE_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __OFF_HEAP_NODE_ISSET_ID); } /** Returns true if field off_heap_node is set (has been assigned a value) and false otherwise */ public boolean is_set_off_heap_node() { - return EncodingUtils.testBit(__isset_bitfield, __OFF_HEAP_NODE_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __OFF_HEAP_NODE_ISSET_ID); } public void set_off_heap_node_isSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __OFF_HEAP_NODE_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __OFF_HEAP_NODE_ISSET_ID, value); } - 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; @@ -300,7 +270,7 @@ public class SharedMemory implements org.apache.thrift.TBase<SharedMemory, Share if (value == null) { unset_on_heap(); } else { - set_on_heap((Double)value); + set_on_heap((java.lang.Double)value); } break; @@ -308,7 +278,7 @@ public class SharedMemory implements org.apache.thrift.TBase<SharedMemory, Share if (value == null) { unset_off_heap_worker(); } else { - set_off_heap_worker((Double)value); + set_off_heap_worker((java.lang.Double)value); } break; @@ -316,14 +286,14 @@ public class SharedMemory implements org.apache.thrift.TBase<SharedMemory, Share if (value == null) { unset_off_heap_node(); } else { - set_off_heap_node((Double)value); + set_off_heap_node((java.lang.Double)value); } break; } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case NAME: return get_name(); @@ -338,13 +308,13 @@ public class SharedMemory implements org.apache.thrift.TBase<SharedMemory, Share return get_off_heap_node(); } - 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) { @@ -357,11 +327,11 @@ public class SharedMemory implements org.apache.thrift.TBase<SharedMemory, Share case OFF_HEAP_NODE: return is_set_off_heap_node(); } - 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 SharedMemory) @@ -372,6 +342,8 @@ public class SharedMemory implements org.apache.thrift.TBase<SharedMemory, Share public boolean equals(SharedMemory 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(); @@ -414,29 +386,25 @@ public class SharedMemory implements org.apache.thrift.TBase<SharedMemory, Share @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_on_heap = true && (is_set_on_heap()); - list.add(present_on_heap); - if (present_on_heap) - list.add(on_heap); + hashCode = hashCode * 8191 + ((is_set_on_heap()) ? 131071 : 524287); + if (is_set_on_heap()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(on_heap); - boolean present_off_heap_worker = true && (is_set_off_heap_worker()); - list.add(present_off_heap_worker); - if (present_off_heap_worker) - list.add(off_heap_worker); + hashCode = hashCode * 8191 + ((is_set_off_heap_worker()) ? 131071 : 524287); + if (is_set_off_heap_worker()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(off_heap_worker); - boolean present_off_heap_node = true && (is_set_off_heap_node()); - list.add(present_off_heap_node); - if (present_off_heap_node) - list.add(off_heap_node); + hashCode = hashCode * 8191 + ((is_set_off_heap_node()) ? 131071 : 524287); + if (is_set_off_heap_node()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(off_heap_node); - return list.hashCode(); + return hashCode; } @Override @@ -447,7 +415,7 @@ public class SharedMemory implements org.apache.thrift.TBase<SharedMemory, Share 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; } @@ -457,7 +425,7 @@ public class SharedMemory implements org.apache.thrift.TBase<SharedMemory, Share return lastComparison; } } - lastComparison = Boolean.valueOf(is_set_on_heap()).compareTo(other.is_set_on_heap()); + lastComparison = java.lang.Boolean.valueOf(is_set_on_heap()).compareTo(other.is_set_on_heap()); if (lastComparison != 0) { return lastComparison; } @@ -467,7 +435,7 @@ public class SharedMemory implements org.apache.thrift.TBase<SharedMemory, Share return lastComparison; } } - lastComparison = Boolean.valueOf(is_set_off_heap_worker()).compareTo(other.is_set_off_heap_worker()); + lastComparison = java.lang.Boolean.valueOf(is_set_off_heap_worker()).compareTo(other.is_set_off_heap_worker()); if (lastComparison != 0) { return lastComparison; } @@ -477,7 +445,7 @@ public class SharedMemory implements org.apache.thrift.TBase<SharedMemory, Share return lastComparison; } } - lastComparison = Boolean.valueOf(is_set_off_heap_node()).compareTo(other.is_set_off_heap_node()); + lastComparison = java.lang.Boolean.valueOf(is_set_off_heap_node()).compareTo(other.is_set_off_heap_node()); if (lastComparison != 0) { return lastComparison; } @@ -495,16 +463,16 @@ public class SharedMemory implements org.apache.thrift.TBase<SharedMemory, Share } 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("SharedMemory("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("SharedMemory("); boolean first = true; sb.append("name:"); @@ -553,7 +521,7 @@ public class SharedMemory implements org.apache.thrift.TBase<SharedMemory, Share } } - 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; @@ -563,13 +531,13 @@ public class SharedMemory implements org.apache.thrift.TBase<SharedMemory, Share } } - private static class SharedMemoryStandardSchemeFactory implements SchemeFactory { + private static class SharedMemoryStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public SharedMemoryStandardScheme getScheme() { return new SharedMemoryStandardScheme(); } } - private static class SharedMemoryStandardScheme extends StandardScheme<SharedMemory> { + private static class SharedMemoryStandardScheme extends org.apache.thrift.scheme.StandardScheme<SharedMemory> { public void read(org.apache.thrift.protocol.TProtocol iprot, SharedMemory struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -652,19 +620,19 @@ public class SharedMemory implements org.apache.thrift.TBase<SharedMemory, Share } - private static class SharedMemoryTupleSchemeFactory implements SchemeFactory { + private static class SharedMemoryTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public SharedMemoryTupleScheme getScheme() { return new SharedMemoryTupleScheme(); } } - private static class SharedMemoryTupleScheme extends TupleScheme<SharedMemory> { + private static class SharedMemoryTupleScheme extends org.apache.thrift.scheme.TupleScheme<SharedMemory> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, SharedMemory 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); - BitSet optionals = new BitSet(); + java.util.BitSet optionals = new java.util.BitSet(); if (struct.is_set_on_heap()) { optionals.set(0); } @@ -688,10 +656,10 @@ public class SharedMemory implements org.apache.thrift.TBase<SharedMemory, Share @Override public void read(org.apache.thrift.protocol.TProtocol prot, SharedMemory 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); - BitSet incoming = iprot.readBitSet(3); + java.util.BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.on_heap = iprot.readDouble(); struct.set_on_heap_isSet(true); @@ -707,5 +675,8 @@ public class SharedMemory implements org.apache.thrift.TBase<SharedMemory, Share } } + 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/ShellComponent.java ---------------------------------------------------------------------- diff --git a/storm-client/src/jvm/org/apache/storm/generated/ShellComponent.java b/storm-client/src/jvm/org/apache/storm/generated/ShellComponent.java index 6941cb2..1d9ac63 100644 --- a/storm-client/src/jvm/org/apache/storm/generated/ShellComponent.java +++ b/storm-client/src/jvm/org/apache/storm/generated/ShellComponent.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 ShellComponent implements org.apache.thrift.TBase<ShellComponent, ShellComponent._Fields>, java.io.Serializable, Cloneable, Comparable<ShellComponent> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ShellComponent"); private static final org.apache.thrift.protocol.TField EXECUTION_COMMAND_FIELD_DESC = new org.apache.thrift.protocol.TField("execution_command", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField SCRIPT_FIELD_DESC = new org.apache.thrift.protocol.TField("script", 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 ShellComponentStandardSchemeFactory()); - schemes.put(TupleScheme.class, new ShellComponentTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new ShellComponentStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new ShellComponentTupleSchemeFactory(); - private String execution_command; // required - private String script; // required + private java.lang.String execution_command; // required + private java.lang.String script; // 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 { EXECUTION_COMMAND((short)1, "execution_command"), SCRIPT((short)2, "script"); - 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 ShellComponent implements org.apache.thrift.TBase<ShellComponent, S */ 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 ShellComponent implements org.apache.thrift.TBase<ShellComponent, S 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.EXECUTION_COMMAND, new org.apache.thrift.meta_data.FieldMetaData("execution_command", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.SCRIPT, new org.apache.thrift.meta_data.FieldMetaData("script", org.apache.thrift.TFieldRequirementType.DEFAULT, 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(ShellComponent.class, metaDataMap); } @@ -144,8 +114,8 @@ public class ShellComponent implements org.apache.thrift.TBase<ShellComponent, S } public ShellComponent( - String execution_command, - String script) + java.lang.String execution_command, + java.lang.String script) { this(); this.execution_command = execution_command; @@ -174,11 +144,11 @@ public class ShellComponent implements org.apache.thrift.TBase<ShellComponent, S this.script = null; } - public String get_execution_command() { + public java.lang.String get_execution_command() { return this.execution_command; } - public void set_execution_command(String execution_command) { + public void set_execution_command(java.lang.String execution_command) { this.execution_command = execution_command; } @@ -197,11 +167,11 @@ public class ShellComponent implements org.apache.thrift.TBase<ShellComponent, S } } - public String get_script() { + public java.lang.String get_script() { return this.script; } - public void set_script(String script) { + public void set_script(java.lang.String script) { this.script = script; } @@ -220,13 +190,13 @@ public class ShellComponent implements org.apache.thrift.TBase<ShellComponent, S } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case EXECUTION_COMMAND: if (value == null) { unset_execution_command(); } else { - set_execution_command((String)value); + set_execution_command((java.lang.String)value); } break; @@ -234,14 +204,14 @@ public class ShellComponent implements org.apache.thrift.TBase<ShellComponent, S if (value == null) { unset_script(); } else { - set_script((String)value); + set_script((java.lang.String)value); } break; } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case EXECUTION_COMMAND: return get_execution_command(); @@ -250,13 +220,13 @@ public class ShellComponent implements org.apache.thrift.TBase<ShellComponent, S return get_script(); } - 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) { @@ -265,11 +235,11 @@ public class ShellComponent implements org.apache.thrift.TBase<ShellComponent, S case SCRIPT: return is_set_script(); } - 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 ShellComponent) @@ -280,6 +250,8 @@ public class ShellComponent implements org.apache.thrift.TBase<ShellComponent, S public boolean equals(ShellComponent that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_execution_command = true && this.is_set_execution_command(); boolean that_present_execution_command = true && that.is_set_execution_command(); @@ -304,19 +276,17 @@ public class ShellComponent implements org.apache.thrift.TBase<ShellComponent, S @Override public int hashCode() { - List<Object> list = new ArrayList<Object>(); + int hashCode = 1; - boolean present_execution_command = true && (is_set_execution_command()); - list.add(present_execution_command); - if (present_execution_command) - list.add(execution_command); + hashCode = hashCode * 8191 + ((is_set_execution_command()) ? 131071 : 524287); + if (is_set_execution_command()) + hashCode = hashCode * 8191 + execution_command.hashCode(); - boolean present_script = true && (is_set_script()); - list.add(present_script); - if (present_script) - list.add(script); + hashCode = hashCode * 8191 + ((is_set_script()) ? 131071 : 524287); + if (is_set_script()) + hashCode = hashCode * 8191 + script.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -327,7 +297,7 @@ public class ShellComponent implements org.apache.thrift.TBase<ShellComponent, S int lastComparison = 0; - lastComparison = Boolean.valueOf(is_set_execution_command()).compareTo(other.is_set_execution_command()); + lastComparison = java.lang.Boolean.valueOf(is_set_execution_command()).compareTo(other.is_set_execution_command()); if (lastComparison != 0) { return lastComparison; } @@ -337,7 +307,7 @@ public class ShellComponent implements org.apache.thrift.TBase<ShellComponent, S return lastComparison; } } - lastComparison = Boolean.valueOf(is_set_script()).compareTo(other.is_set_script()); + lastComparison = java.lang.Boolean.valueOf(is_set_script()).compareTo(other.is_set_script()); if (lastComparison != 0) { return lastComparison; } @@ -355,16 +325,16 @@ public class ShellComponent implements org.apache.thrift.TBase<ShellComponent, S } 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("ShellComponent("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("ShellComponent("); boolean first = true; sb.append("execution_command:"); @@ -399,7 +369,7 @@ public class ShellComponent implements org.apache.thrift.TBase<ShellComponent, S } } - 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) { @@ -407,13 +377,13 @@ public class ShellComponent implements org.apache.thrift.TBase<ShellComponent, S } } - private static class ShellComponentStandardSchemeFactory implements SchemeFactory { + private static class ShellComponentStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public ShellComponentStandardScheme getScheme() { return new ShellComponentStandardScheme(); } } - private static class ShellComponentStandardScheme extends StandardScheme<ShellComponent> { + private static class ShellComponentStandardScheme extends org.apache.thrift.scheme.StandardScheme<ShellComponent> { public void read(org.apache.thrift.protocol.TProtocol iprot, ShellComponent struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -470,18 +440,18 @@ public class ShellComponent implements org.apache.thrift.TBase<ShellComponent, S } - private static class ShellComponentTupleSchemeFactory implements SchemeFactory { + private static class ShellComponentTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public ShellComponentTupleScheme getScheme() { return new ShellComponentTupleScheme(); } } - private static class ShellComponentTupleScheme extends TupleScheme<ShellComponent> { + private static class ShellComponentTupleScheme extends org.apache.thrift.scheme.TupleScheme<ShellComponent> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, ShellComponent 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_execution_command()) { optionals.set(0); } @@ -499,8 +469,8 @@ public class ShellComponent implements org.apache.thrift.TBase<ShellComponent, S @Override public void read(org.apache.thrift.protocol.TProtocol prot, ShellComponent struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(2); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.execution_command = iprot.readString(); struct.set_execution_command_isSet(true); @@ -512,5 +482,8 @@ public class ShellComponent implements org.apache.thrift.TBase<ShellComponent, S } } + 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/SpecificAggregateStats.java ---------------------------------------------------------------------- diff --git a/storm-client/src/jvm/org/apache/storm/generated/SpecificAggregateStats.java b/storm-client/src/jvm/org/apache/storm/generated/SpecificAggregateStats.java index 22bff71..293004b 100644 --- a/storm-client/src/jvm/org/apache/storm/generated/SpecificAggregateStats.java +++ b/storm-client/src/jvm/org/apache/storm/generated/SpecificAggregateStats.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 SpecificAggregateStats extends org.apache.thrift.TUnion<SpecificAggregateStats, SpecificAggregateStats._Fields> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SpecificAggregateStats"); private static final org.apache.thrift.protocol.TField BOLT_FIELD_DESC = new org.apache.thrift.protocol.TField("bolt", org.apache.thrift.protocol.TType.STRUCT, (short)1); @@ -61,10 +34,10 @@ public class SpecificAggregateStats extends org.apache.thrift.TUnion<SpecificAgg BOLT((short)1, "bolt"), SPOUT((short)2, "spout"); - 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 SpecificAggregateStats extends org.apache.thrift.TUnion<SpecificAgg */ 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 SpecificAggregateStats extends org.apache.thrift.TUnion<SpecificAgg 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); - tmpMap.put(_Fields.BOLT, new org.apache.thrift.meta_data.FieldMetaData("bolt", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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.BOLT, new org.apache.thrift.meta_data.FieldMetaData("bolt", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, BoltAggregateStats.class))); - tmpMap.put(_Fields.SPOUT, new org.apache.thrift.meta_data.FieldMetaData("spout", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.SPOUT, new org.apache.thrift.meta_data.FieldMetaData("spout", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SpoutAggregateStats.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SpecificAggregateStats.class, metaDataMap); } @@ -132,7 +105,7 @@ public class SpecificAggregateStats extends org.apache.thrift.TUnion<SpecificAgg super(); } - public SpecificAggregateStats(_Fields setField, Object value) { + public SpecificAggregateStats(_Fields setField, java.lang.Object value) { super(setField, value); } @@ -157,25 +130,25 @@ public class SpecificAggregateStats extends org.apache.thrift.TUnion<SpecificAgg @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 BOLT: if (value instanceof BoltAggregateStats) { break; } - throw new ClassCastException("Was expecting value of type BoltAggregateStats for field 'bolt', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type BoltAggregateStats for field 'bolt', but got " + value.getClass().getSimpleName()); case SPOUT: if (value instanceof SpoutAggregateStats) { break; } - throw new ClassCastException("Was expecting value of type SpoutAggregateStats for field 'spout', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type SpoutAggregateStats for field 'spout', 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 SpecificAggregateStats extends org.apache.thrift.TUnion<SpecificAgg 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 SpecificAggregateStats extends org.apache.thrift.TUnion<SpecificAgg spout.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 SpecificAggregateStats extends org.apache.thrift.TUnion<SpecificAgg spout.read(iprot); return spout; 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 SpecificAggregateStats extends org.apache.thrift.TUnion<SpecificAgg spout.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 SpecificAggregateStats extends org.apache.thrift.TUnion<SpecificAgg case SPOUT: return SPOUT_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 SpecificAggregateStats extends org.apache.thrift.TUnion<SpecificAgg if (getSetField() == _Fields.BOLT) { return (BoltAggregateStats)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'bolt' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'bolt' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void set_bolt(BoltAggregateStats value) { - if (value == null) throw new NullPointerException(); + if (value == null) throw new java.lang.NullPointerException(); setField_ = _Fields.BOLT; value_ = value; } @@ -308,12 +281,12 @@ public class SpecificAggregateStats extends org.apache.thrift.TUnion<SpecificAgg if (getSetField() == _Fields.SPOUT) { return (SpoutAggregateStats)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'spout' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'spout' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void set_spout(SpoutAggregateStats value) { - if (value == null) throw new NullPointerException(); + if (value == null) throw new java.lang.NullPointerException(); setField_ = _Fields.SPOUT; value_ = value; } @@ -328,7 +301,7 @@ public class SpecificAggregateStats extends org.apache.thrift.TUnion<SpecificAgg } - public boolean equals(Object other) { + public boolean equals(java.lang.Object other) { if (other instanceof SpecificAggregateStats) { return equals((SpecificAggregateStats)other); } else { @@ -352,12 +325,12 @@ public class SpecificAggregateStats extends org.apache.thrift.TUnion<SpecificAgg @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 SpecificAggregateStats extends org.apache.thrift.TUnion<SpecificAgg } - 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/SpoutAggregateStats.java ---------------------------------------------------------------------- diff --git a/storm-client/src/jvm/org/apache/storm/generated/SpoutAggregateStats.java b/storm-client/src/jvm/org/apache/storm/generated/SpoutAggregateStats.java index 712bc35..796f6ad 100644 --- a/storm-client/src/jvm/org/apache/storm/generated/SpoutAggregateStats.java +++ b/storm-client/src/jvm/org/apache/storm/generated/SpoutAggregateStats.java @@ -16,52 +16,22 @@ * 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 SpoutAggregateStats implements org.apache.thrift.TBase<SpoutAggregateStats, SpoutAggregateStats._Fields>, java.io.Serializable, Cloneable, Comparable<SpoutAggregateStats> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SpoutAggregateStats"); private static final org.apache.thrift.protocol.TField COMPLETE_LATENCY_MS_FIELD_DESC = new org.apache.thrift.protocol.TField("complete_latency_ms", org.apache.thrift.protocol.TType.DOUBLE, (short)1); - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new SpoutAggregateStatsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new SpoutAggregateStatsTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new SpoutAggregateStatsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new SpoutAggregateStatsTupleSchemeFactory(); private double complete_latency_ms; // optional @@ -69,10 +39,10 @@ public class SpoutAggregateStats implements org.apache.thrift.TBase<SpoutAggrega public enum _Fields implements org.apache.thrift.TFieldIdEnum { COMPLETE_LATENCY_MS((short)1, "complete_latency_ms"); - 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 SpoutAggregateStats implements org.apache.thrift.TBase<SpoutAggrega */ 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,7 +88,7 @@ public class SpoutAggregateStats implements org.apache.thrift.TBase<SpoutAggrega return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } @@ -127,12 +97,12 @@ public class SpoutAggregateStats implements org.apache.thrift.TBase<SpoutAggrega private static final int __COMPLETE_LATENCY_MS_ISSET_ID = 0; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.COMPLETE_LATENCY_MS}; - 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.COMPLETE_LATENCY_MS, new org.apache.thrift.meta_data.FieldMetaData("complete_latency_ms", org.apache.thrift.TFieldRequirementType.OPTIONAL, 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(SpoutAggregateStats.class, metaDataMap); } @@ -167,55 +137,55 @@ public class SpoutAggregateStats implements org.apache.thrift.TBase<SpoutAggrega } public void unset_complete_latency_ms() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __COMPLETE_LATENCY_MS_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __COMPLETE_LATENCY_MS_ISSET_ID); } /** Returns true if field complete_latency_ms is set (has been assigned a value) and false otherwise */ public boolean is_set_complete_latency_ms() { - return EncodingUtils.testBit(__isset_bitfield, __COMPLETE_LATENCY_MS_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COMPLETE_LATENCY_MS_ISSET_ID); } public void set_complete_latency_ms_isSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __COMPLETE_LATENCY_MS_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __COMPLETE_LATENCY_MS_ISSET_ID, value); } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case COMPLETE_LATENCY_MS: if (value == null) { unset_complete_latency_ms(); } else { - set_complete_latency_ms((Double)value); + set_complete_latency_ms((java.lang.Double)value); } break; } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case COMPLETE_LATENCY_MS: return get_complete_latency_ms(); } - 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 COMPLETE_LATENCY_MS: return is_set_complete_latency_ms(); } - 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 SpoutAggregateStats) @@ -226,6 +196,8 @@ public class SpoutAggregateStats implements org.apache.thrift.TBase<SpoutAggrega public boolean equals(SpoutAggregateStats that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_complete_latency_ms = true && this.is_set_complete_latency_ms(); boolean that_present_complete_latency_ms = true && that.is_set_complete_latency_ms(); @@ -241,14 +213,13 @@ public class SpoutAggregateStats implements org.apache.thrift.TBase<SpoutAggrega @Override public int hashCode() { - List<Object> list = new ArrayList<Object>(); + int hashCode = 1; - boolean present_complete_latency_ms = true && (is_set_complete_latency_ms()); - list.add(present_complete_latency_ms); - if (present_complete_latency_ms) - list.add(complete_latency_ms); + hashCode = hashCode * 8191 + ((is_set_complete_latency_ms()) ? 131071 : 524287); + if (is_set_complete_latency_ms()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(complete_latency_ms); - return list.hashCode(); + return hashCode; } @Override @@ -259,7 +230,7 @@ public class SpoutAggregateStats implements org.apache.thrift.TBase<SpoutAggrega int lastComparison = 0; - lastComparison = Boolean.valueOf(is_set_complete_latency_ms()).compareTo(other.is_set_complete_latency_ms()); + lastComparison = java.lang.Boolean.valueOf(is_set_complete_latency_ms()).compareTo(other.is_set_complete_latency_ms()); if (lastComparison != 0) { return lastComparison; } @@ -277,16 +248,16 @@ public class SpoutAggregateStats implements org.apache.thrift.TBase<SpoutAggrega } 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("SpoutAggregateStats("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("SpoutAggregateStats("); boolean first = true; if (is_set_complete_latency_ms()) { @@ -311,7 +282,7 @@ public class SpoutAggregateStats implements org.apache.thrift.TBase<SpoutAggrega } } - 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; @@ -321,13 +292,13 @@ public class SpoutAggregateStats implements org.apache.thrift.TBase<SpoutAggrega } } - private static class SpoutAggregateStatsStandardSchemeFactory implements SchemeFactory { + private static class SpoutAggregateStatsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public SpoutAggregateStatsStandardScheme getScheme() { return new SpoutAggregateStatsStandardScheme(); } } - private static class SpoutAggregateStatsStandardScheme extends StandardScheme<SpoutAggregateStats> { + private static class SpoutAggregateStatsStandardScheme extends org.apache.thrift.scheme.StandardScheme<SpoutAggregateStats> { public void read(org.apache.thrift.protocol.TProtocol iprot, SpoutAggregateStats struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -371,18 +342,18 @@ public class SpoutAggregateStats implements org.apache.thrift.TBase<SpoutAggrega } - private static class SpoutAggregateStatsTupleSchemeFactory implements SchemeFactory { + private static class SpoutAggregateStatsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public SpoutAggregateStatsTupleScheme getScheme() { return new SpoutAggregateStatsTupleScheme(); } } - private static class SpoutAggregateStatsTupleScheme extends TupleScheme<SpoutAggregateStats> { + private static class SpoutAggregateStatsTupleScheme extends org.apache.thrift.scheme.TupleScheme<SpoutAggregateStats> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, SpoutAggregateStats 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_complete_latency_ms()) { optionals.set(0); } @@ -394,8 +365,8 @@ public class SpoutAggregateStats implements org.apache.thrift.TBase<SpoutAggrega @Override public void read(org.apache.thrift.protocol.TProtocol prot, SpoutAggregateStats 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)) { struct.complete_latency_ms = iprot.readDouble(); struct.set_complete_latency_ms_isSet(true); @@ -403,5 +374,8 @@ public class SpoutAggregateStats implements org.apache.thrift.TBase<SpoutAggrega } } + 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/SpoutSpec.java ---------------------------------------------------------------------- diff --git a/storm-client/src/jvm/org/apache/storm/generated/SpoutSpec.java b/storm-client/src/jvm/org/apache/storm/generated/SpoutSpec.java index bb7919e..e8a38c4 100644 --- a/storm-client/src/jvm/org/apache/storm/generated/SpoutSpec.java +++ b/storm-client/src/jvm/org/apache/storm/generated/SpoutSpec.java @@ -16,53 +16,23 @@ * 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 SpoutSpec implements org.apache.thrift.TBase<SpoutSpec, SpoutSpec._Fields>, java.io.Serializable, Cloneable, Comparable<SpoutSpec> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SpoutSpec"); private static final org.apache.thrift.protocol.TField SPOUT_OBJECT_FIELD_DESC = new org.apache.thrift.protocol.TField("spout_object", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField COMMON_FIELD_DESC = new org.apache.thrift.protocol.TField("common", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new SpoutSpecStandardSchemeFactory()); - schemes.put(TupleScheme.class, new SpoutSpecTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new SpoutSpecStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new SpoutSpecTupleSchemeFactory(); private ComponentObject spout_object; // required private ComponentCommon common; // required @@ -72,10 +42,10 @@ public class SpoutSpec implements org.apache.thrift.TBase<SpoutSpec, SpoutSpec._ SPOUT_OBJECT((short)1, "spout_object"), COMMON((short)2, "common"); - 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 SpoutSpec implements org.apache.thrift.TBase<SpoutSpec, SpoutSpec._ */ 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 SpoutSpec implements org.apache.thrift.TBase<SpoutSpec, SpoutSpec._ 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.SPOUT_OBJECT, new org.apache.thrift.meta_data.FieldMetaData("spout_object", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ComponentObject.class))); tmpMap.put(_Fields.COMMON, new org.apache.thrift.meta_data.FieldMetaData("common", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ComponentCommon.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SpoutSpec.class, metaDataMap); } @@ -220,7 +190,7 @@ public class SpoutSpec implements org.apache.thrift.TBase<SpoutSpec, SpoutSpec._ } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case SPOUT_OBJECT: if (value == null) { @@ -241,7 +211,7 @@ public class SpoutSpec implements org.apache.thrift.TBase<SpoutSpec, SpoutSpec._ } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SPOUT_OBJECT: return get_spout_object(); @@ -250,13 +220,13 @@ public class SpoutSpec implements org.apache.thrift.TBase<SpoutSpec, SpoutSpec._ return get_common(); } - 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) { @@ -265,11 +235,11 @@ public class SpoutSpec implements org.apache.thrift.TBase<SpoutSpec, SpoutSpec._ case COMMON: return is_set_common(); } - 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 SpoutSpec) @@ -280,6 +250,8 @@ public class SpoutSpec implements org.apache.thrift.TBase<SpoutSpec, SpoutSpec._ public boolean equals(SpoutSpec that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_spout_object = true && this.is_set_spout_object(); boolean that_present_spout_object = true && that.is_set_spout_object(); @@ -304,19 +276,17 @@ public class SpoutSpec implements org.apache.thrift.TBase<SpoutSpec, SpoutSpec._ @Override public int hashCode() { - List<Object> list = new ArrayList<Object>(); + int hashCode = 1; - boolean present_spout_object = true && (is_set_spout_object()); - list.add(present_spout_object); - if (present_spout_object) - list.add(spout_object); + hashCode = hashCode * 8191 + ((is_set_spout_object()) ? 131071 : 524287); + if (is_set_spout_object()) + hashCode = hashCode * 8191 + spout_object.hashCode(); - boolean present_common = true && (is_set_common()); - list.add(present_common); - if (present_common) - list.add(common); + hashCode = hashCode * 8191 + ((is_set_common()) ? 131071 : 524287); + if (is_set_common()) + hashCode = hashCode * 8191 + common.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -327,7 +297,7 @@ public class SpoutSpec implements org.apache.thrift.TBase<SpoutSpec, SpoutSpec._ int lastComparison = 0; - lastComparison = Boolean.valueOf(is_set_spout_object()).compareTo(other.is_set_spout_object()); + lastComparison = java.lang.Boolean.valueOf(is_set_spout_object()).compareTo(other.is_set_spout_object()); if (lastComparison != 0) { return lastComparison; } @@ -337,7 +307,7 @@ public class SpoutSpec implements org.apache.thrift.TBase<SpoutSpec, SpoutSpec._ return lastComparison; } } - lastComparison = Boolean.valueOf(is_set_common()).compareTo(other.is_set_common()); + lastComparison = java.lang.Boolean.valueOf(is_set_common()).compareTo(other.is_set_common()); if (lastComparison != 0) { return lastComparison; } @@ -355,16 +325,16 @@ public class SpoutSpec implements org.apache.thrift.TBase<SpoutSpec, SpoutSpec._ } 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("SpoutSpec("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("SpoutSpec("); boolean first = true; sb.append("spout_object:"); @@ -410,7 +380,7 @@ public class SpoutSpec implements org.apache.thrift.TBase<SpoutSpec, SpoutSpec._ } } - 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) { @@ -418,13 +388,13 @@ public class SpoutSpec implements org.apache.thrift.TBase<SpoutSpec, SpoutSpec._ } } - private static class SpoutSpecStandardSchemeFactory implements SchemeFactory { + private static class SpoutSpecStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public SpoutSpecStandardScheme getScheme() { return new SpoutSpecStandardScheme(); } } - private static class SpoutSpecStandardScheme extends StandardScheme<SpoutSpec> { + private static class SpoutSpecStandardScheme extends org.apache.thrift.scheme.StandardScheme<SpoutSpec> { public void read(org.apache.thrift.protocol.TProtocol iprot, SpoutSpec struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -483,24 +453,24 @@ public class SpoutSpec implements org.apache.thrift.TBase<SpoutSpec, SpoutSpec._ } - private static class SpoutSpecTupleSchemeFactory implements SchemeFactory { + private static class SpoutSpecTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public SpoutSpecTupleScheme getScheme() { return new SpoutSpecTupleScheme(); } } - private static class SpoutSpecTupleScheme extends TupleScheme<SpoutSpec> { + private static class SpoutSpecTupleScheme extends org.apache.thrift.scheme.TupleScheme<SpoutSpec> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, SpoutSpec struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.spout_object.write(oprot); struct.common.write(oprot); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, SpoutSpec struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.spout_object = new ComponentObject(); struct.spout_object.read(iprot); struct.set_spout_object_isSet(true); @@ -510,5 +480,8 @@ public class SpoutSpec implements org.apache.thrift.TBase<SpoutSpec, SpoutSpec._ } } + 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(); + } }
