http://git-wip-us.apache.org/repos/asf/storm/blob/ef51dbee/storm-core/src/jvm/backtype/storm/generated/Grouping.java ---------------------------------------------------------------------- diff --git a/storm-core/src/jvm/backtype/storm/generated/Grouping.java b/storm-core/src/jvm/backtype/storm/generated/Grouping.java index 48677ad..3994499 100644 --- a/storm-core/src/jvm/backtype/storm/generated/Grouping.java +++ b/storm-core/src/jvm/backtype/storm/generated/Grouping.java @@ -16,13 +16,24 @@ * limitations under the License. */ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.2) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package backtype.storm.generated; -import org.apache.commons.lang.builder.HashCodeBuilder; +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; @@ -35,9 +46,11 @@ 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"}) 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); @@ -211,7 +224,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(value)); + x.set_custom_serialized(ByteBuffer.wrap(Arrays.copyOf(value, value.length))); return x; } @@ -271,7 +284,7 @@ public class Grouping extends org.apache.thrift.TUnion<Grouping, Grouping._Field } @Override - protected Object readValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { + protected 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) { @@ -279,13 +292,13 @@ public class Grouping extends org.apache.thrift.TUnion<Grouping, Grouping._Field if (field.type == FIELDS_FIELD_DESC.type) { List<String> fields; { - org.apache.thrift.protocol.TList _list4 = iprot.readListBegin(); - fields = new ArrayList<String>(_list4.size); - for (int _i5 = 0; _i5 < _list4.size; ++_i5) + org.apache.thrift.protocol.TList _list8 = iprot.readListBegin(); + fields = new ArrayList<String>(_list8.size); + String _elem9; + for (int _i10 = 0; _i10 < _list8.size; ++_i10) { - String _elem6; // required - _elem6 = iprot.readString(); - fields.add(_elem6); + _elem9 = iprot.readString(); + fields.add(_elem9); } iprot.readListEnd(); } @@ -373,15 +386,123 @@ public class Grouping extends org.apache.thrift.TUnion<Grouping, Grouping._Field } @Override - protected void writeValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { switch (setField_) { case FIELDS: List<String> fields = (List<String>)value_; { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, fields.size())); - for (String _iter7 : fields) + for (String _iter11 : fields) { - oprot.writeString(_iter7); + oprot.writeString(_iter11); + } + oprot.writeListEnd(); + } + return; + case SHUFFLE: + NullStruct shuffle = (NullStruct)value_; + shuffle.write(oprot); + return; + case ALL: + NullStruct all = (NullStruct)value_; + all.write(oprot); + return; + case NONE: + NullStruct none = (NullStruct)value_; + none.write(oprot); + return; + case DIRECT: + NullStruct direct = (NullStruct)value_; + direct.write(oprot); + return; + case CUSTOM_OBJECT: + JavaObject custom_object = (JavaObject)value_; + custom_object.write(oprot); + return; + case CUSTOM_SERIALIZED: + ByteBuffer custom_serialized = (ByteBuffer)value_; + oprot.writeBinary(custom_serialized); + return; + case LOCAL_OR_SHUFFLE: + NullStruct local_or_shuffle = (NullStruct)value_; + local_or_shuffle.write(oprot); + return; + default: + throw new 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 { + _Fields setField = _Fields.findByThriftId(fieldID); + if (setField != null) { + switch (setField) { + case FIELDS: + List<String> fields; + { + org.apache.thrift.protocol.TList _list12 = iprot.readListBegin(); + fields = new ArrayList<String>(_list12.size); + String _elem13; + for (int _i14 = 0; _i14 < _list12.size; ++_i14) + { + _elem13 = iprot.readString(); + fields.add(_elem13); + } + iprot.readListEnd(); + } + return fields; + case SHUFFLE: + NullStruct shuffle; + shuffle = new NullStruct(); + shuffle.read(iprot); + return shuffle; + case ALL: + NullStruct all; + all = new NullStruct(); + all.read(iprot); + return all; + case NONE: + NullStruct none; + none = new NullStruct(); + none.read(iprot); + return none; + case DIRECT: + NullStruct direct; + direct = new NullStruct(); + direct.read(iprot); + return direct; + case CUSTOM_OBJECT: + JavaObject custom_object; + custom_object = new JavaObject(); + custom_object.read(iprot); + return custom_object; + case CUSTOM_SERIALIZED: + ByteBuffer custom_serialized; + custom_serialized = iprot.readBinary(); + return custom_serialized; + case LOCAL_OR_SHUFFLE: + NullStruct local_or_shuffle; + local_or_shuffle = new NullStruct(); + 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!"); + } + } else { + throw new TProtocolException("Couldn't find a field with field id " + fieldID); + } + } + + @Override + protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + switch (setField_) { + case FIELDS: + List<String> fields = (List<String>)value_; + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, fields.size())); + for (String _iter15 : fields) + { + oprot.writeString(_iter15); } oprot.writeListEnd(); } @@ -550,14 +671,14 @@ public class Grouping extends org.apache.thrift.TUnion<Grouping, Grouping._Field public ByteBuffer buffer_for_custom_serialized() { if (getSetField() == _Fields.CUSTOM_SERIALIZED) { - return (ByteBuffer)getFieldValue(); + return org.apache.thrift.TBaseHelper.copyBinary((ByteBuffer)getFieldValue()); } else { throw new 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(value)); + set_custom_serialized(ByteBuffer.wrap(Arrays.copyOf(value, value.length))); } public void set_custom_serialized(ByteBuffer value) { @@ -644,19 +765,19 @@ public class Grouping extends org.apache.thrift.TUnion<Grouping, Grouping._Field @Override public int hashCode() { - HashCodeBuilder hcb = new HashCodeBuilder(); - hcb.append(this.getClass().getName()); + List<Object> list = new ArrayList<Object>(); + list.add(this.getClass().getName()); org.apache.thrift.TFieldIdEnum setField = getSetField(); if (setField != null) { - hcb.append(setField.getThriftFieldId()); + list.add(setField.getThriftFieldId()); Object value = getFieldValue(); if (value instanceof org.apache.thrift.TEnum) { - hcb.append(((org.apache.thrift.TEnum)getFieldValue()).getValue()); + list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue()); } else { - hcb.append(value); + list.add(value); } } - return hcb.toHashCode(); + return list.hashCode(); } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try {
http://git-wip-us.apache.org/repos/asf/storm/blob/ef51dbee/storm-core/src/jvm/backtype/storm/generated/InvalidTopologyException.java ---------------------------------------------------------------------- diff --git a/storm-core/src/jvm/backtype/storm/generated/InvalidTopologyException.java b/storm-core/src/jvm/backtype/storm/generated/InvalidTopologyException.java index 79d917c..f3559a6 100644 --- a/storm-core/src/jvm/backtype/storm/generated/InvalidTopologyException.java +++ b/storm-core/src/jvm/backtype/storm/generated/InvalidTopologyException.java @@ -16,13 +16,24 @@ * limitations under the License. */ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.2) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package backtype.storm.generated; -import org.apache.commons.lang.builder.HashCodeBuilder; +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; @@ -35,14 +46,23 @@ 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; -public class InvalidTopologyException extends Exception implements org.apache.thrift.TBase<InvalidTopologyException, InvalidTopologyException._Fields>, java.io.Serializable, Cloneable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-2-2") +public class InvalidTopologyException extends TException implements org.apache.thrift.TBase<InvalidTopologyException, InvalidTopologyException._Fields>, java.io.Serializable, Cloneable, Comparable<InvalidTopologyException> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("InvalidTopologyException"); 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 InvalidTopologyExceptionStandardSchemeFactory()); + schemes.put(TupleScheme.class, new InvalidTopologyExceptionTupleSchemeFactory()); + } + private String msg; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -104,7 +124,6 @@ public class InvalidTopologyException extends Exception implements org.apache.th } // isset id assignments - public static final 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); @@ -227,30 +246,30 @@ public class InvalidTopologyException extends Exception implements org.apache.th @Override public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); + List<Object> list = new ArrayList<Object>(); boolean present_msg = true && (is_set_msg()); - builder.append(present_msg); + list.add(present_msg); if (present_msg) - builder.append(msg); + list.add(msg); - return builder.toHashCode(); + return list.hashCode(); } + @Override public int compareTo(InvalidTopologyException other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; - InvalidTopologyException typedOther = (InvalidTopologyException)other; - lastComparison = Boolean.valueOf(is_set_msg()).compareTo(typedOther.is_set_msg()); + lastComparison = Boolean.valueOf(is_set_msg()).compareTo(other.is_set_msg()); if (lastComparison != 0) { return lastComparison; } if (is_set_msg()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.msg, typedOther.msg); + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.msg, other.msg); if (lastComparison != 0) { return lastComparison; } @@ -263,42 +282,11 @@ public class InvalidTopologyException extends Exception implements org.apache.th } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // MSG - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.msg = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.msg != null) { - oprot.writeFieldBegin(MSG_FIELD_DESC); - oprot.writeString(this.msg); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -323,6 +311,7 @@ public class InvalidTopologyException extends Exception implements org.apache.th throw new org.apache.thrift.protocol.TProtocolException("Required field 'msg' is unset! Struct:" + toString()); } + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -341,5 +330,77 @@ public class InvalidTopologyException extends Exception implements org.apache.th } } + private static class InvalidTopologyExceptionStandardSchemeFactory implements SchemeFactory { + public InvalidTopologyExceptionStandardScheme getScheme() { + return new InvalidTopologyExceptionStandardScheme(); + } + } + + private static class InvalidTopologyExceptionStandardScheme extends StandardScheme<InvalidTopologyException> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, InvalidTopologyException struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // MSG + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.msg = iprot.readString(); + struct.set_msg_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, InvalidTopologyException struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.msg != null) { + oprot.writeFieldBegin(MSG_FIELD_DESC); + oprot.writeString(struct.msg); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class InvalidTopologyExceptionTupleSchemeFactory implements SchemeFactory { + public InvalidTopologyExceptionTupleScheme getScheme() { + return new InvalidTopologyExceptionTupleScheme(); + } + } + + private static class InvalidTopologyExceptionTupleScheme extends TupleScheme<InvalidTopologyException> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, InvalidTopologyException struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.msg); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, InvalidTopologyException struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.msg = iprot.readString(); + struct.set_msg_isSet(true); + } + } + } http://git-wip-us.apache.org/repos/asf/storm/blob/ef51dbee/storm-core/src/jvm/backtype/storm/generated/JavaObject.java ---------------------------------------------------------------------- diff --git a/storm-core/src/jvm/backtype/storm/generated/JavaObject.java b/storm-core/src/jvm/backtype/storm/generated/JavaObject.java index 8e627ca..4eb4b92 100644 --- a/storm-core/src/jvm/backtype/storm/generated/JavaObject.java +++ b/storm-core/src/jvm/backtype/storm/generated/JavaObject.java @@ -16,13 +16,24 @@ * limitations under the License. */ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.2) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package backtype.storm.generated; -import org.apache.commons.lang.builder.HashCodeBuilder; +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; @@ -35,15 +46,24 @@ 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; -public class JavaObject implements org.apache.thrift.TBase<JavaObject, JavaObject._Fields>, java.io.Serializable, Cloneable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-2-2") +public class JavaObject implements org.apache.thrift.TBase<JavaObject, JavaObject._Fields>, java.io.Serializable, Cloneable, Comparable<JavaObject> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("JavaObject"); private static final org.apache.thrift.protocol.TField FULL_CLASS_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("full_class_name", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField ARGS_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("args_list", org.apache.thrift.protocol.TType.LIST, (short)2); + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new JavaObjectStandardSchemeFactory()); + schemes.put(TupleScheme.class, new JavaObjectTupleSchemeFactory()); + } + private String full_class_name; // required private List<JavaObjectArg> args_list; // required @@ -109,7 +129,6 @@ public class JavaObject implements org.apache.thrift.TBase<JavaObject, JavaObjec } // isset id assignments - public static final 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); @@ -142,7 +161,7 @@ public class JavaObject implements org.apache.thrift.TBase<JavaObject, JavaObjec this.full_class_name = other.full_class_name; } if (other.is_set_args_list()) { - List<JavaObjectArg> __this__args_list = new ArrayList<JavaObjectArg>(); + List<JavaObjectArg> __this__args_list = new ArrayList<JavaObjectArg>(other.args_list.size()); for (JavaObjectArg other_element : other.args_list) { __this__args_list.add(new JavaObjectArg(other_element)); } @@ -305,45 +324,45 @@ public class JavaObject implements org.apache.thrift.TBase<JavaObject, JavaObjec @Override public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); + List<Object> list = new ArrayList<Object>(); boolean present_full_class_name = true && (is_set_full_class_name()); - builder.append(present_full_class_name); + list.add(present_full_class_name); if (present_full_class_name) - builder.append(full_class_name); + list.add(full_class_name); boolean present_args_list = true && (is_set_args_list()); - builder.append(present_args_list); + list.add(present_args_list); if (present_args_list) - builder.append(args_list); + list.add(args_list); - return builder.toHashCode(); + return list.hashCode(); } + @Override public int compareTo(JavaObject other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; - JavaObject typedOther = (JavaObject)other; - lastComparison = Boolean.valueOf(is_set_full_class_name()).compareTo(typedOther.is_set_full_class_name()); + lastComparison = Boolean.valueOf(is_set_full_class_name()).compareTo(other.is_set_full_class_name()); if (lastComparison != 0) { return lastComparison; } if (is_set_full_class_name()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.full_class_name, typedOther.full_class_name); + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.full_class_name, other.full_class_name); if (lastComparison != 0) { return lastComparison; } } - lastComparison = Boolean.valueOf(is_set_args_list()).compareTo(typedOther.is_set_args_list()); + lastComparison = Boolean.valueOf(is_set_args_list()).compareTo(other.is_set_args_list()); if (lastComparison != 0) { return lastComparison; } if (is_set_args_list()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.args_list, typedOther.args_list); + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.args_list, other.args_list); if (lastComparison != 0) { return lastComparison; } @@ -356,72 +375,11 @@ public class JavaObject implements org.apache.thrift.TBase<JavaObject, JavaObjec } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // FULL_CLASS_NAME - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.full_class_name = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // ARGS_LIST - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list0 = iprot.readListBegin(); - this.args_list = new ArrayList<JavaObjectArg>(_list0.size); - for (int _i1 = 0; _i1 < _list0.size; ++_i1) - { - JavaObjectArg _elem2; // required - _elem2 = new JavaObjectArg(); - _elem2.read(iprot); - this.args_list.add(_elem2); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.full_class_name != null) { - oprot.writeFieldBegin(FULL_CLASS_NAME_FIELD_DESC); - oprot.writeString(this.full_class_name); - oprot.writeFieldEnd(); - } - if (this.args_list != null) { - oprot.writeFieldBegin(ARGS_LIST_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.args_list.size())); - for (JavaObjectArg _iter3 : this.args_list) - { - _iter3.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -458,6 +416,7 @@ public class JavaObject implements org.apache.thrift.TBase<JavaObject, JavaObjec throw new org.apache.thrift.protocol.TProtocolException("Required field 'args_list' is unset! Struct:" + toString()); } + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -476,5 +435,127 @@ public class JavaObject implements org.apache.thrift.TBase<JavaObject, JavaObjec } } + private static class JavaObjectStandardSchemeFactory implements SchemeFactory { + public JavaObjectStandardScheme getScheme() { + return new JavaObjectStandardScheme(); + } + } + + private static class JavaObjectStandardScheme extends StandardScheme<JavaObject> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, JavaObject struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // FULL_CLASS_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.full_class_name = iprot.readString(); + struct.set_full_class_name_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ARGS_LIST + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list0 = iprot.readListBegin(); + struct.args_list = new ArrayList<JavaObjectArg>(_list0.size); + JavaObjectArg _elem1; + for (int _i2 = 0; _i2 < _list0.size; ++_i2) + { + _elem1 = new JavaObjectArg(); + _elem1.read(iprot); + struct.args_list.add(_elem1); + } + iprot.readListEnd(); + } + struct.set_args_list_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, JavaObject struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.full_class_name != null) { + oprot.writeFieldBegin(FULL_CLASS_NAME_FIELD_DESC); + oprot.writeString(struct.full_class_name); + oprot.writeFieldEnd(); + } + if (struct.args_list != null) { + oprot.writeFieldBegin(ARGS_LIST_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.args_list.size())); + for (JavaObjectArg _iter3 : struct.args_list) + { + _iter3.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class JavaObjectTupleSchemeFactory implements SchemeFactory { + public JavaObjectTupleScheme getScheme() { + return new JavaObjectTupleScheme(); + } + } + + private static class JavaObjectTupleScheme extends TupleScheme<JavaObject> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, JavaObject struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.full_class_name); + { + oprot.writeI32(struct.args_list.size()); + for (JavaObjectArg _iter4 : struct.args_list) + { + _iter4.write(oprot); + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, JavaObject struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.full_class_name = iprot.readString(); + struct.set_full_class_name_isSet(true); + { + org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.args_list = new ArrayList<JavaObjectArg>(_list5.size); + JavaObjectArg _elem6; + for (int _i7 = 0; _i7 < _list5.size; ++_i7) + { + _elem6 = new JavaObjectArg(); + _elem6.read(iprot); + struct.args_list.add(_elem6); + } + } + struct.set_args_list_isSet(true); + } + } + } http://git-wip-us.apache.org/repos/asf/storm/blob/ef51dbee/storm-core/src/jvm/backtype/storm/generated/JavaObjectArg.java ---------------------------------------------------------------------- diff --git a/storm-core/src/jvm/backtype/storm/generated/JavaObjectArg.java b/storm-core/src/jvm/backtype/storm/generated/JavaObjectArg.java index 8ea3225..e69bd34 100644 --- a/storm-core/src/jvm/backtype/storm/generated/JavaObjectArg.java +++ b/storm-core/src/jvm/backtype/storm/generated/JavaObjectArg.java @@ -16,13 +16,24 @@ * limitations under the License. */ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.2) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package backtype.storm.generated; -import org.apache.commons.lang.builder.HashCodeBuilder; +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; @@ -35,9 +46,11 @@ 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"}) public class JavaObjectArg extends org.apache.thrift.TUnion<JavaObjectArg, JavaObjectArg._Fields> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("JavaObjectArg"); private static final org.apache.thrift.protocol.TField INT_ARG_FIELD_DESC = new org.apache.thrift.protocol.TField("int_arg", org.apache.thrift.protocol.TType.I32, (short)1); @@ -186,7 +199,7 @@ public class JavaObjectArg extends org.apache.thrift.TUnion<JavaObjectArg, JavaO public static JavaObjectArg binary_arg(byte[] value) { JavaObjectArg x = new JavaObjectArg(); - x.set_binary_arg(ByteBuffer.wrap(value)); + x.set_binary_arg(ByteBuffer.wrap(Arrays.copyOf(value, value.length))); return x; } @@ -236,7 +249,7 @@ public class JavaObjectArg extends org.apache.thrift.TUnion<JavaObjectArg, JavaO } @Override - protected Object readValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { + protected 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) { @@ -304,7 +317,76 @@ public class JavaObjectArg extends org.apache.thrift.TUnion<JavaObjectArg, JavaO } @Override - protected void writeValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + switch (setField_) { + case INT_ARG: + Integer int_arg = (Integer)value_; + oprot.writeI32(int_arg); + return; + case LONG_ARG: + Long long_arg = (Long)value_; + oprot.writeI64(long_arg); + return; + case STRING_ARG: + String string_arg = (String)value_; + oprot.writeString(string_arg); + return; + case BOOL_ARG: + Boolean bool_arg = (Boolean)value_; + oprot.writeBool(bool_arg); + return; + case BINARY_ARG: + ByteBuffer binary_arg = (ByteBuffer)value_; + oprot.writeBinary(binary_arg); + return; + case DOUBLE_ARG: + Double double_arg = (Double)value_; + oprot.writeDouble(double_arg); + return; + default: + throw new 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 { + _Fields setField = _Fields.findByThriftId(fieldID); + if (setField != null) { + switch (setField) { + case INT_ARG: + Integer int_arg; + int_arg = iprot.readI32(); + return int_arg; + case LONG_ARG: + Long long_arg; + long_arg = iprot.readI64(); + return long_arg; + case STRING_ARG: + String string_arg; + string_arg = iprot.readString(); + return string_arg; + case BOOL_ARG: + Boolean bool_arg; + bool_arg = iprot.readBool(); + return bool_arg; + case BINARY_ARG: + ByteBuffer binary_arg; + binary_arg = iprot.readBinary(); + return binary_arg; + case DOUBLE_ARG: + Double double_arg; + double_arg = iprot.readDouble(); + return double_arg; + default: + throw new 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); + } + } + + @Override + protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { switch (setField_) { case INT_ARG: Integer int_arg = (Integer)value_; @@ -431,14 +513,14 @@ public class JavaObjectArg extends org.apache.thrift.TUnion<JavaObjectArg, JavaO public ByteBuffer buffer_for_binary_arg() { if (getSetField() == _Fields.BINARY_ARG) { - return (ByteBuffer)getFieldValue(); + return org.apache.thrift.TBaseHelper.copyBinary((ByteBuffer)getFieldValue()); } else { throw new RuntimeException("Cannot get field 'binary_arg' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void set_binary_arg(byte[] value) { - set_binary_arg(ByteBuffer.wrap(value)); + set_binary_arg(ByteBuffer.wrap(Arrays.copyOf(value, value.length))); } public void set_binary_arg(ByteBuffer value) { @@ -514,19 +596,19 @@ public class JavaObjectArg extends org.apache.thrift.TUnion<JavaObjectArg, JavaO @Override public int hashCode() { - HashCodeBuilder hcb = new HashCodeBuilder(); - hcb.append(this.getClass().getName()); + List<Object> list = new ArrayList<Object>(); + list.add(this.getClass().getName()); org.apache.thrift.TFieldIdEnum setField = getSetField(); if (setField != null) { - hcb.append(setField.getThriftFieldId()); + list.add(setField.getThriftFieldId()); Object value = getFieldValue(); if (value instanceof org.apache.thrift.TEnum) { - hcb.append(((org.apache.thrift.TEnum)getFieldValue()).getValue()); + list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue()); } else { - hcb.append(value); + list.add(value); } } - return hcb.toHashCode(); + return list.hashCode(); } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { http://git-wip-us.apache.org/repos/asf/storm/blob/ef51dbee/storm-core/src/jvm/backtype/storm/generated/KillOptions.java ---------------------------------------------------------------------- diff --git a/storm-core/src/jvm/backtype/storm/generated/KillOptions.java b/storm-core/src/jvm/backtype/storm/generated/KillOptions.java index 26dd959..0207550 100644 --- a/storm-core/src/jvm/backtype/storm/generated/KillOptions.java +++ b/storm-core/src/jvm/backtype/storm/generated/KillOptions.java @@ -16,13 +16,24 @@ * limitations under the License. */ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.2) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package backtype.storm.generated; -import org.apache.commons.lang.builder.HashCodeBuilder; +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; @@ -35,15 +46,24 @@ 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; -public class KillOptions implements org.apache.thrift.TBase<KillOptions, KillOptions._Fields>, java.io.Serializable, Cloneable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-2-2") +public class KillOptions implements org.apache.thrift.TBase<KillOptions, KillOptions._Fields>, java.io.Serializable, Cloneable, Comparable<KillOptions> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("KillOptions"); private static final org.apache.thrift.protocol.TField WAIT_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("wait_secs", org.apache.thrift.protocol.TType.I32, (short)1); - private int wait_secs; // required + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new KillOptionsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new KillOptionsTupleSchemeFactory()); + } + + private int wait_secs; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -105,8 +125,8 @@ public class KillOptions implements org.apache.thrift.TBase<KillOptions, KillOpt // isset id assignments private static final int __WAIT_SECS_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.WAIT_SECS}; public static final 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); @@ -123,8 +143,7 @@ public class KillOptions implements org.apache.thrift.TBase<KillOptions, KillOpt * Performs a deep copy on <i>other</i>. */ public KillOptions(KillOptions other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.wait_secs = other.wait_secs; } @@ -148,16 +167,16 @@ public class KillOptions implements org.apache.thrift.TBase<KillOptions, KillOpt } public void unset_wait_secs() { - __isset_bit_vector.clear(__WAIT_SECS_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __WAIT_SECS_ISSET_ID); } /** Returns true if field wait_secs is set (has been assigned a value) and false otherwise */ public boolean is_set_wait_secs() { - return __isset_bit_vector.get(__WAIT_SECS_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __WAIT_SECS_ISSET_ID); } public void set_wait_secs_isSet(boolean value) { - __isset_bit_vector.set(__WAIT_SECS_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __WAIT_SECS_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { @@ -222,30 +241,30 @@ public class KillOptions implements org.apache.thrift.TBase<KillOptions, KillOpt @Override public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); + List<Object> list = new ArrayList<Object>(); boolean present_wait_secs = true && (is_set_wait_secs()); - builder.append(present_wait_secs); + list.add(present_wait_secs); if (present_wait_secs) - builder.append(wait_secs); + list.add(wait_secs); - return builder.toHashCode(); + return list.hashCode(); } + @Override public int compareTo(KillOptions other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; - KillOptions typedOther = (KillOptions)other; - lastComparison = Boolean.valueOf(is_set_wait_secs()).compareTo(typedOther.is_set_wait_secs()); + lastComparison = Boolean.valueOf(is_set_wait_secs()).compareTo(other.is_set_wait_secs()); if (lastComparison != 0) { return lastComparison; } if (is_set_wait_secs()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wait_secs, typedOther.wait_secs); + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wait_secs, other.wait_secs); if (lastComparison != 0) { return lastComparison; } @@ -258,43 +277,11 @@ public class KillOptions implements org.apache.thrift.TBase<KillOptions, KillOpt } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // WAIT_SECS - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.wait_secs = iprot.readI32(); - set_wait_secs_isSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (is_set_wait_secs()) { - oprot.writeFieldBegin(WAIT_SECS_FIELD_DESC); - oprot.writeI32(this.wait_secs); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -313,6 +300,7 @@ public class KillOptions implements org.apache.thrift.TBase<KillOptions, KillOpt public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -326,12 +314,94 @@ public class KillOptions implements org.apache.thrift.TBase<KillOptions, KillOpt private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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_bit_vector = new BitSet(1); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class KillOptionsStandardSchemeFactory implements SchemeFactory { + public KillOptionsStandardScheme getScheme() { + return new KillOptionsStandardScheme(); + } + } + + private static class KillOptionsStandardScheme extends StandardScheme<KillOptions> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, KillOptions struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // WAIT_SECS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.wait_secs = iprot.readI32(); + struct.set_wait_secs_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, KillOptions struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.is_set_wait_secs()) { + oprot.writeFieldBegin(WAIT_SECS_FIELD_DESC); + oprot.writeI32(struct.wait_secs); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class KillOptionsTupleSchemeFactory implements SchemeFactory { + public KillOptionsTupleScheme getScheme() { + return new KillOptionsTupleScheme(); + } + } + + private static class KillOptionsTupleScheme extends TupleScheme<KillOptions> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, KillOptions struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.is_set_wait_secs()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.is_set_wait_secs()) { + oprot.writeI32(struct.wait_secs); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, KillOptions struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.wait_secs = iprot.readI32(); + struct.set_wait_secs_isSet(true); + } + } + } + }
