http://git-wip-us.apache.org/repos/asf/storm/blob/1fd1e17f/storm-client/src/jvm/org/apache/storm/generated/DRPCExecutionException.java ---------------------------------------------------------------------- diff --git a/storm-client/src/jvm/org/apache/storm/generated/DRPCExecutionException.java b/storm-client/src/jvm/org/apache/storm/generated/DRPCExecutionException.java index fd701ff..2ef23eb 100644 --- a/storm-client/src/jvm/org/apache/storm/generated/DRPCExecutionException.java +++ b/storm-client/src/jvm/org/apache/storm/generated/DRPCExecutionException.java @@ -16,55 +16,25 @@ * 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 DRPCExecutionException extends TException implements org.apache.thrift.TBase<DRPCExecutionException, DRPCExecutionException._Fields>, java.io.Serializable, Cloneable, Comparable<DRPCExecutionException> { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) [email protected](value = "Autogenerated by Thrift Compiler (0.11.0)") +public class DRPCExecutionException extends org.apache.thrift.TException implements org.apache.thrift.TBase<DRPCExecutionException, DRPCExecutionException._Fields>, java.io.Serializable, Cloneable, Comparable<DRPCExecutionException> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("DRPCExecutionException"); 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 org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)2); - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new DRPCExecutionExceptionStandardSchemeFactory()); - schemes.put(TupleScheme.class, new DRPCExecutionExceptionTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new DRPCExecutionExceptionStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new DRPCExecutionExceptionTupleSchemeFactory(); - private String msg; // required + private java.lang.String msg; // required private DRPCExceptionType type; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -76,10 +46,10 @@ public class DRPCExecutionException extends TException implements org.apache.thr */ TYPE((short)2, "type"); - 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); } } @@ -104,21 +74,21 @@ public class DRPCExecutionException extends TException implements org.apache.thr */ 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; } @@ -127,21 +97,21 @@ public class DRPCExecutionException extends TException implements org.apache.thr return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.TYPE}; - 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))); tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, DRPCExceptionType.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DRPCExecutionException.class, metaDataMap); } @@ -149,7 +119,7 @@ public class DRPCExecutionException extends TException implements org.apache.thr } public DRPCExecutionException( - String msg) + java.lang.String msg) { this(); this.msg = msg; @@ -177,11 +147,11 @@ public class DRPCExecutionException extends TException implements org.apache.thr this.type = 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; } @@ -231,13 +201,13 @@ public class DRPCExecutionException extends TException implements org.apache.thr } } - 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; @@ -252,7 +222,7 @@ public class DRPCExecutionException extends TException implements org.apache.thr } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case MSG: return get_msg(); @@ -261,13 +231,13 @@ public class DRPCExecutionException extends TException implements org.apache.thr return get_type(); } - 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) { @@ -276,11 +246,11 @@ public class DRPCExecutionException extends TException implements org.apache.thr case TYPE: return is_set_type(); } - 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 DRPCExecutionException) @@ -291,6 +261,8 @@ public class DRPCExecutionException extends TException implements org.apache.thr public boolean equals(DRPCExecutionException 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(); @@ -315,19 +287,17 @@ public class DRPCExecutionException extends TException implements org.apache.thr @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(); - 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(); - return list.hashCode(); + return hashCode; } @Override @@ -338,7 +308,7 @@ public class DRPCExecutionException extends TException implements org.apache.thr 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; } @@ -348,7 +318,7 @@ public class DRPCExecutionException extends TException implements org.apache.thr return lastComparison; } } - 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; } @@ -366,16 +336,16 @@ public class DRPCExecutionException extends TException implements org.apache.thr } 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("DRPCExecutionException("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("DRPCExecutionException("); boolean first = true; sb.append("msg:"); @@ -416,7 +386,7 @@ public class DRPCExecutionException extends TException implements org.apache.thr } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -424,13 +394,13 @@ public class DRPCExecutionException extends TException implements org.apache.thr } } - private static class DRPCExecutionExceptionStandardSchemeFactory implements SchemeFactory { + private static class DRPCExecutionExceptionStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public DRPCExecutionExceptionStandardScheme getScheme() { return new DRPCExecutionExceptionStandardScheme(); } } - private static class DRPCExecutionExceptionStandardScheme extends StandardScheme<DRPCExecutionException> { + private static class DRPCExecutionExceptionStandardScheme extends org.apache.thrift.scheme.StandardScheme<DRPCExecutionException> { public void read(org.apache.thrift.protocol.TProtocol iprot, DRPCExecutionException struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -489,19 +459,19 @@ public class DRPCExecutionException extends TException implements org.apache.thr } - private static class DRPCExecutionExceptionTupleSchemeFactory implements SchemeFactory { + private static class DRPCExecutionExceptionTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public DRPCExecutionExceptionTupleScheme getScheme() { return new DRPCExecutionExceptionTupleScheme(); } } - private static class DRPCExecutionExceptionTupleScheme extends TupleScheme<DRPCExecutionException> { + private static class DRPCExecutionExceptionTupleScheme extends org.apache.thrift.scheme.TupleScheme<DRPCExecutionException> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, DRPCExecutionException 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); - BitSet optionals = new BitSet(); + java.util.BitSet optionals = new java.util.BitSet(); if (struct.is_set_type()) { optionals.set(0); } @@ -513,10 +483,10 @@ public class DRPCExecutionException extends TException implements org.apache.thr @Override public void read(org.apache.thrift.protocol.TProtocol prot, DRPCExecutionException 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); - BitSet incoming = iprot.readBitSet(1); + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.type = org.apache.storm.generated.DRPCExceptionType.findByValue(iprot.readI32()); struct.set_type_isSet(true); @@ -524,5 +494,8 @@ public class DRPCExecutionException extends TException implements org.apache.thr } } + 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/DRPCRequest.java ---------------------------------------------------------------------- diff --git a/storm-client/src/jvm/org/apache/storm/generated/DRPCRequest.java b/storm-client/src/jvm/org/apache/storm/generated/DRPCRequest.java index 33d85c2..9e90a33 100644 --- a/storm-client/src/jvm/org/apache/storm/generated/DRPCRequest.java +++ b/storm-client/src/jvm/org/apache/storm/generated/DRPCRequest.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 DRPCRequest implements org.apache.thrift.TBase<DRPCRequest, DRPCRequest._Fields>, java.io.Serializable, Cloneable, Comparable<DRPCRequest> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("DRPCRequest"); private static final org.apache.thrift.protocol.TField FUNC_ARGS_FIELD_DESC = new org.apache.thrift.protocol.TField("func_args", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField REQUEST_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("request_id", 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 DRPCRequestStandardSchemeFactory()); - schemes.put(TupleScheme.class, new DRPCRequestTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new DRPCRequestStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new DRPCRequestTupleSchemeFactory(); - private String func_args; // required - private String request_id; // required + private java.lang.String func_args; // required + private java.lang.String request_id; // 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 { FUNC_ARGS((short)1, "func_args"), REQUEST_ID((short)2, "request_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); } } @@ -100,21 +70,21 @@ public class DRPCRequest implements org.apache.thrift.TBase<DRPCRequest, DRPCReq */ 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 DRPCRequest implements org.apache.thrift.TBase<DRPCRequest, DRPCReq 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.FUNC_ARGS, new org.apache.thrift.meta_data.FieldMetaData("func_args", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.REQUEST_ID, new org.apache.thrift.meta_data.FieldMetaData("request_id", 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(DRPCRequest.class, metaDataMap); } @@ -144,8 +114,8 @@ public class DRPCRequest implements org.apache.thrift.TBase<DRPCRequest, DRPCReq } public DRPCRequest( - String func_args, - String request_id) + java.lang.String func_args, + java.lang.String request_id) { this(); this.func_args = func_args; @@ -174,11 +144,11 @@ public class DRPCRequest implements org.apache.thrift.TBase<DRPCRequest, DRPCReq this.request_id = null; } - public String get_func_args() { + public java.lang.String get_func_args() { return this.func_args; } - public void set_func_args(String func_args) { + public void set_func_args(java.lang.String func_args) { this.func_args = func_args; } @@ -197,11 +167,11 @@ public class DRPCRequest implements org.apache.thrift.TBase<DRPCRequest, DRPCReq } } - public String get_request_id() { + public java.lang.String get_request_id() { return this.request_id; } - public void set_request_id(String request_id) { + public void set_request_id(java.lang.String request_id) { this.request_id = request_id; } @@ -220,13 +190,13 @@ public class DRPCRequest implements org.apache.thrift.TBase<DRPCRequest, DRPCReq } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case FUNC_ARGS: if (value == null) { unset_func_args(); } else { - set_func_args((String)value); + set_func_args((java.lang.String)value); } break; @@ -234,14 +204,14 @@ public class DRPCRequest implements org.apache.thrift.TBase<DRPCRequest, DRPCReq if (value == null) { unset_request_id(); } else { - set_request_id((String)value); + set_request_id((java.lang.String)value); } break; } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case FUNC_ARGS: return get_func_args(); @@ -250,13 +220,13 @@ public class DRPCRequest implements org.apache.thrift.TBase<DRPCRequest, DRPCReq return get_request_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) { @@ -265,11 +235,11 @@ public class DRPCRequest implements org.apache.thrift.TBase<DRPCRequest, DRPCReq case REQUEST_ID: return is_set_request_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 DRPCRequest) @@ -280,6 +250,8 @@ public class DRPCRequest implements org.apache.thrift.TBase<DRPCRequest, DRPCReq public boolean equals(DRPCRequest that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_func_args = true && this.is_set_func_args(); boolean that_present_func_args = true && that.is_set_func_args(); @@ -304,19 +276,17 @@ public class DRPCRequest implements org.apache.thrift.TBase<DRPCRequest, DRPCReq @Override public int hashCode() { - List<Object> list = new ArrayList<Object>(); + int hashCode = 1; - boolean present_func_args = true && (is_set_func_args()); - list.add(present_func_args); - if (present_func_args) - list.add(func_args); + hashCode = hashCode * 8191 + ((is_set_func_args()) ? 131071 : 524287); + if (is_set_func_args()) + hashCode = hashCode * 8191 + func_args.hashCode(); - boolean present_request_id = true && (is_set_request_id()); - list.add(present_request_id); - if (present_request_id) - list.add(request_id); + hashCode = hashCode * 8191 + ((is_set_request_id()) ? 131071 : 524287); + if (is_set_request_id()) + hashCode = hashCode * 8191 + request_id.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -327,7 +297,7 @@ public class DRPCRequest implements org.apache.thrift.TBase<DRPCRequest, DRPCReq int lastComparison = 0; - lastComparison = Boolean.valueOf(is_set_func_args()).compareTo(other.is_set_func_args()); + lastComparison = java.lang.Boolean.valueOf(is_set_func_args()).compareTo(other.is_set_func_args()); if (lastComparison != 0) { return lastComparison; } @@ -337,7 +307,7 @@ public class DRPCRequest implements org.apache.thrift.TBase<DRPCRequest, DRPCReq return lastComparison; } } - lastComparison = Boolean.valueOf(is_set_request_id()).compareTo(other.is_set_request_id()); + lastComparison = java.lang.Boolean.valueOf(is_set_request_id()).compareTo(other.is_set_request_id()); if (lastComparison != 0) { return lastComparison; } @@ -355,16 +325,16 @@ public class DRPCRequest implements org.apache.thrift.TBase<DRPCRequest, DRPCReq } 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("DRPCRequest("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("DRPCRequest("); boolean first = true; sb.append("func_args:"); @@ -407,7 +377,7 @@ public class DRPCRequest implements org.apache.thrift.TBase<DRPCRequest, DRPCReq } } - 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) { @@ -415,13 +385,13 @@ public class DRPCRequest implements org.apache.thrift.TBase<DRPCRequest, DRPCReq } } - private static class DRPCRequestStandardSchemeFactory implements SchemeFactory { + private static class DRPCRequestStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public DRPCRequestStandardScheme getScheme() { return new DRPCRequestStandardScheme(); } } - private static class DRPCRequestStandardScheme extends StandardScheme<DRPCRequest> { + private static class DRPCRequestStandardScheme extends org.apache.thrift.scheme.StandardScheme<DRPCRequest> { public void read(org.apache.thrift.protocol.TProtocol iprot, DRPCRequest struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -478,24 +448,24 @@ public class DRPCRequest implements org.apache.thrift.TBase<DRPCRequest, DRPCReq } - private static class DRPCRequestTupleSchemeFactory implements SchemeFactory { + private static class DRPCRequestTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public DRPCRequestTupleScheme getScheme() { return new DRPCRequestTupleScheme(); } } - private static class DRPCRequestTupleScheme extends TupleScheme<DRPCRequest> { + private static class DRPCRequestTupleScheme extends org.apache.thrift.scheme.TupleScheme<DRPCRequest> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, DRPCRequest 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.func_args); oprot.writeString(struct.request_id); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, DRPCRequest struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.func_args = iprot.readString(); struct.set_func_args_isSet(true); struct.request_id = iprot.readString(); @@ -503,5 +473,8 @@ public class DRPCRequest implements org.apache.thrift.TBase<DRPCRequest, DRPCReq } } + 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/DebugOptions.java ---------------------------------------------------------------------- diff --git a/storm-client/src/jvm/org/apache/storm/generated/DebugOptions.java b/storm-client/src/jvm/org/apache/storm/generated/DebugOptions.java index 1ceb853..8532ee8 100644 --- a/storm-client/src/jvm/org/apache/storm/generated/DebugOptions.java +++ b/storm-client/src/jvm/org/apache/storm/generated/DebugOptions.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 DebugOptions implements org.apache.thrift.TBase<DebugOptions, DebugOptions._Fields>, java.io.Serializable, Cloneable, Comparable<DebugOptions> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("DebugOptions"); private static final org.apache.thrift.protocol.TField ENABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("enable", org.apache.thrift.protocol.TType.BOOL, (short)1); private static final org.apache.thrift.protocol.TField SAMPLINGPCT_FIELD_DESC = new org.apache.thrift.protocol.TField("samplingpct", org.apache.thrift.protocol.TType.DOUBLE, (short)2); - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new DebugOptionsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new DebugOptionsTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new DebugOptionsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new DebugOptionsTupleSchemeFactory(); private boolean enable; // optional private double samplingpct; // optional @@ -72,10 +42,10 @@ public class DebugOptions implements org.apache.thrift.TBase<DebugOptions, Debug ENABLE((short)1, "enable"), SAMPLINGPCT((short)2, "samplingpct"); - 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 DebugOptions implements org.apache.thrift.TBase<DebugOptions, Debug */ 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,7 +93,7 @@ public class DebugOptions implements org.apache.thrift.TBase<DebugOptions, Debug return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } @@ -133,14 +103,14 @@ public class DebugOptions implements org.apache.thrift.TBase<DebugOptions, Debug private static final int __SAMPLINGPCT_ISSET_ID = 1; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.ENABLE,_Fields.SAMPLINGPCT}; - 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.ENABLE, new org.apache.thrift.meta_data.FieldMetaData("enable", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.SAMPLINGPCT, new org.apache.thrift.meta_data.FieldMetaData("samplingpct", 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(DebugOptions.class, metaDataMap); } @@ -178,16 +148,16 @@ public class DebugOptions implements org.apache.thrift.TBase<DebugOptions, Debug } public void unset_enable() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ENABLE_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ENABLE_ISSET_ID); } /** Returns true if field enable is set (has been assigned a value) and false otherwise */ public boolean is_set_enable() { - return EncodingUtils.testBit(__isset_bitfield, __ENABLE_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ENABLE_ISSET_ID); } public void set_enable_isSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ENABLE_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ENABLE_ISSET_ID, value); } public double get_samplingpct() { @@ -200,25 +170,25 @@ public class DebugOptions implements org.apache.thrift.TBase<DebugOptions, Debug } public void unset_samplingpct() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SAMPLINGPCT_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SAMPLINGPCT_ISSET_ID); } /** Returns true if field samplingpct is set (has been assigned a value) and false otherwise */ public boolean is_set_samplingpct() { - return EncodingUtils.testBit(__isset_bitfield, __SAMPLINGPCT_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SAMPLINGPCT_ISSET_ID); } public void set_samplingpct_isSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SAMPLINGPCT_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SAMPLINGPCT_ISSET_ID, value); } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case ENABLE: if (value == null) { unset_enable(); } else { - set_enable((Boolean)value); + set_enable((java.lang.Boolean)value); } break; @@ -226,14 +196,14 @@ public class DebugOptions implements org.apache.thrift.TBase<DebugOptions, Debug if (value == null) { unset_samplingpct(); } else { - set_samplingpct((Double)value); + set_samplingpct((java.lang.Double)value); } break; } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case ENABLE: return is_enable(); @@ -242,13 +212,13 @@ public class DebugOptions implements org.apache.thrift.TBase<DebugOptions, Debug return get_samplingpct(); } - 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) { @@ -257,11 +227,11 @@ public class DebugOptions implements org.apache.thrift.TBase<DebugOptions, Debug case SAMPLINGPCT: return is_set_samplingpct(); } - 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 DebugOptions) @@ -272,6 +242,8 @@ public class DebugOptions implements org.apache.thrift.TBase<DebugOptions, Debug public boolean equals(DebugOptions that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_enable = true && this.is_set_enable(); boolean that_present_enable = true && that.is_set_enable(); @@ -296,19 +268,17 @@ public class DebugOptions implements org.apache.thrift.TBase<DebugOptions, Debug @Override public int hashCode() { - List<Object> list = new ArrayList<Object>(); + int hashCode = 1; - boolean present_enable = true && (is_set_enable()); - list.add(present_enable); - if (present_enable) - list.add(enable); + hashCode = hashCode * 8191 + ((is_set_enable()) ? 131071 : 524287); + if (is_set_enable()) + hashCode = hashCode * 8191 + ((enable) ? 131071 : 524287); - boolean present_samplingpct = true && (is_set_samplingpct()); - list.add(present_samplingpct); - if (present_samplingpct) - list.add(samplingpct); + hashCode = hashCode * 8191 + ((is_set_samplingpct()) ? 131071 : 524287); + if (is_set_samplingpct()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(samplingpct); - return list.hashCode(); + return hashCode; } @Override @@ -319,7 +289,7 @@ public class DebugOptions implements org.apache.thrift.TBase<DebugOptions, Debug int lastComparison = 0; - lastComparison = Boolean.valueOf(is_set_enable()).compareTo(other.is_set_enable()); + lastComparison = java.lang.Boolean.valueOf(is_set_enable()).compareTo(other.is_set_enable()); if (lastComparison != 0) { return lastComparison; } @@ -329,7 +299,7 @@ public class DebugOptions implements org.apache.thrift.TBase<DebugOptions, Debug return lastComparison; } } - lastComparison = Boolean.valueOf(is_set_samplingpct()).compareTo(other.is_set_samplingpct()); + lastComparison = java.lang.Boolean.valueOf(is_set_samplingpct()).compareTo(other.is_set_samplingpct()); if (lastComparison != 0) { return lastComparison; } @@ -347,16 +317,16 @@ public class DebugOptions implements org.apache.thrift.TBase<DebugOptions, Debug } 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("DebugOptions("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("DebugOptions("); boolean first = true; if (is_set_enable()) { @@ -387,7 +357,7 @@ public class DebugOptions implements org.apache.thrift.TBase<DebugOptions, Debug } } - 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; @@ -397,13 +367,13 @@ public class DebugOptions implements org.apache.thrift.TBase<DebugOptions, Debug } } - private static class DebugOptionsStandardSchemeFactory implements SchemeFactory { + private static class DebugOptionsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public DebugOptionsStandardScheme getScheme() { return new DebugOptionsStandardScheme(); } } - private static class DebugOptionsStandardScheme extends StandardScheme<DebugOptions> { + private static class DebugOptionsStandardScheme extends org.apache.thrift.scheme.StandardScheme<DebugOptions> { public void read(org.apache.thrift.protocol.TProtocol iprot, DebugOptions struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -460,18 +430,18 @@ public class DebugOptions implements org.apache.thrift.TBase<DebugOptions, Debug } - private static class DebugOptionsTupleSchemeFactory implements SchemeFactory { + private static class DebugOptionsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public DebugOptionsTupleScheme getScheme() { return new DebugOptionsTupleScheme(); } } - private static class DebugOptionsTupleScheme extends TupleScheme<DebugOptions> { + private static class DebugOptionsTupleScheme extends org.apache.thrift.scheme.TupleScheme<DebugOptions> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, DebugOptions 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_enable()) { optionals.set(0); } @@ -489,8 +459,8 @@ public class DebugOptions implements org.apache.thrift.TBase<DebugOptions, Debug @Override public void read(org.apache.thrift.protocol.TProtocol prot, DebugOptions 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.enable = iprot.readBool(); struct.set_enable_isSet(true); @@ -502,5 +472,8 @@ public class DebugOptions implements org.apache.thrift.TBase<DebugOptions, Debug } } + 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(); + } }
