http://git-wip-us.apache.org/repos/asf/storm/blob/1fd1e17f/storm-client/src/jvm/org/apache/storm/generated/Grouping.java ---------------------------------------------------------------------- diff --git a/storm-client/src/jvm/org/apache/storm/generated/Grouping.java b/storm-client/src/jvm/org/apache/storm/generated/Grouping.java index ccb19bc..5befe37 100644 --- a/storm-client/src/jvm/org/apache/storm/generated/Grouping.java +++ b/storm-client/src/jvm/org/apache/storm/generated/Grouping.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 Grouping extends org.apache.thrift.TUnion<Grouping, Grouping._Fields> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Grouping"); private static final org.apache.thrift.protocol.TField FIELDS_FIELD_DESC = new org.apache.thrift.protocol.TField("fields", org.apache.thrift.protocol.TType.LIST, (short)1); @@ -73,10 +46,10 @@ public class Grouping extends org.apache.thrift.TUnion<Grouping, Grouping._Field CUSTOM_SERIALIZED((short)7, "custom_serialized"), LOCAL_OR_SHUFFLE((short)8, "local_or_shuffle"); - 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); } } @@ -113,21 +86,21 @@ public class Grouping extends org.apache.thrift.TUnion<Grouping, Grouping._Field */ 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; } @@ -136,32 +109,32 @@ public class Grouping extends org.apache.thrift.TUnion<Grouping, Grouping._Field 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.FIELDS, new org.apache.thrift.meta_data.FieldMetaData("fields", 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.FIELDS, new org.apache.thrift.meta_data.FieldMetaData("fields", org.apache.thrift.TFieldRequirementType.OPTIONAL, 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)))); - tmpMap.put(_Fields.SHUFFLE, new org.apache.thrift.meta_data.FieldMetaData("shuffle", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.SHUFFLE, new org.apache.thrift.meta_data.FieldMetaData("shuffle", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, NullStruct.class))); - tmpMap.put(_Fields.ALL, new org.apache.thrift.meta_data.FieldMetaData("all", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.ALL, new org.apache.thrift.meta_data.FieldMetaData("all", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, NullStruct.class))); - tmpMap.put(_Fields.NONE, new org.apache.thrift.meta_data.FieldMetaData("none", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.NONE, new org.apache.thrift.meta_data.FieldMetaData("none", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, NullStruct.class))); - tmpMap.put(_Fields.DIRECT, new org.apache.thrift.meta_data.FieldMetaData("direct", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.DIRECT, new org.apache.thrift.meta_data.FieldMetaData("direct", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, NullStruct.class))); - tmpMap.put(_Fields.CUSTOM_OBJECT, new org.apache.thrift.meta_data.FieldMetaData("custom_object", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.CUSTOM_OBJECT, new org.apache.thrift.meta_data.FieldMetaData("custom_object", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, JavaObject.class))); - tmpMap.put(_Fields.CUSTOM_SERIALIZED, new org.apache.thrift.meta_data.FieldMetaData("custom_serialized", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.CUSTOM_SERIALIZED, new org.apache.thrift.meta_data.FieldMetaData("custom_serialized", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - tmpMap.put(_Fields.LOCAL_OR_SHUFFLE, new org.apache.thrift.meta_data.FieldMetaData("local_or_shuffle", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.LOCAL_OR_SHUFFLE, new org.apache.thrift.meta_data.FieldMetaData("local_or_shuffle", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, NullStruct.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Grouping.class, metaDataMap); } @@ -169,7 +142,7 @@ public class Grouping extends org.apache.thrift.TUnion<Grouping, Grouping._Field super(); } - public Grouping(_Fields setField, Object value) { + public Grouping(_Fields setField, java.lang.Object value) { super(setField, value); } @@ -180,7 +153,7 @@ public class Grouping extends org.apache.thrift.TUnion<Grouping, Grouping._Field return new Grouping(this); } - public static Grouping fields(List<String> value) { + public static Grouping fields(java.util.List<java.lang.String> value) { Grouping x = new Grouping(); x.set_fields(value); return x; @@ -216,7 +189,7 @@ public class Grouping extends org.apache.thrift.TUnion<Grouping, Grouping._Field return x; } - public static Grouping custom_serialized(ByteBuffer value) { + public static Grouping custom_serialized(java.nio.ByteBuffer value) { Grouping x = new Grouping(); x.set_custom_serialized(value); return x; @@ -224,7 +197,7 @@ public class Grouping extends org.apache.thrift.TUnion<Grouping, Grouping._Field public static Grouping custom_serialized(byte[] value) { Grouping x = new Grouping(); - x.set_custom_serialized(ByteBuffer.wrap(Arrays.copyOf(value, value.length))); + x.set_custom_serialized(java.nio.ByteBuffer.wrap(value.clone())); return x; } @@ -236,65 +209,65 @@ public class Grouping extends org.apache.thrift.TUnion<Grouping, Grouping._Field @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 FIELDS: - if (value instanceof List) { + if (value instanceof java.util.List) { break; } - throw new ClassCastException("Was expecting value of type List<String> for field 'fields', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type java.util.List<java.lang.String> for field 'fields', but got " + value.getClass().getSimpleName()); case SHUFFLE: if (value instanceof NullStruct) { break; } - throw new ClassCastException("Was expecting value of type NullStruct for field 'shuffle', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type NullStruct for field 'shuffle', but got " + value.getClass().getSimpleName()); case ALL: if (value instanceof NullStruct) { break; } - throw new ClassCastException("Was expecting value of type NullStruct for field 'all', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type NullStruct for field 'all', but got " + value.getClass().getSimpleName()); case NONE: if (value instanceof NullStruct) { break; } - throw new ClassCastException("Was expecting value of type NullStruct for field 'none', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type NullStruct for field 'none', but got " + value.getClass().getSimpleName()); case DIRECT: if (value instanceof NullStruct) { break; } - throw new ClassCastException("Was expecting value of type NullStruct for field 'direct', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type NullStruct for field 'direct', but got " + value.getClass().getSimpleName()); case CUSTOM_OBJECT: if (value instanceof JavaObject) { break; } - throw new ClassCastException("Was expecting value of type JavaObject for field 'custom_object', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type JavaObject for field 'custom_object', but got " + value.getClass().getSimpleName()); case CUSTOM_SERIALIZED: - if (value instanceof ByteBuffer) { + if (value instanceof java.nio.ByteBuffer) { break; } - throw new ClassCastException("Was expecting value of type ByteBuffer for field 'custom_serialized', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type java.nio.ByteBuffer for field 'custom_serialized', but got " + value.getClass().getSimpleName()); case LOCAL_OR_SHUFFLE: if (value instanceof NullStruct) { break; } - throw new ClassCastException("Was expecting value of type NullStruct for field 'local_or_shuffle', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type NullStruct for field 'local_or_shuffle', 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) { case FIELDS: if (field.type == FIELDS_FIELD_DESC.type) { - List<String> fields; + java.util.List<java.lang.String> fields; { org.apache.thrift.protocol.TList _list8 = iprot.readListBegin(); - fields = new ArrayList<String>(_list8.size); - String _elem9; + fields = new java.util.ArrayList<java.lang.String>(_list8.size); + java.lang.String _elem9; for (int _i10 = 0; _i10 < _list8.size; ++_i10) { _elem9 = iprot.readString(); @@ -359,7 +332,7 @@ public class Grouping extends org.apache.thrift.TUnion<Grouping, Grouping._Field } case CUSTOM_SERIALIZED: if (field.type == CUSTOM_SERIALIZED_FIELD_DESC.type) { - ByteBuffer custom_serialized; + java.nio.ByteBuffer custom_serialized; custom_serialized = iprot.readBinary(); return custom_serialized; } else { @@ -377,7 +350,7 @@ public class Grouping extends org.apache.thrift.TUnion<Grouping, Grouping._Field 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); @@ -389,10 +362,10 @@ public class Grouping extends org.apache.thrift.TUnion<Grouping, Grouping._Field protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { switch (setField_) { case FIELDS: - List<String> fields = (List<String>)value_; + java.util.List<java.lang.String> fields = (java.util.List<java.lang.String>)value_; { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, fields.size())); - for (String _iter11 : fields) + for (java.lang.String _iter11 : fields) { oprot.writeString(_iter11); } @@ -420,7 +393,7 @@ public class Grouping extends org.apache.thrift.TUnion<Grouping, Grouping._Field custom_object.write(oprot); return; case CUSTOM_SERIALIZED: - ByteBuffer custom_serialized = (ByteBuffer)value_; + java.nio.ByteBuffer custom_serialized = (java.nio.ByteBuffer)value_; oprot.writeBinary(custom_serialized); return; case LOCAL_OR_SHUFFLE: @@ -428,21 +401,21 @@ public class Grouping extends org.apache.thrift.TUnion<Grouping, Grouping._Field local_or_shuffle.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) { case FIELDS: - List<String> fields; + java.util.List<java.lang.String> fields; { org.apache.thrift.protocol.TList _list12 = iprot.readListBegin(); - fields = new ArrayList<String>(_list12.size); - String _elem13; + fields = new java.util.ArrayList<java.lang.String>(_list12.size); + java.lang.String _elem13; for (int _i14 = 0; _i14 < _list12.size; ++_i14) { _elem13 = iprot.readString(); @@ -477,7 +450,7 @@ public class Grouping extends org.apache.thrift.TUnion<Grouping, Grouping._Field custom_object.read(iprot); return custom_object; case CUSTOM_SERIALIZED: - ByteBuffer custom_serialized; + java.nio.ByteBuffer custom_serialized; custom_serialized = iprot.readBinary(); return custom_serialized; case LOCAL_OR_SHUFFLE: @@ -486,10 +459,10 @@ public class Grouping extends org.apache.thrift.TUnion<Grouping, Grouping._Field local_or_shuffle.read(iprot); return local_or_shuffle; 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); } } @@ -497,10 +470,10 @@ public class Grouping extends org.apache.thrift.TUnion<Grouping, Grouping._Field protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { switch (setField_) { case FIELDS: - List<String> fields = (List<String>)value_; + java.util.List<java.lang.String> fields = (java.util.List<java.lang.String>)value_; { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, fields.size())); - for (String _iter15 : fields) + for (java.lang.String _iter15 : fields) { oprot.writeString(_iter15); } @@ -528,7 +501,7 @@ public class Grouping extends org.apache.thrift.TUnion<Grouping, Grouping._Field custom_object.write(oprot); return; case CUSTOM_SERIALIZED: - ByteBuffer custom_serialized = (ByteBuffer)value_; + java.nio.ByteBuffer custom_serialized = (java.nio.ByteBuffer)value_; oprot.writeBinary(custom_serialized); return; case LOCAL_OR_SHUFFLE: @@ -536,7 +509,7 @@ public class Grouping extends org.apache.thrift.TUnion<Grouping, Grouping._Field local_or_shuffle.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_); } } @@ -560,7 +533,7 @@ public class Grouping extends org.apache.thrift.TUnion<Grouping, Grouping._Field case LOCAL_OR_SHUFFLE: return LOCAL_OR_SHUFFLE_FIELD_DESC; default: - throw new IllegalArgumentException("Unknown field id " + setField); + throw new java.lang.IllegalArgumentException("Unknown field id " + setField); } } @@ -579,16 +552,16 @@ public class Grouping extends org.apache.thrift.TUnion<Grouping, Grouping._Field } - public List<String> get_fields() { + public java.util.List<java.lang.String> get_fields() { if (getSetField() == _Fields.FIELDS) { - return (List<String>)getFieldValue(); + return (java.util.List<java.lang.String>)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'fields' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'fields' because union is currently set to " + getFieldDesc(getSetField()).name); } } - public void set_fields(List<String> value) { - if (value == null) throw new NullPointerException(); + public void set_fields(java.util.List<java.lang.String> value) { + if (value == null) throw new java.lang.NullPointerException(); setField_ = _Fields.FIELDS; value_ = value; } @@ -597,12 +570,12 @@ public class Grouping extends org.apache.thrift.TUnion<Grouping, Grouping._Field if (getSetField() == _Fields.SHUFFLE) { return (NullStruct)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'shuffle' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'shuffle' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void set_shuffle(NullStruct value) { - if (value == null) throw new NullPointerException(); + if (value == null) throw new java.lang.NullPointerException(); setField_ = _Fields.SHUFFLE; value_ = value; } @@ -611,12 +584,12 @@ public class Grouping extends org.apache.thrift.TUnion<Grouping, Grouping._Field if (getSetField() == _Fields.ALL) { return (NullStruct)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'all' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'all' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void set_all(NullStruct value) { - if (value == null) throw new NullPointerException(); + if (value == null) throw new java.lang.NullPointerException(); setField_ = _Fields.ALL; value_ = value; } @@ -625,12 +598,12 @@ public class Grouping extends org.apache.thrift.TUnion<Grouping, Grouping._Field if (getSetField() == _Fields.NONE) { return (NullStruct)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'none' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'none' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void set_none(NullStruct value) { - if (value == null) throw new NullPointerException(); + if (value == null) throw new java.lang.NullPointerException(); setField_ = _Fields.NONE; value_ = value; } @@ -639,12 +612,12 @@ public class Grouping extends org.apache.thrift.TUnion<Grouping, Grouping._Field if (getSetField() == _Fields.DIRECT) { return (NullStruct)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'direct' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'direct' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void set_direct(NullStruct value) { - if (value == null) throw new NullPointerException(); + if (value == null) throw new java.lang.NullPointerException(); setField_ = _Fields.DIRECT; value_ = value; } @@ -653,36 +626,36 @@ public class Grouping extends org.apache.thrift.TUnion<Grouping, Grouping._Field if (getSetField() == _Fields.CUSTOM_OBJECT) { return (JavaObject)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'custom_object' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'custom_object' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void set_custom_object(JavaObject value) { - if (value == null) throw new NullPointerException(); + if (value == null) throw new java.lang.NullPointerException(); setField_ = _Fields.CUSTOM_OBJECT; value_ = value; } public byte[] get_custom_serialized() { set_custom_serialized(org.apache.thrift.TBaseHelper.rightSize(buffer_for_custom_serialized())); - ByteBuffer b = buffer_for_custom_serialized(); + java.nio.ByteBuffer b = buffer_for_custom_serialized(); return b == null ? null : b.array(); } - public ByteBuffer buffer_for_custom_serialized() { + public java.nio.ByteBuffer buffer_for_custom_serialized() { if (getSetField() == _Fields.CUSTOM_SERIALIZED) { - return org.apache.thrift.TBaseHelper.copyBinary((ByteBuffer)getFieldValue()); + return org.apache.thrift.TBaseHelper.copyBinary((java.nio.ByteBuffer)getFieldValue()); } else { - throw new RuntimeException("Cannot get field 'custom_serialized' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'custom_serialized' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void set_custom_serialized(byte[] value) { - set_custom_serialized(ByteBuffer.wrap(Arrays.copyOf(value, value.length))); + set_custom_serialized(java.nio.ByteBuffer.wrap(value.clone())); } - public void set_custom_serialized(ByteBuffer value) { - if (value == null) throw new NullPointerException(); + public void set_custom_serialized(java.nio.ByteBuffer value) { + if (value == null) throw new java.lang.NullPointerException(); setField_ = _Fields.CUSTOM_SERIALIZED; value_ = value; } @@ -691,12 +664,12 @@ public class Grouping extends org.apache.thrift.TUnion<Grouping, Grouping._Field if (getSetField() == _Fields.LOCAL_OR_SHUFFLE) { return (NullStruct)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'local_or_shuffle' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'local_or_shuffle' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void set_local_or_shuffle(NullStruct value) { - if (value == null) throw new NullPointerException(); + if (value == null) throw new java.lang.NullPointerException(); setField_ = _Fields.LOCAL_OR_SHUFFLE; value_ = value; } @@ -741,7 +714,7 @@ public class Grouping extends org.apache.thrift.TUnion<Grouping, Grouping._Field } - public boolean equals(Object other) { + public boolean equals(java.lang.Object other) { if (other instanceof Grouping) { return equals((Grouping)other); } else { @@ -765,12 +738,12 @@ public class Grouping extends org.apache.thrift.TUnion<Grouping, Grouping._Field @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 { @@ -788,7 +761,7 @@ public class Grouping extends org.apache.thrift.TUnion<Grouping, Grouping._Field } - 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/HBAuthorizationException.java ---------------------------------------------------------------------- diff --git a/storm-client/src/jvm/org/apache/storm/generated/HBAuthorizationException.java b/storm-client/src/jvm/org/apache/storm/generated/HBAuthorizationException.java index cb31213..12305ec 100644 --- a/storm-client/src/jvm/org/apache/storm/generated/HBAuthorizationException.java +++ b/storm-client/src/jvm/org/apache/storm/generated/HBAuthorizationException.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)") -public class HBAuthorizationException extends TException implements org.apache.thrift.TBase<HBAuthorizationException, HBAuthorizationException._Fields>, java.io.Serializable, Cloneable, Comparable<HBAuthorizationException> { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) [email protected](value = "Autogenerated by Thrift Compiler (0.11.0)") +public class HBAuthorizationException extends org.apache.thrift.TException implements org.apache.thrift.TBase<HBAuthorizationException, HBAuthorizationException._Fields>, java.io.Serializable, Cloneable, Comparable<HBAuthorizationException> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("HBAuthorizationException"); private static final org.apache.thrift.protocol.TField MSG_FIELD_DESC = new org.apache.thrift.protocol.TField("msg", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new HBAuthorizationExceptionStandardSchemeFactory()); - schemes.put(TupleScheme.class, new HBAuthorizationExceptionTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new HBAuthorizationExceptionStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new HBAuthorizationExceptionTupleSchemeFactory(); - private String msg; // required + private java.lang.String msg; // 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 { MSG((short)1, "msg"); - 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 HBAuthorizationException extends TException implements org.apache.t */ 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,18 +88,18 @@ public class HBAuthorizationException extends TException implements org.apache.t 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.MSG, new org.apache.thrift.meta_data.FieldMetaData("msg", org.apache.thrift.TFieldRequirementType.REQUIRED, 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(HBAuthorizationException.class, metaDataMap); } @@ -137,7 +107,7 @@ public class HBAuthorizationException extends TException implements org.apache.t } public HBAuthorizationException( - String msg) + java.lang.String msg) { this(); this.msg = msg; @@ -161,11 +131,11 @@ public class HBAuthorizationException extends TException implements org.apache.t this.msg = null; } - public String get_msg() { + public java.lang.String get_msg() { return this.msg; } - public void set_msg(String msg) { + public void set_msg(java.lang.String msg) { this.msg = msg; } @@ -184,43 +154,43 @@ public class HBAuthorizationException extends TException implements org.apache.t } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case MSG: if (value == null) { unset_msg(); } else { - set_msg((String)value); + set_msg((java.lang.String)value); } break; } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case MSG: return get_msg(); } - 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 MSG: return is_set_msg(); } - 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 HBAuthorizationException) @@ -231,6 +201,8 @@ public class HBAuthorizationException extends TException implements org.apache.t public boolean equals(HBAuthorizationException that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_msg = true && this.is_set_msg(); boolean that_present_msg = true && that.is_set_msg(); @@ -246,14 +218,13 @@ public class HBAuthorizationException extends TException implements org.apache.t @Override public int hashCode() { - List<Object> list = new ArrayList<Object>(); + int hashCode = 1; - boolean present_msg = true && (is_set_msg()); - list.add(present_msg); - if (present_msg) - list.add(msg); + hashCode = hashCode * 8191 + ((is_set_msg()) ? 131071 : 524287); + if (is_set_msg()) + hashCode = hashCode * 8191 + msg.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -264,7 +235,7 @@ public class HBAuthorizationException extends TException implements org.apache.t int lastComparison = 0; - lastComparison = Boolean.valueOf(is_set_msg()).compareTo(other.is_set_msg()); + lastComparison = java.lang.Boolean.valueOf(is_set_msg()).compareTo(other.is_set_msg()); if (lastComparison != 0) { return lastComparison; } @@ -282,16 +253,16 @@ public class HBAuthorizationException extends TException implements org.apache.t } 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("HBAuthorizationException("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("HBAuthorizationException("); boolean first = true; sb.append("msg:"); @@ -322,7 +293,7 @@ public class HBAuthorizationException extends TException implements org.apache.t } } - 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) { @@ -330,13 +301,13 @@ public class HBAuthorizationException extends TException implements org.apache.t } } - private static class HBAuthorizationExceptionStandardSchemeFactory implements SchemeFactory { + private static class HBAuthorizationExceptionStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public HBAuthorizationExceptionStandardScheme getScheme() { return new HBAuthorizationExceptionStandardScheme(); } } - private static class HBAuthorizationExceptionStandardScheme extends StandardScheme<HBAuthorizationException> { + private static class HBAuthorizationExceptionStandardScheme extends org.apache.thrift.scheme.StandardScheme<HBAuthorizationException> { public void read(org.apache.thrift.protocol.TProtocol iprot, HBAuthorizationException struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -380,27 +351,30 @@ public class HBAuthorizationException extends TException implements org.apache.t } - private static class HBAuthorizationExceptionTupleSchemeFactory implements SchemeFactory { + private static class HBAuthorizationExceptionTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public HBAuthorizationExceptionTupleScheme getScheme() { return new HBAuthorizationExceptionTupleScheme(); } } - private static class HBAuthorizationExceptionTupleScheme extends TupleScheme<HBAuthorizationException> { + private static class HBAuthorizationExceptionTupleScheme extends org.apache.thrift.scheme.TupleScheme<HBAuthorizationException> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, HBAuthorizationException 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.msg); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, HBAuthorizationException struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.msg = iprot.readString(); struct.set_msg_isSet(true); } } + 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/HBExecutionException.java ---------------------------------------------------------------------- diff --git a/storm-client/src/jvm/org/apache/storm/generated/HBExecutionException.java b/storm-client/src/jvm/org/apache/storm/generated/HBExecutionException.java index 697dd06..a073b7e 100644 --- a/storm-client/src/jvm/org/apache/storm/generated/HBExecutionException.java +++ b/storm-client/src/jvm/org/apache/storm/generated/HBExecutionException.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)") -public class HBExecutionException extends TException implements org.apache.thrift.TBase<HBExecutionException, HBExecutionException._Fields>, java.io.Serializable, Cloneable, Comparable<HBExecutionException> { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) [email protected](value = "Autogenerated by Thrift Compiler (0.11.0)") +public class HBExecutionException extends org.apache.thrift.TException implements org.apache.thrift.TBase<HBExecutionException, HBExecutionException._Fields>, java.io.Serializable, Cloneable, Comparable<HBExecutionException> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("HBExecutionException"); private static final org.apache.thrift.protocol.TField MSG_FIELD_DESC = new org.apache.thrift.protocol.TField("msg", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new HBExecutionExceptionStandardSchemeFactory()); - schemes.put(TupleScheme.class, new HBExecutionExceptionTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new HBExecutionExceptionStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new HBExecutionExceptionTupleSchemeFactory(); - private String msg; // required + private java.lang.String msg; // 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 { MSG((short)1, "msg"); - 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 HBExecutionException extends TException implements org.apache.thrif */ 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,18 +88,18 @@ public class HBExecutionException extends TException implements org.apache.thrif 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.MSG, new org.apache.thrift.meta_data.FieldMetaData("msg", org.apache.thrift.TFieldRequirementType.REQUIRED, 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(HBExecutionException.class, metaDataMap); } @@ -137,7 +107,7 @@ public class HBExecutionException extends TException implements org.apache.thrif } public HBExecutionException( - String msg) + java.lang.String msg) { this(); this.msg = msg; @@ -161,11 +131,11 @@ public class HBExecutionException extends TException implements org.apache.thrif this.msg = null; } - public String get_msg() { + public java.lang.String get_msg() { return this.msg; } - public void set_msg(String msg) { + public void set_msg(java.lang.String msg) { this.msg = msg; } @@ -184,43 +154,43 @@ public class HBExecutionException extends TException implements org.apache.thrif } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case MSG: if (value == null) { unset_msg(); } else { - set_msg((String)value); + set_msg((java.lang.String)value); } break; } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case MSG: return get_msg(); } - 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 MSG: return is_set_msg(); } - 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 HBExecutionException) @@ -231,6 +201,8 @@ public class HBExecutionException extends TException implements org.apache.thrif public boolean equals(HBExecutionException that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_msg = true && this.is_set_msg(); boolean that_present_msg = true && that.is_set_msg(); @@ -246,14 +218,13 @@ public class HBExecutionException extends TException implements org.apache.thrif @Override public int hashCode() { - List<Object> list = new ArrayList<Object>(); + int hashCode = 1; - boolean present_msg = true && (is_set_msg()); - list.add(present_msg); - if (present_msg) - list.add(msg); + hashCode = hashCode * 8191 + ((is_set_msg()) ? 131071 : 524287); + if (is_set_msg()) + hashCode = hashCode * 8191 + msg.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -264,7 +235,7 @@ public class HBExecutionException extends TException implements org.apache.thrif int lastComparison = 0; - lastComparison = Boolean.valueOf(is_set_msg()).compareTo(other.is_set_msg()); + lastComparison = java.lang.Boolean.valueOf(is_set_msg()).compareTo(other.is_set_msg()); if (lastComparison != 0) { return lastComparison; } @@ -282,16 +253,16 @@ public class HBExecutionException extends TException implements org.apache.thrif } 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("HBExecutionException("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("HBExecutionException("); boolean first = true; sb.append("msg:"); @@ -322,7 +293,7 @@ public class HBExecutionException extends TException implements org.apache.thrif } } - 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) { @@ -330,13 +301,13 @@ public class HBExecutionException extends TException implements org.apache.thrif } } - private static class HBExecutionExceptionStandardSchemeFactory implements SchemeFactory { + private static class HBExecutionExceptionStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public HBExecutionExceptionStandardScheme getScheme() { return new HBExecutionExceptionStandardScheme(); } } - private static class HBExecutionExceptionStandardScheme extends StandardScheme<HBExecutionException> { + private static class HBExecutionExceptionStandardScheme extends org.apache.thrift.scheme.StandardScheme<HBExecutionException> { public void read(org.apache.thrift.protocol.TProtocol iprot, HBExecutionException struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -380,27 +351,30 @@ public class HBExecutionException extends TException implements org.apache.thrif } - private static class HBExecutionExceptionTupleSchemeFactory implements SchemeFactory { + private static class HBExecutionExceptionTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public HBExecutionExceptionTupleScheme getScheme() { return new HBExecutionExceptionTupleScheme(); } } - private static class HBExecutionExceptionTupleScheme extends TupleScheme<HBExecutionException> { + private static class HBExecutionExceptionTupleScheme extends org.apache.thrift.scheme.TupleScheme<HBExecutionException> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, HBExecutionException 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.msg); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, HBExecutionException struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.msg = iprot.readString(); struct.set_msg_isSet(true); } } + 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/HBMessage.java ---------------------------------------------------------------------- diff --git a/storm-client/src/jvm/org/apache/storm/generated/HBMessage.java b/storm-client/src/jvm/org/apache/storm/generated/HBMessage.java index 29d3b21..a6453f6 100644 --- a/storm-client/src/jvm/org/apache/storm/generated/HBMessage.java +++ b/storm-client/src/jvm/org/apache/storm/generated/HBMessage.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 HBMessage implements org.apache.thrift.TBase<HBMessage, HBMessage._Fields>, java.io.Serializable, Cloneable, Comparable<HBMessage> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("HBMessage"); @@ -59,11 +32,8 @@ public class HBMessage implements org.apache.thrift.TBase<HBMessage, HBMessage._ private static final org.apache.thrift.protocol.TField DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("data", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField MESSAGE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("message_id", org.apache.thrift.protocol.TType.I32, (short)3); - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new HBMessageStandardSchemeFactory()); - schemes.put(TupleScheme.class, new HBMessageTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new HBMessageStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new HBMessageTupleSchemeFactory(); private HBServerMessageType type; // required private HBMessageData data; // required @@ -79,10 +49,10 @@ public class HBMessage implements org.apache.thrift.TBase<HBMessage, HBMessage._ DATA((short)2, "data"), MESSAGE_ID((short)3, "message_id"); - 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); } } @@ -109,21 +79,21 @@ public class HBMessage implements org.apache.thrift.TBase<HBMessage, HBMessage._ */ 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; } @@ -132,7 +102,7 @@ public class HBMessage implements org.apache.thrift.TBase<HBMessage, HBMessage._ return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } @@ -141,16 +111,16 @@ public class HBMessage implements org.apache.thrift.TBase<HBMessage, HBMessage._ private static final int __MESSAGE_ID_ISSET_ID = 0; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.MESSAGE_ID}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, HBServerMessageType.class))); tmpMap.put(_Fields.DATA, new org.apache.thrift.meta_data.FieldMetaData("data", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, HBMessageData.class))); tmpMap.put(_Fields.MESSAGE_ID, new org.apache.thrift.meta_data.FieldMetaData("message_id", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(HBMessage.class, metaDataMap); } @@ -258,19 +228,19 @@ public class HBMessage implements org.apache.thrift.TBase<HBMessage, HBMessage._ } public void unset_message_id() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MESSAGE_ID_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MESSAGE_ID_ISSET_ID); } /** Returns true if field message_id is set (has been assigned a value) and false otherwise */ public boolean is_set_message_id() { - return EncodingUtils.testBit(__isset_bitfield, __MESSAGE_ID_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MESSAGE_ID_ISSET_ID); } public void set_message_id_isSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MESSAGE_ID_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MESSAGE_ID_ISSET_ID, value); } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case TYPE: if (value == null) { @@ -292,14 +262,14 @@ public class HBMessage implements org.apache.thrift.TBase<HBMessage, HBMessage._ if (value == null) { unset_message_id(); } else { - set_message_id((Integer)value); + set_message_id((java.lang.Integer)value); } break; } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case TYPE: return get_type(); @@ -311,13 +281,13 @@ public class HBMessage implements org.apache.thrift.TBase<HBMessage, HBMessage._ return get_message_id(); } - 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) { @@ -328,11 +298,11 @@ public class HBMessage implements org.apache.thrift.TBase<HBMessage, HBMessage._ case MESSAGE_ID: return is_set_message_id(); } - 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 HBMessage) @@ -343,6 +313,8 @@ public class HBMessage implements org.apache.thrift.TBase<HBMessage, HBMessage._ public boolean equals(HBMessage that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_type = true && this.is_set_type(); boolean that_present_type = true && that.is_set_type(); @@ -376,24 +348,21 @@ public class HBMessage implements org.apache.thrift.TBase<HBMessage, HBMessage._ @Override public int hashCode() { - List<Object> list = new ArrayList<Object>(); + int hashCode = 1; - boolean present_type = true && (is_set_type()); - list.add(present_type); - if (present_type) - list.add(type.getValue()); + hashCode = hashCode * 8191 + ((is_set_type()) ? 131071 : 524287); + if (is_set_type()) + hashCode = hashCode * 8191 + type.getValue(); - boolean present_data = true && (is_set_data()); - list.add(present_data); - if (present_data) - list.add(data); + hashCode = hashCode * 8191 + ((is_set_data()) ? 131071 : 524287); + if (is_set_data()) + hashCode = hashCode * 8191 + data.hashCode(); - boolean present_message_id = true && (is_set_message_id()); - list.add(present_message_id); - if (present_message_id) - list.add(message_id); + hashCode = hashCode * 8191 + ((is_set_message_id()) ? 131071 : 524287); + if (is_set_message_id()) + hashCode = hashCode * 8191 + message_id; - return list.hashCode(); + return hashCode; } @Override @@ -404,7 +373,7 @@ public class HBMessage implements org.apache.thrift.TBase<HBMessage, HBMessage._ int lastComparison = 0; - lastComparison = Boolean.valueOf(is_set_type()).compareTo(other.is_set_type()); + lastComparison = java.lang.Boolean.valueOf(is_set_type()).compareTo(other.is_set_type()); if (lastComparison != 0) { return lastComparison; } @@ -414,7 +383,7 @@ public class HBMessage implements org.apache.thrift.TBase<HBMessage, HBMessage._ return lastComparison; } } - lastComparison = Boolean.valueOf(is_set_data()).compareTo(other.is_set_data()); + lastComparison = java.lang.Boolean.valueOf(is_set_data()).compareTo(other.is_set_data()); if (lastComparison != 0) { return lastComparison; } @@ -424,7 +393,7 @@ public class HBMessage implements org.apache.thrift.TBase<HBMessage, HBMessage._ return lastComparison; } } - lastComparison = Boolean.valueOf(is_set_message_id()).compareTo(other.is_set_message_id()); + lastComparison = java.lang.Boolean.valueOf(is_set_message_id()).compareTo(other.is_set_message_id()); if (lastComparison != 0) { return lastComparison; } @@ -442,16 +411,16 @@ public class HBMessage implements org.apache.thrift.TBase<HBMessage, HBMessage._ } 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("HBMessage("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("HBMessage("); boolean first = true; sb.append("type:"); @@ -492,7 +461,7 @@ public class HBMessage implements org.apache.thrift.TBase<HBMessage, HBMessage._ } } - 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; @@ -502,13 +471,13 @@ public class HBMessage implements org.apache.thrift.TBase<HBMessage, HBMessage._ } } - private static class HBMessageStandardSchemeFactory implements SchemeFactory { + private static class HBMessageStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public HBMessageStandardScheme getScheme() { return new HBMessageStandardScheme(); } } - private static class HBMessageStandardScheme extends StandardScheme<HBMessage> { + private static class HBMessageStandardScheme extends org.apache.thrift.scheme.StandardScheme<HBMessage> { public void read(org.apache.thrift.protocol.TProtocol iprot, HBMessage struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -579,18 +548,18 @@ public class HBMessage implements org.apache.thrift.TBase<HBMessage, HBMessage._ } - private static class HBMessageTupleSchemeFactory implements SchemeFactory { + private static class HBMessageTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public HBMessageTupleScheme getScheme() { return new HBMessageTupleScheme(); } } - private static class HBMessageTupleScheme extends TupleScheme<HBMessage> { + private static class HBMessageTupleScheme extends org.apache.thrift.scheme.TupleScheme<HBMessage> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, HBMessage struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.is_set_type()) { optionals.set(0); } @@ -614,8 +583,8 @@ public class HBMessage implements org.apache.thrift.TBase<HBMessage, HBMessage._ @Override public void read(org.apache.thrift.protocol.TProtocol prot, HBMessage struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(3); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.type = org.apache.storm.generated.HBServerMessageType.findByValue(iprot.readI32()); struct.set_type_isSet(true); @@ -632,5 +601,8 @@ public class HBMessage implements org.apache.thrift.TBase<HBMessage, HBMessage._ } } + 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(); + } }
