diff --git a/LICENSE.html b/LICENSE.html index aaa5ca772..f5ab9c1cc 100644 --- a/LICENSE.html +++ b/LICENSE.html @@ -26,7 +26,7 @@ -

Copyright (c) Nathan Marz. All rights reserved.

+

Copyright (c) Alibaba. All rights reserved.

Eclipse Public License - v 1.0

THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE diff --git a/changehistory b/changehistory index cb6fb624f..128c68e45 100644 --- a/changehistory +++ b/changehistory @@ -1,68 +1,70 @@ -# Release 0.7.1 -In this version, it will follow storm 0.7.1 interface, so the topology running -in storm 0.7.1 can run in jstorm without any change. - -Stability -1. add setting "zmq.max.queue.msg" for zeromq -2. communication between worker and tasks without zeromq -3. Add catch exception operation -3.1. in supervisor SyncProcess/SyncSupervisor -3.2. add catch exception and report_error in spout's open and bolt's prepare -3.3. in all IO operation -3.4. in all serialize/deserialize -3.5. in all ZK operation -3.6 in topology upload/download function -3.7 during initialization zeromq -4. do assignmen/reassignment operation in one thread to avoid competition -5. redesign nimbus 's topology assign algorithm, make the logic simple much. -6. redesign supervisor's sync assignment algorithm, make the logic simple much -7. reduce zookeeper load -7.1 redesign nimbus monitor logic, it will just scan tasks' hearbeat, frequency is 10s -7.2 nimbus cancel watch on supervisor -7.3 supervisor heartbeat frequence change to 10s -7.4 supervisor syncSupervisor/syncProcess frequence change to 10s -7.5 supervisor scan /$(ZKROOT)/assignment only once in one monitor loop -7.6 task hearbeat change to 10s -8 create task pid file before connection zk, this is very import when zk is unstable. - - -Performance tuning -1. reduce once memory copy when deserialize tuple, improve performance huge. -2. split executor thread as two thread, one handing receive tuples, one sending tuples, improve performance much -3. redeisign sample code, it will sampling every 5 seconds, not every 20 tuple once, improve performance much -3. simplify the ack's logic, make acker more effeciency -4. Communication between worker and tasks won't use zeromq, just memory share in process -5. in worker's Drainer/virtualportdispatch thread, spout/bolt recv/send thread, - the thread will sleep 1 ms when there is not tuple in one loop -6. communication between worker and tasks without zeromq -7. sampling frequence change to 5s, not every 20 tuple once. - -Enhancement: -1. add IFailValueSpout interface -2. Redesign sampling code, collection statics model become more common. - Add sending/recving tps statics, statics is more precise. -3. Atomatically do deactivate action when kill/rebalance topology, - and the wait time is 2 * MSG_TIMEOUT -4. fix nongrouping bug, random.nextInt will generate value less than 0. -5. Sleep one setting time(default is 1 minute) after finish spout open, - which is used to wait other task finish initialization. -6. Add check component name when submit topology, forbidding the component - which name start with "__" -7. change the zk's node /$(ZKROOT)/storm to /$(ZKROOT)/topology -8. abstract topology check logic from generating real topology function -9. when supervisor is down and topology do rebalance, the alive task under down - supervisor is unavailable. -10. add close connection operation after finish download topology binary -11. automatically create all local dirtorie, such as - /$(LOCALDIR)/supervisor/localstate -12. when killing worker, add "kill and sleep " operation before "kill -9" operation -13. when generate real topology binary, -13.1. configuration priority different. - component configuration > topology configuration > system configuration -13.2. skip the output stream which target component doesn't exist. -13.3. skip the component whose parallism is 0. -13.4. component's parallism is less than 0, throw exception. -14. skip ack/fail when inputstream setting is empty -15. add topology name to the log -16. fix ui select option error, default is 10 minutes +# Release 0.7.1 +In this version, it will follow storm 0.7.1 interface, so the topology running +in storm 0.7.1 can run in jstorm without any change. + +Stability +1. add setting "zmq.max.queue.msg" for zeromq +2. communication between worker and tasks without zeromq +3. Add catch exception operation +3.1. in supervisor SyncProcess/SyncSupervisor +3.2. add catch exception and report_error in spout's open and bolt's prepare +3.3. in all IO operation +3.4. in all serialize/deserialize +3.5. in all ZK operation +3.6 in topology upload/download function +3.7 during initialization zeromq +4. do assignmen/reassignment operation in one thread to avoid competition +5. redesign nimbus 's topology assign algorithm, make the logic simple much. +6. redesign supervisor's sync assignment algorithm, make the logic simple much +7. reduce zookeeper load +7.1 redesign nimbus monitor logic, it will just scan tasks' hearbeat, frequency is 10s +7.2 nimbus cancel watch on supervisor +7.3 supervisor heartbeat frequence change to 10s +7.4 supervisor syncSupervisor/syncProcess frequence change to 10s +7.5 supervisor scan /$(ZKROOT)/assignment only once in one monitor loop +7.6 task hearbeat change to 10s +8 create task pid file before connection zk, this is very import when zk is unstable. +9.equally assign worker to supervisors +10. reset hearbeat timeout for one reassign task + + +Performance tuning +1. reduce once memory copy when deserialize tuple, improve performance huge. +2. split executor thread as two thread, one handing receive tuples, one sending tuples, improve performance much +3. redeisign sample code, it will sampling every 5 seconds, not every 20 tuple once, improve performance much +3. simplify the ack's logic, make acker more effeciency +4. Communication between worker and tasks won't use zeromq, just memory share in process +5. in worker's Drainer/virtualportdispatch thread, spout/bolt recv/send thread, + the thread will sleep 1 ms when there is not tuple in one loop +6. communication between worker and tasks without zeromq +7. sampling frequence change to 5s, not every 20 tuple once. + +Enhancement: +1. add IFailValueSpout interface +2. Redesign sampling code, collection statics model become more common. + Add sending/recving tps statics, statics is more precise. +3. Atomatically do deactivate action when kill/rebalance topology, + and the wait time is 2 * MSG_TIMEOUT +4. fix nongrouping bug, random.nextInt will generate value less than 0. +5. Sleep one setting time(default is 1 minute) after finish spout open, + which is used to wait other task finish initialization. +6. Add check component name when submit topology, forbidding the component + which name start with "__" +7. change the zk's node /$(ZKROOT)/storm to /$(ZKROOT)/topology +8. abstract topology check logic from generating real topology function +9. when supervisor is down and topology do rebalance, the alive task under down + supervisor is unavailable. +10. add close connection operation after finish download topology binary +11. automatically create all local dirtorie, such as + /$(LOCALDIR)/supervisor/localstate +12. when killing worker, add "kill and sleep " operation before "kill -9" operation +13. when generate real topology binary, +13.1. configuration priority different. + component configuration > topology configuration > system configuration +13.2. skip the output stream which target component doesn't exist. +13.3. skip the component whose parallism is 0. +13.4. component's parallism is less than 0, throw exception. +14. skip ack/fail when inputstream setting is empty +15. add topology name to the log +16. fix ui select option error, default is 10 minutes 17. supervisor can display all worker's status \ No newline at end of file diff --git a/deploy b/deploy index e178e212f..af21744a7 100644 --- a/deploy +++ b/deploy @@ -13,17 +13,17 @@ this will build one tar Deploy -1. Deployment for nimbus or supervisor is same as storm. so please install jzmq and zmq. +1. Deployment for nimbus or supervisor is same as storm. so please install jzmq and zmq firstly. 2. Deployment for client, -2.1 please copy configuration to ~/.jstorm/storm.yaml -2.2 touch $JSTORM_HOME/RELEASE +2.1 cp $JSTORM_HOME/conf/storm.yaml ~/.jstorm/storm.yaml +2.2 cd $JSTORM_HOME && touch $JSTORM_HOME/RELEASE 3. Deployment for web ui. -3.1 copy configuration to ~/.jstorm/storm.yaml +3.1 cp $JSTORM_HOME/conf/storm.yaml ~/.jstorm/storm.yaml 3.2 downlaod tomcat 7.x -3.3 Extrade tar of tomcat 7.x +3.3 Extract tar of tomcat 7.x 3.4 put jstorm-ui-0.7.1.war to Tomcat's webapps directory -open one webbrowser and go to $jstorm-ui-ip:8080/jstorm-ui-0.7.1 +open one webbrowser and go to http://$jstorm-ui-ip:8080/jstorm-ui-0.7.1 3.5 you also can change the default page as jstorm-ui, please google how to do it. diff --git a/jstorm-client/src/main/java/backtype/storm/generated/AlreadyAliveException.java b/jstorm-client/src/main/java/backtype/storm/generated/AlreadyAliveException.java index 1306f8b11..1e442cb36 100644 --- a/jstorm-client/src/main/java/backtype/storm/generated/AlreadyAliveException.java +++ b/jstorm-client/src/main/java/backtype/storm/generated/AlreadyAliveException.java @@ -1,328 +1,381 @@ -/** - * Autogenerated by Thrift Compiler (0.7.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - */ -package backtype.storm.generated; - -import org.apache.commons.lang.builder.HashCodeBuilder; -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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class AlreadyAliveException extends Exception implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AlreadyAliveException"); - - 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 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 byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // MSG - return MSG; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - 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); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(AlreadyAliveException.class, metaDataMap); - } - - public AlreadyAliveException() { - } - - public AlreadyAliveException( - String msg) - { - this(); - this.msg = msg; - } - - /** - * Performs a deep copy on other. - */ - public AlreadyAliveException(AlreadyAliveException other) { - if (other.is_set_msg()) { - this.msg = other.msg; - } - } - - public AlreadyAliveException deepCopy() { - return new AlreadyAliveException(this); - } - - @Override - public void clear() { - this.msg = null; - } - - public String get_msg() { - return this.msg; - } - - public void set_msg(String msg) { - this.msg = msg; - } - - public void unset_msg() { - this.msg = null; - } - - /** Returns true if field msg is set (has been assigned a value) and false otherwise */ - public boolean is_set_msg() { - return this.msg != null; - } - - public void set_msg_isSet(boolean value) { - if (!value) { - this.msg = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case MSG: - if (value == null) { - unset_msg(); - } else { - set_msg((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case MSG: - return get_msg(); - - } - throw new 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(); - } - - switch (field) { - case MSG: - return is_set_msg(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof AlreadyAliveException) - return this.equals((AlreadyAliveException)that); - return false; - } - - public boolean equals(AlreadyAliveException that) { - if (that == null) - return false; - - boolean this_present_msg = true && this.is_set_msg(); - boolean that_present_msg = true && that.is_set_msg(); - if (this_present_msg || that_present_msg) { - if (!(this_present_msg && that_present_msg)) - return false; - if (!this.msg.equals(that.msg)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_msg = true && (is_set_msg()); - builder.append(present_msg); - if (present_msg) - builder.append(msg); - - return builder.toHashCode(); - } - - public int compareTo(AlreadyAliveException other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - AlreadyAliveException typedOther = (AlreadyAliveException)other; - - lastComparison = Boolean.valueOf(is_set_msg()).compareTo(typedOther.is_set_msg()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_msg()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.msg, typedOther.msg); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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(); - } - - 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(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("AlreadyAliveException("); - boolean first = true; - - sb.append("msg:"); - if (this.msg == null) { - sb.append("null"); - } else { - sb.append(this.msg); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!is_set_msg()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'msg' is unset! Struct:" + toString()); - } - - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - -} - +/** + * Autogenerated by Thrift Compiler (0.8.0) + * + * 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 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class AlreadyAliveException extends Exception implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AlreadyAliveException"); + + 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, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new AlreadyAliveExceptionStandardSchemeFactory()); + schemes.put(TupleScheme.class, new AlreadyAliveExceptionTupleSchemeFactory()); + } + + private 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 byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // MSG + return MSG; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + 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); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(AlreadyAliveException.class, metaDataMap); + } + + public AlreadyAliveException() { + } + + public AlreadyAliveException( + String msg) + { + this(); + this.msg = msg; + } + + /** + * Performs a deep copy on other. + */ + public AlreadyAliveException(AlreadyAliveException other) { + if (other.is_set_msg()) { + this.msg = other.msg; + } + } + + public AlreadyAliveException deepCopy() { + return new AlreadyAliveException(this); + } + + @Override + public void clear() { + this.msg = null; + } + + public String get_msg() { + return this.msg; + } + + public void set_msg(String msg) { + this.msg = msg; + } + + public void unset_msg() { + this.msg = null; + } + + /** Returns true if field msg is set (has been assigned a value) and false otherwise */ + public boolean is_set_msg() { + return this.msg != null; + } + + public void set_msg_isSet(boolean value) { + if (!value) { + this.msg = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case MSG: + if (value == null) { + unset_msg(); + } else { + set_msg((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case MSG: + return get_msg(); + + } + throw new 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(); + } + + switch (field) { + case MSG: + return is_set_msg(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof AlreadyAliveException) + return this.equals((AlreadyAliveException)that); + return false; + } + + public boolean equals(AlreadyAliveException that) { + if (that == null) + return false; + + boolean this_present_msg = true && this.is_set_msg(); + boolean that_present_msg = true && that.is_set_msg(); + if (this_present_msg || that_present_msg) { + if (!(this_present_msg && that_present_msg)) + return false; + if (!this.msg.equals(that.msg)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_msg = true && (is_set_msg()); + builder.append(present_msg); + if (present_msg) + builder.append(msg); + + return builder.toHashCode(); + } + + public int compareTo(AlreadyAliveException other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + AlreadyAliveException typedOther = (AlreadyAliveException)other; + + lastComparison = Boolean.valueOf(is_set_msg()).compareTo(typedOther.is_set_msg()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_msg()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.msg, typedOther.msg); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("AlreadyAliveException("); + boolean first = true; + + sb.append("msg:"); + if (this.msg == null) { + sb.append("null"); + } else { + sb.append(this.msg); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!is_set_msg()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'msg' is unset! Struct:" + toString()); + } + + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 AlreadyAliveExceptionStandardSchemeFactory implements SchemeFactory { + public AlreadyAliveExceptionStandardScheme getScheme() { + return new AlreadyAliveExceptionStandardScheme(); + } + } + + private static class AlreadyAliveExceptionStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, AlreadyAliveException 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, AlreadyAliveException 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 AlreadyAliveExceptionTupleSchemeFactory implements SchemeFactory { + public AlreadyAliveExceptionTupleScheme getScheme() { + return new AlreadyAliveExceptionTupleScheme(); + } + } + + private static class AlreadyAliveExceptionTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, AlreadyAliveException struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.msg); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, AlreadyAliveException struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.msg = iprot.readString(); + struct.set_msg_isSet(true); + } + } + +} + diff --git a/jstorm-client/src/main/java/backtype/storm/generated/Bolt.java b/jstorm-client/src/main/java/backtype/storm/generated/Bolt.java index a1db5b4a2..aa84866f8 100644 --- a/jstorm-client/src/main/java/backtype/storm/generated/Bolt.java +++ b/jstorm-client/src/main/java/backtype/storm/generated/Bolt.java @@ -1,427 +1,486 @@ -/** - * Autogenerated by Thrift Compiler (0.7.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - */ -package backtype.storm.generated; - -import org.apache.commons.lang.builder.HashCodeBuilder; -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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class Bolt implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Bolt"); - - private static final org.apache.thrift.protocol.TField BOLT_OBJECT_FIELD_DESC = new org.apache.thrift.protocol.TField("bolt_object", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField COMMON_FIELD_DESC = new org.apache.thrift.protocol.TField("common", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private ComponentObject bolt_object; // required - private ComponentCommon common; // 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 { - BOLT_OBJECT((short)1, "bolt_object"), - COMMON((short)2, "common"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // BOLT_OBJECT - return BOLT_OBJECT; - case 2: // COMMON - return COMMON; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.BOLT_OBJECT, new org.apache.thrift.meta_data.FieldMetaData("bolt_object", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ComponentObject.class))); - tmpMap.put(_Fields.COMMON, new org.apache.thrift.meta_data.FieldMetaData("common", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ComponentCommon.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Bolt.class, metaDataMap); - } - - public Bolt() { - } - - public Bolt( - ComponentObject bolt_object, - ComponentCommon common) - { - this(); - this.bolt_object = bolt_object; - this.common = common; - } - - /** - * Performs a deep copy on other. - */ - public Bolt(Bolt other) { - if (other.is_set_bolt_object()) { - this.bolt_object = new ComponentObject(other.bolt_object); - } - if (other.is_set_common()) { - this.common = new ComponentCommon(other.common); - } - } - - public Bolt deepCopy() { - return new Bolt(this); - } - - @Override - public void clear() { - this.bolt_object = null; - this.common = null; - } - - public ComponentObject get_bolt_object() { - return this.bolt_object; - } - - public void set_bolt_object(ComponentObject bolt_object) { - this.bolt_object = bolt_object; - } - - public void unset_bolt_object() { - this.bolt_object = null; - } - - /** Returns true if field bolt_object is set (has been assigned a value) and false otherwise */ - public boolean is_set_bolt_object() { - return this.bolt_object != null; - } - - public void set_bolt_object_isSet(boolean value) { - if (!value) { - this.bolt_object = null; - } - } - - public ComponentCommon get_common() { - return this.common; - } - - public void set_common(ComponentCommon common) { - this.common = common; - } - - public void unset_common() { - this.common = null; - } - - /** Returns true if field common is set (has been assigned a value) and false otherwise */ - public boolean is_set_common() { - return this.common != null; - } - - public void set_common_isSet(boolean value) { - if (!value) { - this.common = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case BOLT_OBJECT: - if (value == null) { - unset_bolt_object(); - } else { - set_bolt_object((ComponentObject)value); - } - break; - - case COMMON: - if (value == null) { - unset_common(); - } else { - set_common((ComponentCommon)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case BOLT_OBJECT: - return get_bolt_object(); - - case COMMON: - return get_common(); - - } - throw new 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(); - } - - switch (field) { - case BOLT_OBJECT: - return is_set_bolt_object(); - case COMMON: - return is_set_common(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof Bolt) - return this.equals((Bolt)that); - return false; - } - - public boolean equals(Bolt that) { - if (that == null) - return false; - - boolean this_present_bolt_object = true && this.is_set_bolt_object(); - boolean that_present_bolt_object = true && that.is_set_bolt_object(); - if (this_present_bolt_object || that_present_bolt_object) { - if (!(this_present_bolt_object && that_present_bolt_object)) - return false; - if (!this.bolt_object.equals(that.bolt_object)) - return false; - } - - boolean this_present_common = true && this.is_set_common(); - boolean that_present_common = true && that.is_set_common(); - if (this_present_common || that_present_common) { - if (!(this_present_common && that_present_common)) - return false; - if (!this.common.equals(that.common)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_bolt_object = true && (is_set_bolt_object()); - builder.append(present_bolt_object); - if (present_bolt_object) - builder.append(bolt_object); - - boolean present_common = true && (is_set_common()); - builder.append(present_common); - if (present_common) - builder.append(common); - - return builder.toHashCode(); - } - - public int compareTo(Bolt other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - Bolt typedOther = (Bolt)other; - - lastComparison = Boolean.valueOf(is_set_bolt_object()).compareTo(typedOther.is_set_bolt_object()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_bolt_object()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bolt_object, typedOther.bolt_object); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_common()).compareTo(typedOther.is_set_common()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_common()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.common, typedOther.common); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // BOLT_OBJECT - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.bolt_object = new ComponentObject(); - this.bolt_object.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // COMMON - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.common = new ComponentCommon(); - this.common.read(iprot); - } 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.bolt_object != null) { - oprot.writeFieldBegin(BOLT_OBJECT_FIELD_DESC); - this.bolt_object.write(oprot); - oprot.writeFieldEnd(); - } - if (this.common != null) { - oprot.writeFieldBegin(COMMON_FIELD_DESC); - this.common.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("Bolt("); - boolean first = true; - - sb.append("bolt_object:"); - if (this.bolt_object == null) { - sb.append("null"); - } else { - sb.append(this.bolt_object); - } - first = false; - if (!first) sb.append(", "); - sb.append("common:"); - if (this.common == null) { - sb.append("null"); - } else { - sb.append(this.common); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!is_set_bolt_object()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'bolt_object' is unset! Struct:" + toString()); - } - - if (!is_set_common()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'common' is unset! Struct:" + toString()); - } - - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - -} - +/** + * Autogenerated by Thrift Compiler (0.8.0) + * + * 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 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class Bolt implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Bolt"); + + private static final org.apache.thrift.protocol.TField BOLT_OBJECT_FIELD_DESC = new org.apache.thrift.protocol.TField("bolt_object", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField COMMON_FIELD_DESC = new org.apache.thrift.protocol.TField("common", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new BoltStandardSchemeFactory()); + schemes.put(TupleScheme.class, new BoltTupleSchemeFactory()); + } + + private ComponentObject bolt_object; // required + private ComponentCommon common; // 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 { + BOLT_OBJECT((short)1, "bolt_object"), + COMMON((short)2, "common"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // BOLT_OBJECT + return BOLT_OBJECT; + case 2: // COMMON + return COMMON; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.BOLT_OBJECT, new org.apache.thrift.meta_data.FieldMetaData("bolt_object", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ComponentObject.class))); + tmpMap.put(_Fields.COMMON, new org.apache.thrift.meta_data.FieldMetaData("common", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ComponentCommon.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Bolt.class, metaDataMap); + } + + public Bolt() { + } + + public Bolt( + ComponentObject bolt_object, + ComponentCommon common) + { + this(); + this.bolt_object = bolt_object; + this.common = common; + } + + /** + * Performs a deep copy on other. + */ + public Bolt(Bolt other) { + if (other.is_set_bolt_object()) { + this.bolt_object = new ComponentObject(other.bolt_object); + } + if (other.is_set_common()) { + this.common = new ComponentCommon(other.common); + } + } + + public Bolt deepCopy() { + return new Bolt(this); + } + + @Override + public void clear() { + this.bolt_object = null; + this.common = null; + } + + public ComponentObject get_bolt_object() { + return this.bolt_object; + } + + public void set_bolt_object(ComponentObject bolt_object) { + this.bolt_object = bolt_object; + } + + public void unset_bolt_object() { + this.bolt_object = null; + } + + /** Returns true if field bolt_object is set (has been assigned a value) and false otherwise */ + public boolean is_set_bolt_object() { + return this.bolt_object != null; + } + + public void set_bolt_object_isSet(boolean value) { + if (!value) { + this.bolt_object = null; + } + } + + public ComponentCommon get_common() { + return this.common; + } + + public void set_common(ComponentCommon common) { + this.common = common; + } + + public void unset_common() { + this.common = null; + } + + /** Returns true if field common is set (has been assigned a value) and false otherwise */ + public boolean is_set_common() { + return this.common != null; + } + + public void set_common_isSet(boolean value) { + if (!value) { + this.common = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case BOLT_OBJECT: + if (value == null) { + unset_bolt_object(); + } else { + set_bolt_object((ComponentObject)value); + } + break; + + case COMMON: + if (value == null) { + unset_common(); + } else { + set_common((ComponentCommon)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case BOLT_OBJECT: + return get_bolt_object(); + + case COMMON: + return get_common(); + + } + throw new 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(); + } + + switch (field) { + case BOLT_OBJECT: + return is_set_bolt_object(); + case COMMON: + return is_set_common(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof Bolt) + return this.equals((Bolt)that); + return false; + } + + public boolean equals(Bolt that) { + if (that == null) + return false; + + boolean this_present_bolt_object = true && this.is_set_bolt_object(); + boolean that_present_bolt_object = true && that.is_set_bolt_object(); + if (this_present_bolt_object || that_present_bolt_object) { + if (!(this_present_bolt_object && that_present_bolt_object)) + return false; + if (!this.bolt_object.equals(that.bolt_object)) + return false; + } + + boolean this_present_common = true && this.is_set_common(); + boolean that_present_common = true && that.is_set_common(); + if (this_present_common || that_present_common) { + if (!(this_present_common && that_present_common)) + return false; + if (!this.common.equals(that.common)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_bolt_object = true && (is_set_bolt_object()); + builder.append(present_bolt_object); + if (present_bolt_object) + builder.append(bolt_object); + + boolean present_common = true && (is_set_common()); + builder.append(present_common); + if (present_common) + builder.append(common); + + return builder.toHashCode(); + } + + public int compareTo(Bolt other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + Bolt typedOther = (Bolt)other; + + lastComparison = Boolean.valueOf(is_set_bolt_object()).compareTo(typedOther.is_set_bolt_object()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_bolt_object()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bolt_object, typedOther.bolt_object); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_common()).compareTo(typedOther.is_set_common()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_common()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.common, typedOther.common); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("Bolt("); + boolean first = true; + + sb.append("bolt_object:"); + if (this.bolt_object == null) { + sb.append("null"); + } else { + sb.append(this.bolt_object); + } + first = false; + if (!first) sb.append(", "); + sb.append("common:"); + if (this.common == null) { + sb.append("null"); + } else { + sb.append(this.common); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!is_set_bolt_object()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'bolt_object' is unset! Struct:" + toString()); + } + + if (!is_set_common()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'common' is unset! Struct:" + toString()); + } + + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 BoltStandardSchemeFactory implements SchemeFactory { + public BoltStandardScheme getScheme() { + return new BoltStandardScheme(); + } + } + + private static class BoltStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, Bolt 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: // BOLT_OBJECT + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.bolt_object = new ComponentObject(); + struct.bolt_object.read(iprot); + struct.set_bolt_object_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // COMMON + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.common = new ComponentCommon(); + struct.common.read(iprot); + struct.set_common_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, Bolt struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.bolt_object != null) { + oprot.writeFieldBegin(BOLT_OBJECT_FIELD_DESC); + struct.bolt_object.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.common != null) { + oprot.writeFieldBegin(COMMON_FIELD_DESC); + struct.common.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class BoltTupleSchemeFactory implements SchemeFactory { + public BoltTupleScheme getScheme() { + return new BoltTupleScheme(); + } + } + + private static class BoltTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, Bolt struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.bolt_object.write(oprot); + struct.common.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, Bolt struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.bolt_object = new ComponentObject(); + struct.bolt_object.read(iprot); + struct.set_bolt_object_isSet(true); + struct.common = new ComponentCommon(); + struct.common.read(iprot); + struct.set_common_isSet(true); + } + } + +} + diff --git a/jstorm-client/src/main/java/backtype/storm/generated/ClusterSummary.java b/jstorm-client/src/main/java/backtype/storm/generated/ClusterSummary.java index c7ac51c04..880103851 100644 --- a/jstorm-client/src/main/java/backtype/storm/generated/ClusterSummary.java +++ b/jstorm-client/src/main/java/backtype/storm/generated/ClusterSummary.java @@ -1,598 +1,690 @@ -/** - * Autogenerated by Thrift Compiler (0.7.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - */ -package backtype.storm.generated; - -import org.apache.commons.lang.builder.HashCodeBuilder; -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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class ClusterSummary implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ClusterSummary"); - - private static final org.apache.thrift.protocol.TField SUPERVISORS_FIELD_DESC = new org.apache.thrift.protocol.TField("supervisors", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.protocol.TField NIMBUS_UPTIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("nimbus_uptime_secs", org.apache.thrift.protocol.TType.I32, (short)2); - private static final org.apache.thrift.protocol.TField TOPOLOGIES_FIELD_DESC = new org.apache.thrift.protocol.TField("topologies", org.apache.thrift.protocol.TType.LIST, (short)3); - - private List supervisors; // required - private int nimbus_uptime_secs; // required - private List topologies; // 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 { - SUPERVISORS((short)1, "supervisors"), - NIMBUS_UPTIME_SECS((short)2, "nimbus_uptime_secs"), - TOPOLOGIES((short)3, "topologies"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SUPERVISORS - return SUPERVISORS; - case 2: // NIMBUS_UPTIME_SECS - return NIMBUS_UPTIME_SECS; - case 3: // TOPOLOGIES - return TOPOLOGIES; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __NIMBUS_UPTIME_SECS_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - - 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); - tmpMap.put(_Fields.SUPERVISORS, new org.apache.thrift.meta_data.FieldMetaData("supervisors", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SupervisorSummary.class)))); - tmpMap.put(_Fields.NIMBUS_UPTIME_SECS, new org.apache.thrift.meta_data.FieldMetaData("nimbus_uptime_secs", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.TOPOLOGIES, new org.apache.thrift.meta_data.FieldMetaData("topologies", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TopologySummary.class)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ClusterSummary.class, metaDataMap); - } - - public ClusterSummary() { - } - - public ClusterSummary( - List supervisors, - int nimbus_uptime_secs, - List topologies) - { - this(); - this.supervisors = supervisors; - this.nimbus_uptime_secs = nimbus_uptime_secs; - set_nimbus_uptime_secs_isSet(true); - this.topologies = topologies; - } - - /** - * Performs a deep copy on other. - */ - public ClusterSummary(ClusterSummary other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); - if (other.is_set_supervisors()) { - List __this__supervisors = new ArrayList(); - for (SupervisorSummary other_element : other.supervisors) { - __this__supervisors.add(new SupervisorSummary(other_element)); - } - this.supervisors = __this__supervisors; - } - this.nimbus_uptime_secs = other.nimbus_uptime_secs; - if (other.is_set_topologies()) { - List __this__topologies = new ArrayList(); - for (TopologySummary other_element : other.topologies) { - __this__topologies.add(new TopologySummary(other_element)); - } - this.topologies = __this__topologies; - } - } - - public ClusterSummary deepCopy() { - return new ClusterSummary(this); - } - - @Override - public void clear() { - this.supervisors = null; - set_nimbus_uptime_secs_isSet(false); - this.nimbus_uptime_secs = 0; - this.topologies = null; - } - - public int get_supervisors_size() { - return (this.supervisors == null) ? 0 : this.supervisors.size(); - } - - public java.util.Iterator get_supervisors_iterator() { - return (this.supervisors == null) ? null : this.supervisors.iterator(); - } - - public void add_to_supervisors(SupervisorSummary elem) { - if (this.supervisors == null) { - this.supervisors = new ArrayList(); - } - this.supervisors.add(elem); - } - - public List get_supervisors() { - return this.supervisors; - } - - public void set_supervisors(List supervisors) { - this.supervisors = supervisors; - } - - public void unset_supervisors() { - this.supervisors = null; - } - - /** Returns true if field supervisors is set (has been assigned a value) and false otherwise */ - public boolean is_set_supervisors() { - return this.supervisors != null; - } - - public void set_supervisors_isSet(boolean value) { - if (!value) { - this.supervisors = null; - } - } - - public int get_nimbus_uptime_secs() { - return this.nimbus_uptime_secs; - } - - public void set_nimbus_uptime_secs(int nimbus_uptime_secs) { - this.nimbus_uptime_secs = nimbus_uptime_secs; - set_nimbus_uptime_secs_isSet(true); - } - - public void unset_nimbus_uptime_secs() { - __isset_bit_vector.clear(__NIMBUS_UPTIME_SECS_ISSET_ID); - } - - /** Returns true if field nimbus_uptime_secs is set (has been assigned a value) and false otherwise */ - public boolean is_set_nimbus_uptime_secs() { - return __isset_bit_vector.get(__NIMBUS_UPTIME_SECS_ISSET_ID); - } - - public void set_nimbus_uptime_secs_isSet(boolean value) { - __isset_bit_vector.set(__NIMBUS_UPTIME_SECS_ISSET_ID, value); - } - - public int get_topologies_size() { - return (this.topologies == null) ? 0 : this.topologies.size(); - } - - public java.util.Iterator get_topologies_iterator() { - return (this.topologies == null) ? null : this.topologies.iterator(); - } - - public void add_to_topologies(TopologySummary elem) { - if (this.topologies == null) { - this.topologies = new ArrayList(); - } - this.topologies.add(elem); - } - - public List get_topologies() { - return this.topologies; - } - - public void set_topologies(List topologies) { - this.topologies = topologies; - } - - public void unset_topologies() { - this.topologies = null; - } - - /** Returns true if field topologies is set (has been assigned a value) and false otherwise */ - public boolean is_set_topologies() { - return this.topologies != null; - } - - public void set_topologies_isSet(boolean value) { - if (!value) { - this.topologies = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUPERVISORS: - if (value == null) { - unset_supervisors(); - } else { - set_supervisors((List)value); - } - break; - - case NIMBUS_UPTIME_SECS: - if (value == null) { - unset_nimbus_uptime_secs(); - } else { - set_nimbus_uptime_secs((Integer)value); - } - break; - - case TOPOLOGIES: - if (value == null) { - unset_topologies(); - } else { - set_topologies((List)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUPERVISORS: - return get_supervisors(); - - case NIMBUS_UPTIME_SECS: - return Integer.valueOf(get_nimbus_uptime_secs()); - - case TOPOLOGIES: - return get_topologies(); - - } - throw new 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(); - } - - switch (field) { - case SUPERVISORS: - return is_set_supervisors(); - case NIMBUS_UPTIME_SECS: - return is_set_nimbus_uptime_secs(); - case TOPOLOGIES: - return is_set_topologies(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof ClusterSummary) - return this.equals((ClusterSummary)that); - return false; - } - - public boolean equals(ClusterSummary that) { - if (that == null) - return false; - - boolean this_present_supervisors = true && this.is_set_supervisors(); - boolean that_present_supervisors = true && that.is_set_supervisors(); - if (this_present_supervisors || that_present_supervisors) { - if (!(this_present_supervisors && that_present_supervisors)) - return false; - if (!this.supervisors.equals(that.supervisors)) - return false; - } - - boolean this_present_nimbus_uptime_secs = true; - boolean that_present_nimbus_uptime_secs = true; - if (this_present_nimbus_uptime_secs || that_present_nimbus_uptime_secs) { - if (!(this_present_nimbus_uptime_secs && that_present_nimbus_uptime_secs)) - return false; - if (this.nimbus_uptime_secs != that.nimbus_uptime_secs) - return false; - } - - boolean this_present_topologies = true && this.is_set_topologies(); - boolean that_present_topologies = true && that.is_set_topologies(); - if (this_present_topologies || that_present_topologies) { - if (!(this_present_topologies && that_present_topologies)) - return false; - if (!this.topologies.equals(that.topologies)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_supervisors = true && (is_set_supervisors()); - builder.append(present_supervisors); - if (present_supervisors) - builder.append(supervisors); - - boolean present_nimbus_uptime_secs = true; - builder.append(present_nimbus_uptime_secs); - if (present_nimbus_uptime_secs) - builder.append(nimbus_uptime_secs); - - boolean present_topologies = true && (is_set_topologies()); - builder.append(present_topologies); - if (present_topologies) - builder.append(topologies); - - return builder.toHashCode(); - } - - public int compareTo(ClusterSummary other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - ClusterSummary typedOther = (ClusterSummary)other; - - lastComparison = Boolean.valueOf(is_set_supervisors()).compareTo(typedOther.is_set_supervisors()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_supervisors()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.supervisors, typedOther.supervisors); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_nimbus_uptime_secs()).compareTo(typedOther.is_set_nimbus_uptime_secs()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_nimbus_uptime_secs()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nimbus_uptime_secs, typedOther.nimbus_uptime_secs); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_topologies()).compareTo(typedOther.is_set_topologies()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_topologies()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.topologies, typedOther.topologies); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // SUPERVISORS - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list37 = iprot.readListBegin(); - this.supervisors = new ArrayList(_list37.size); - for (int _i38 = 0; _i38 < _list37.size; ++_i38) - { - SupervisorSummary _elem39; // required - _elem39 = new SupervisorSummary(); - _elem39.read(iprot); - this.supervisors.add(_elem39); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // NIMBUS_UPTIME_SECS - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.nimbus_uptime_secs = iprot.readI32(); - set_nimbus_uptime_secs_isSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // TOPOLOGIES - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list40 = iprot.readListBegin(); - this.topologies = new ArrayList(_list40.size); - for (int _i41 = 0; _i41 < _list40.size; ++_i41) - { - TopologySummary _elem42; // required - _elem42 = new TopologySummary(); - _elem42.read(iprot); - this.topologies.add(_elem42); - } - 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.supervisors != null) { - oprot.writeFieldBegin(SUPERVISORS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.supervisors.size())); - for (SupervisorSummary _iter43 : this.supervisors) - { - _iter43.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(NIMBUS_UPTIME_SECS_FIELD_DESC); - oprot.writeI32(this.nimbus_uptime_secs); - oprot.writeFieldEnd(); - if (this.topologies != null) { - oprot.writeFieldBegin(TOPOLOGIES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.topologies.size())); - for (TopologySummary _iter44 : this.topologies) - { - _iter44.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("ClusterSummary("); - boolean first = true; - - sb.append("supervisors:"); - if (this.supervisors == null) { - sb.append("null"); - } else { - sb.append(this.supervisors); - } - first = false; - if (!first) sb.append(", "); - sb.append("nimbus_uptime_secs:"); - sb.append(this.nimbus_uptime_secs); - first = false; - if (!first) sb.append(", "); - sb.append("topologies:"); - if (this.topologies == null) { - sb.append("null"); - } else { - sb.append(this.topologies); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!is_set_supervisors()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'supervisors' is unset! Struct:" + toString()); - } - - if (!is_set_nimbus_uptime_secs()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'nimbus_uptime_secs' is unset! Struct:" + toString()); - } - - if (!is_set_topologies()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'topologies' is unset! Struct:" + toString()); - } - - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - 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); - 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); - } - } - -} - +/** + * Autogenerated by Thrift Compiler (0.8.0) + * + * 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 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class ClusterSummary implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ClusterSummary"); + + private static final org.apache.thrift.protocol.TField SUPERVISORS_FIELD_DESC = new org.apache.thrift.protocol.TField("supervisors", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField NIMBUS_UPTIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("nimbus_uptime_secs", org.apache.thrift.protocol.TType.I32, (short)2); + private static final org.apache.thrift.protocol.TField TOPOLOGIES_FIELD_DESC = new org.apache.thrift.protocol.TField("topologies", org.apache.thrift.protocol.TType.LIST, (short)3); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new ClusterSummaryStandardSchemeFactory()); + schemes.put(TupleScheme.class, new ClusterSummaryTupleSchemeFactory()); + } + + private List supervisors; // required + private int nimbus_uptime_secs; // required + private List topologies; // 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 { + SUPERVISORS((short)1, "supervisors"), + NIMBUS_UPTIME_SECS((short)2, "nimbus_uptime_secs"), + TOPOLOGIES((short)3, "topologies"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // SUPERVISORS + return SUPERVISORS; + case 2: // NIMBUS_UPTIME_SECS + return NIMBUS_UPTIME_SECS; + case 3: // TOPOLOGIES + return TOPOLOGIES; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __NIMBUS_UPTIME_SECS_ISSET_ID = 0; + private BitSet __isset_bit_vector = new BitSet(1); + 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); + tmpMap.put(_Fields.SUPERVISORS, new org.apache.thrift.meta_data.FieldMetaData("supervisors", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SupervisorSummary.class)))); + tmpMap.put(_Fields.NIMBUS_UPTIME_SECS, new org.apache.thrift.meta_data.FieldMetaData("nimbus_uptime_secs", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.TOPOLOGIES, new org.apache.thrift.meta_data.FieldMetaData("topologies", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TopologySummary.class)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ClusterSummary.class, metaDataMap); + } + + public ClusterSummary() { + } + + public ClusterSummary( + List supervisors, + int nimbus_uptime_secs, + List topologies) + { + this(); + this.supervisors = supervisors; + this.nimbus_uptime_secs = nimbus_uptime_secs; + set_nimbus_uptime_secs_isSet(true); + this.topologies = topologies; + } + + /** + * Performs a deep copy on other. + */ + public ClusterSummary(ClusterSummary other) { + __isset_bit_vector.clear(); + __isset_bit_vector.or(other.__isset_bit_vector); + if (other.is_set_supervisors()) { + List __this__supervisors = new ArrayList(); + for (SupervisorSummary other_element : other.supervisors) { + __this__supervisors.add(new SupervisorSummary(other_element)); + } + this.supervisors = __this__supervisors; + } + this.nimbus_uptime_secs = other.nimbus_uptime_secs; + if (other.is_set_topologies()) { + List __this__topologies = new ArrayList(); + for (TopologySummary other_element : other.topologies) { + __this__topologies.add(new TopologySummary(other_element)); + } + this.topologies = __this__topologies; + } + } + + public ClusterSummary deepCopy() { + return new ClusterSummary(this); + } + + @Override + public void clear() { + this.supervisors = null; + set_nimbus_uptime_secs_isSet(false); + this.nimbus_uptime_secs = 0; + this.topologies = null; + } + + public int get_supervisors_size() { + return (this.supervisors == null) ? 0 : this.supervisors.size(); + } + + public java.util.Iterator get_supervisors_iterator() { + return (this.supervisors == null) ? null : this.supervisors.iterator(); + } + + public void add_to_supervisors(SupervisorSummary elem) { + if (this.supervisors == null) { + this.supervisors = new ArrayList(); + } + this.supervisors.add(elem); + } + + public List get_supervisors() { + return this.supervisors; + } + + public void set_supervisors(List supervisors) { + this.supervisors = supervisors; + } + + public void unset_supervisors() { + this.supervisors = null; + } + + /** Returns true if field supervisors is set (has been assigned a value) and false otherwise */ + public boolean is_set_supervisors() { + return this.supervisors != null; + } + + public void set_supervisors_isSet(boolean value) { + if (!value) { + this.supervisors = null; + } + } + + public int get_nimbus_uptime_secs() { + return this.nimbus_uptime_secs; + } + + public void set_nimbus_uptime_secs(int nimbus_uptime_secs) { + this.nimbus_uptime_secs = nimbus_uptime_secs; + set_nimbus_uptime_secs_isSet(true); + } + + public void unset_nimbus_uptime_secs() { + __isset_bit_vector.clear(__NIMBUS_UPTIME_SECS_ISSET_ID); + } + + /** Returns true if field nimbus_uptime_secs is set (has been assigned a value) and false otherwise */ + public boolean is_set_nimbus_uptime_secs() { + return __isset_bit_vector.get(__NIMBUS_UPTIME_SECS_ISSET_ID); + } + + public void set_nimbus_uptime_secs_isSet(boolean value) { + __isset_bit_vector.set(__NIMBUS_UPTIME_SECS_ISSET_ID, value); + } + + public int get_topologies_size() { + return (this.topologies == null) ? 0 : this.topologies.size(); + } + + public java.util.Iterator get_topologies_iterator() { + return (this.topologies == null) ? null : this.topologies.iterator(); + } + + public void add_to_topologies(TopologySummary elem) { + if (this.topologies == null) { + this.topologies = new ArrayList(); + } + this.topologies.add(elem); + } + + public List get_topologies() { + return this.topologies; + } + + public void set_topologies(List topologies) { + this.topologies = topologies; + } + + public void unset_topologies() { + this.topologies = null; + } + + /** Returns true if field topologies is set (has been assigned a value) and false otherwise */ + public boolean is_set_topologies() { + return this.topologies != null; + } + + public void set_topologies_isSet(boolean value) { + if (!value) { + this.topologies = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUPERVISORS: + if (value == null) { + unset_supervisors(); + } else { + set_supervisors((List)value); + } + break; + + case NIMBUS_UPTIME_SECS: + if (value == null) { + unset_nimbus_uptime_secs(); + } else { + set_nimbus_uptime_secs((Integer)value); + } + break; + + case TOPOLOGIES: + if (value == null) { + unset_topologies(); + } else { + set_topologies((List)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUPERVISORS: + return get_supervisors(); + + case NIMBUS_UPTIME_SECS: + return Integer.valueOf(get_nimbus_uptime_secs()); + + case TOPOLOGIES: + return get_topologies(); + + } + throw new 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(); + } + + switch (field) { + case SUPERVISORS: + return is_set_supervisors(); + case NIMBUS_UPTIME_SECS: + return is_set_nimbus_uptime_secs(); + case TOPOLOGIES: + return is_set_topologies(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof ClusterSummary) + return this.equals((ClusterSummary)that); + return false; + } + + public boolean equals(ClusterSummary that) { + if (that == null) + return false; + + boolean this_present_supervisors = true && this.is_set_supervisors(); + boolean that_present_supervisors = true && that.is_set_supervisors(); + if (this_present_supervisors || that_present_supervisors) { + if (!(this_present_supervisors && that_present_supervisors)) + return false; + if (!this.supervisors.equals(that.supervisors)) + return false; + } + + boolean this_present_nimbus_uptime_secs = true; + boolean that_present_nimbus_uptime_secs = true; + if (this_present_nimbus_uptime_secs || that_present_nimbus_uptime_secs) { + if (!(this_present_nimbus_uptime_secs && that_present_nimbus_uptime_secs)) + return false; + if (this.nimbus_uptime_secs != that.nimbus_uptime_secs) + return false; + } + + boolean this_present_topologies = true && this.is_set_topologies(); + boolean that_present_topologies = true && that.is_set_topologies(); + if (this_present_topologies || that_present_topologies) { + if (!(this_present_topologies && that_present_topologies)) + return false; + if (!this.topologies.equals(that.topologies)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_supervisors = true && (is_set_supervisors()); + builder.append(present_supervisors); + if (present_supervisors) + builder.append(supervisors); + + boolean present_nimbus_uptime_secs = true; + builder.append(present_nimbus_uptime_secs); + if (present_nimbus_uptime_secs) + builder.append(nimbus_uptime_secs); + + boolean present_topologies = true && (is_set_topologies()); + builder.append(present_topologies); + if (present_topologies) + builder.append(topologies); + + return builder.toHashCode(); + } + + public int compareTo(ClusterSummary other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + ClusterSummary typedOther = (ClusterSummary)other; + + lastComparison = Boolean.valueOf(is_set_supervisors()).compareTo(typedOther.is_set_supervisors()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_supervisors()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.supervisors, typedOther.supervisors); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_nimbus_uptime_secs()).compareTo(typedOther.is_set_nimbus_uptime_secs()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_nimbus_uptime_secs()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nimbus_uptime_secs, typedOther.nimbus_uptime_secs); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_topologies()).compareTo(typedOther.is_set_topologies()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_topologies()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.topologies, typedOther.topologies); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("ClusterSummary("); + boolean first = true; + + sb.append("supervisors:"); + if (this.supervisors == null) { + sb.append("null"); + } else { + sb.append(this.supervisors); + } + first = false; + if (!first) sb.append(", "); + sb.append("nimbus_uptime_secs:"); + sb.append(this.nimbus_uptime_secs); + first = false; + if (!first) sb.append(", "); + sb.append("topologies:"); + if (this.topologies == null) { + sb.append("null"); + } else { + sb.append(this.topologies); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!is_set_supervisors()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'supervisors' is unset! Struct:" + toString()); + } + + if (!is_set_nimbus_uptime_secs()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'nimbus_uptime_secs' is unset! Struct:" + toString()); + } + + if (!is_set_topologies()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'topologies' is unset! Struct:" + toString()); + } + + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + 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); + 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 ClusterSummaryStandardSchemeFactory implements SchemeFactory { + public ClusterSummaryStandardScheme getScheme() { + return new ClusterSummaryStandardScheme(); + } + } + + private static class ClusterSummaryStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, ClusterSummary 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: // SUPERVISORS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list74 = iprot.readListBegin(); + struct.supervisors = new ArrayList(_list74.size); + for (int _i75 = 0; _i75 < _list74.size; ++_i75) + { + SupervisorSummary _elem76; // required + _elem76 = new SupervisorSummary(); + _elem76.read(iprot); + struct.supervisors.add(_elem76); + } + iprot.readListEnd(); + } + struct.set_supervisors_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // NIMBUS_UPTIME_SECS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.nimbus_uptime_secs = iprot.readI32(); + struct.set_nimbus_uptime_secs_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // TOPOLOGIES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list77 = iprot.readListBegin(); + struct.topologies = new ArrayList(_list77.size); + for (int _i78 = 0; _i78 < _list77.size; ++_i78) + { + TopologySummary _elem79; // required + _elem79 = new TopologySummary(); + _elem79.read(iprot); + struct.topologies.add(_elem79); + } + iprot.readListEnd(); + } + struct.set_topologies_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, ClusterSummary struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.supervisors != null) { + oprot.writeFieldBegin(SUPERVISORS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.supervisors.size())); + for (SupervisorSummary _iter80 : struct.supervisors) + { + _iter80.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(NIMBUS_UPTIME_SECS_FIELD_DESC); + oprot.writeI32(struct.nimbus_uptime_secs); + oprot.writeFieldEnd(); + if (struct.topologies != null) { + oprot.writeFieldBegin(TOPOLOGIES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.topologies.size())); + for (TopologySummary _iter81 : struct.topologies) + { + _iter81.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class ClusterSummaryTupleSchemeFactory implements SchemeFactory { + public ClusterSummaryTupleScheme getScheme() { + return new ClusterSummaryTupleScheme(); + } + } + + private static class ClusterSummaryTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, ClusterSummary struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + { + oprot.writeI32(struct.supervisors.size()); + for (SupervisorSummary _iter82 : struct.supervisors) + { + _iter82.write(oprot); + } + } + oprot.writeI32(struct.nimbus_uptime_secs); + { + oprot.writeI32(struct.topologies.size()); + for (TopologySummary _iter83 : struct.topologies) + { + _iter83.write(oprot); + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, ClusterSummary struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + { + org.apache.thrift.protocol.TList _list84 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.supervisors = new ArrayList(_list84.size); + for (int _i85 = 0; _i85 < _list84.size; ++_i85) + { + SupervisorSummary _elem86; // required + _elem86 = new SupervisorSummary(); + _elem86.read(iprot); + struct.supervisors.add(_elem86); + } + } + struct.set_supervisors_isSet(true); + struct.nimbus_uptime_secs = iprot.readI32(); + struct.set_nimbus_uptime_secs_isSet(true); + { + org.apache.thrift.protocol.TList _list87 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.topologies = new ArrayList(_list87.size); + for (int _i88 = 0; _i88 < _list87.size; ++_i88) + { + TopologySummary _elem89; // required + _elem89 = new TopologySummary(); + _elem89.read(iprot); + struct.topologies.add(_elem89); + } + } + struct.set_topologies_isSet(true); + } + } + +} + diff --git a/jstorm-client/src/main/java/backtype/storm/generated/ComponentCommon.java b/jstorm-client/src/main/java/backtype/storm/generated/ComponentCommon.java index ad3cd6e06..0ee332cc1 100644 --- a/jstorm-client/src/main/java/backtype/storm/generated/ComponentCommon.java +++ b/jstorm-client/src/main/java/backtype/storm/generated/ComponentCommon.java @@ -1,707 +1,828 @@ -/** - * Autogenerated by Thrift Compiler (0.7.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - */ -package backtype.storm.generated; - -import org.apache.commons.lang.builder.HashCodeBuilder; -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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class ComponentCommon implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ComponentCommon"); - - private static final org.apache.thrift.protocol.TField INPUTS_FIELD_DESC = new org.apache.thrift.protocol.TField("inputs", org.apache.thrift.protocol.TType.MAP, (short)1); - private static final org.apache.thrift.protocol.TField STREAMS_FIELD_DESC = new org.apache.thrift.protocol.TField("streams", org.apache.thrift.protocol.TType.MAP, (short)2); - private static final org.apache.thrift.protocol.TField PARALLELISM_HINT_FIELD_DESC = new org.apache.thrift.protocol.TField("parallelism_hint", org.apache.thrift.protocol.TType.I32, (short)3); - private static final org.apache.thrift.protocol.TField JSON_CONF_FIELD_DESC = new org.apache.thrift.protocol.TField("json_conf", org.apache.thrift.protocol.TType.STRING, (short)4); - - private Map inputs; // required - private Map streams; // required - private int parallelism_hint; // required - private String json_conf; // 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 { - INPUTS((short)1, "inputs"), - STREAMS((short)2, "streams"), - PARALLELISM_HINT((short)3, "parallelism_hint"), - JSON_CONF((short)4, "json_conf"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // INPUTS - return INPUTS; - case 2: // STREAMS - return STREAMS; - case 3: // PARALLELISM_HINT - return PARALLELISM_HINT; - case 4: // JSON_CONF - return JSON_CONF; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __PARALLELISM_HINT_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - - 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); - tmpMap.put(_Fields.INPUTS, new org.apache.thrift.meta_data.FieldMetaData("inputs", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, GlobalStreamId.class), - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Grouping.class)))); - tmpMap.put(_Fields.STREAMS, new org.apache.thrift.meta_data.FieldMetaData("streams", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, StreamInfo.class)))); - tmpMap.put(_Fields.PARALLELISM_HINT, new org.apache.thrift.meta_data.FieldMetaData("parallelism_hint", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.JSON_CONF, new org.apache.thrift.meta_data.FieldMetaData("json_conf", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ComponentCommon.class, metaDataMap); - } - - public ComponentCommon() { - } - - public ComponentCommon( - Map inputs, - Map streams) - { - this(); - this.inputs = inputs; - this.streams = streams; - } - - /** - * Performs a deep copy on other. - */ - public ComponentCommon(ComponentCommon other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); - if (other.is_set_inputs()) { - Map __this__inputs = new HashMap(); - for (Map.Entry other_element : other.inputs.entrySet()) { - - GlobalStreamId other_element_key = other_element.getKey(); - Grouping other_element_value = other_element.getValue(); - - GlobalStreamId __this__inputs_copy_key = new GlobalStreamId(other_element_key); - - Grouping __this__inputs_copy_value = new Grouping(other_element_value); - - __this__inputs.put(__this__inputs_copy_key, __this__inputs_copy_value); - } - this.inputs = __this__inputs; - } - if (other.is_set_streams()) { - Map __this__streams = new HashMap(); - for (Map.Entry other_element : other.streams.entrySet()) { - - String other_element_key = other_element.getKey(); - StreamInfo other_element_value = other_element.getValue(); - - String __this__streams_copy_key = other_element_key; - - StreamInfo __this__streams_copy_value = new StreamInfo(other_element_value); - - __this__streams.put(__this__streams_copy_key, __this__streams_copy_value); - } - this.streams = __this__streams; - } - this.parallelism_hint = other.parallelism_hint; - if (other.is_set_json_conf()) { - this.json_conf = other.json_conf; - } - } - - public ComponentCommon deepCopy() { - return new ComponentCommon(this); - } - - @Override - public void clear() { - this.inputs = null; - this.streams = null; - set_parallelism_hint_isSet(false); - this.parallelism_hint = 0; - this.json_conf = null; - } - - public int get_inputs_size() { - return (this.inputs == null) ? 0 : this.inputs.size(); - } - - public void put_to_inputs(GlobalStreamId key, Grouping val) { - if (this.inputs == null) { - this.inputs = new HashMap(); - } - this.inputs.put(key, val); - } - - public Map get_inputs() { - return this.inputs; - } - - public void set_inputs(Map inputs) { - this.inputs = inputs; - } - - public void unset_inputs() { - this.inputs = null; - } - - /** Returns true if field inputs is set (has been assigned a value) and false otherwise */ - public boolean is_set_inputs() { - return this.inputs != null; - } - - public void set_inputs_isSet(boolean value) { - if (!value) { - this.inputs = null; - } - } - - public int get_streams_size() { - return (this.streams == null) ? 0 : this.streams.size(); - } - - public void put_to_streams(String key, StreamInfo val) { - if (this.streams == null) { - this.streams = new HashMap(); - } - this.streams.put(key, val); - } - - public Map get_streams() { - return this.streams; - } - - public void set_streams(Map streams) { - this.streams = streams; - } - - public void unset_streams() { - this.streams = null; - } - - /** Returns true if field streams is set (has been assigned a value) and false otherwise */ - public boolean is_set_streams() { - return this.streams != null; - } - - public void set_streams_isSet(boolean value) { - if (!value) { - this.streams = null; - } - } - - public int get_parallelism_hint() { - return this.parallelism_hint; - } - - public void set_parallelism_hint(int parallelism_hint) { - this.parallelism_hint = parallelism_hint; - set_parallelism_hint_isSet(true); - } - - public void unset_parallelism_hint() { - __isset_bit_vector.clear(__PARALLELISM_HINT_ISSET_ID); - } - - /** Returns true if field parallelism_hint is set (has been assigned a value) and false otherwise */ - public boolean is_set_parallelism_hint() { - return __isset_bit_vector.get(__PARALLELISM_HINT_ISSET_ID); - } - - public void set_parallelism_hint_isSet(boolean value) { - __isset_bit_vector.set(__PARALLELISM_HINT_ISSET_ID, value); - } - - public String get_json_conf() { - return this.json_conf; - } - - public void set_json_conf(String json_conf) { - this.json_conf = json_conf; - } - - public void unset_json_conf() { - this.json_conf = null; - } - - /** Returns true if field json_conf is set (has been assigned a value) and false otherwise */ - public boolean is_set_json_conf() { - return this.json_conf != null; - } - - public void set_json_conf_isSet(boolean value) { - if (!value) { - this.json_conf = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case INPUTS: - if (value == null) { - unset_inputs(); - } else { - set_inputs((Map)value); - } - break; - - case STREAMS: - if (value == null) { - unset_streams(); - } else { - set_streams((Map)value); - } - break; - - case PARALLELISM_HINT: - if (value == null) { - unset_parallelism_hint(); - } else { - set_parallelism_hint((Integer)value); - } - break; - - case JSON_CONF: - if (value == null) { - unset_json_conf(); - } else { - set_json_conf((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case INPUTS: - return get_inputs(); - - case STREAMS: - return get_streams(); - - case PARALLELISM_HINT: - return Integer.valueOf(get_parallelism_hint()); - - case JSON_CONF: - return get_json_conf(); - - } - throw new 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(); - } - - switch (field) { - case INPUTS: - return is_set_inputs(); - case STREAMS: - return is_set_streams(); - case PARALLELISM_HINT: - return is_set_parallelism_hint(); - case JSON_CONF: - return is_set_json_conf(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof ComponentCommon) - return this.equals((ComponentCommon)that); - return false; - } - - public boolean equals(ComponentCommon that) { - if (that == null) - return false; - - boolean this_present_inputs = true && this.is_set_inputs(); - boolean that_present_inputs = true && that.is_set_inputs(); - if (this_present_inputs || that_present_inputs) { - if (!(this_present_inputs && that_present_inputs)) - return false; - if (!this.inputs.equals(that.inputs)) - return false; - } - - boolean this_present_streams = true && this.is_set_streams(); - boolean that_present_streams = true && that.is_set_streams(); - if (this_present_streams || that_present_streams) { - if (!(this_present_streams && that_present_streams)) - return false; - if (!this.streams.equals(that.streams)) - return false; - } - - boolean this_present_parallelism_hint = true && this.is_set_parallelism_hint(); - boolean that_present_parallelism_hint = true && that.is_set_parallelism_hint(); - if (this_present_parallelism_hint || that_present_parallelism_hint) { - if (!(this_present_parallelism_hint && that_present_parallelism_hint)) - return false; - if (this.parallelism_hint != that.parallelism_hint) - return false; - } - - boolean this_present_json_conf = true && this.is_set_json_conf(); - boolean that_present_json_conf = true && that.is_set_json_conf(); - if (this_present_json_conf || that_present_json_conf) { - if (!(this_present_json_conf && that_present_json_conf)) - return false; - if (!this.json_conf.equals(that.json_conf)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_inputs = true && (is_set_inputs()); - builder.append(present_inputs); - if (present_inputs) - builder.append(inputs); - - boolean present_streams = true && (is_set_streams()); - builder.append(present_streams); - if (present_streams) - builder.append(streams); - - boolean present_parallelism_hint = true && (is_set_parallelism_hint()); - builder.append(present_parallelism_hint); - if (present_parallelism_hint) - builder.append(parallelism_hint); - - boolean present_json_conf = true && (is_set_json_conf()); - builder.append(present_json_conf); - if (present_json_conf) - builder.append(json_conf); - - return builder.toHashCode(); - } - - public int compareTo(ComponentCommon other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - ComponentCommon typedOther = (ComponentCommon)other; - - lastComparison = Boolean.valueOf(is_set_inputs()).compareTo(typedOther.is_set_inputs()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_inputs()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.inputs, typedOther.inputs); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_streams()).compareTo(typedOther.is_set_streams()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_streams()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.streams, typedOther.streams); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_parallelism_hint()).compareTo(typedOther.is_set_parallelism_hint()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_parallelism_hint()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parallelism_hint, typedOther.parallelism_hint); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_json_conf()).compareTo(typedOther.is_set_json_conf()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_json_conf()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.json_conf, typedOther.json_conf); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // INPUTS - if (field.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map12 = iprot.readMapBegin(); - this.inputs = new HashMap(2*_map12.size); - for (int _i13 = 0; _i13 < _map12.size; ++_i13) - { - GlobalStreamId _key14; // required - Grouping _val15; // required - _key14 = new GlobalStreamId(); - _key14.read(iprot); - _val15 = new Grouping(); - _val15.read(iprot); - this.inputs.put(_key14, _val15); - } - iprot.readMapEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // STREAMS - if (field.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map16 = iprot.readMapBegin(); - this.streams = new HashMap(2*_map16.size); - for (int _i17 = 0; _i17 < _map16.size; ++_i17) - { - String _key18; // required - StreamInfo _val19; // required - _key18 = iprot.readString(); - _val19 = new StreamInfo(); - _val19.read(iprot); - this.streams.put(_key18, _val19); - } - iprot.readMapEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // PARALLELISM_HINT - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.parallelism_hint = iprot.readI32(); - set_parallelism_hint_isSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // JSON_CONF - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.json_conf = 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.inputs != null) { - oprot.writeFieldBegin(INPUTS_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.STRUCT, this.inputs.size())); - for (Map.Entry _iter20 : this.inputs.entrySet()) - { - _iter20.getKey().write(oprot); - _iter20.getValue().write(oprot); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - if (this.streams != null) { - oprot.writeFieldBegin(STREAMS_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, this.streams.size())); - for (Map.Entry _iter21 : this.streams.entrySet()) - { - oprot.writeString(_iter21.getKey()); - _iter21.getValue().write(oprot); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - if (is_set_parallelism_hint()) { - oprot.writeFieldBegin(PARALLELISM_HINT_FIELD_DESC); - oprot.writeI32(this.parallelism_hint); - oprot.writeFieldEnd(); - } - if (this.json_conf != null) { - if (is_set_json_conf()) { - oprot.writeFieldBegin(JSON_CONF_FIELD_DESC); - oprot.writeString(this.json_conf); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("ComponentCommon("); - boolean first = true; - - sb.append("inputs:"); - if (this.inputs == null) { - sb.append("null"); - } else { - sb.append(this.inputs); - } - first = false; - if (!first) sb.append(", "); - sb.append("streams:"); - if (this.streams == null) { - sb.append("null"); - } else { - sb.append(this.streams); - } - first = false; - if (is_set_parallelism_hint()) { - if (!first) sb.append(", "); - sb.append("parallelism_hint:"); - sb.append(this.parallelism_hint); - first = false; - } - if (is_set_json_conf()) { - if (!first) sb.append(", "); - sb.append("json_conf:"); - if (this.json_conf == null) { - sb.append("null"); - } else { - sb.append(this.json_conf); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!is_set_inputs()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'inputs' is unset! Struct:" + toString()); - } - - if (!is_set_streams()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'streams' is unset! Struct:" + toString()); - } - - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - 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); - 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); - } - } - -} - +/** + * Autogenerated by Thrift Compiler (0.8.0) + * + * 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 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class ComponentCommon implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ComponentCommon"); + + private static final org.apache.thrift.protocol.TField INPUTS_FIELD_DESC = new org.apache.thrift.protocol.TField("inputs", org.apache.thrift.protocol.TType.MAP, (short)1); + private static final org.apache.thrift.protocol.TField STREAMS_FIELD_DESC = new org.apache.thrift.protocol.TField("streams", org.apache.thrift.protocol.TType.MAP, (short)2); + private static final org.apache.thrift.protocol.TField PARALLELISM_HINT_FIELD_DESC = new org.apache.thrift.protocol.TField("parallelism_hint", org.apache.thrift.protocol.TType.I32, (short)3); + private static final org.apache.thrift.protocol.TField JSON_CONF_FIELD_DESC = new org.apache.thrift.protocol.TField("json_conf", org.apache.thrift.protocol.TType.STRING, (short)4); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new ComponentCommonStandardSchemeFactory()); + schemes.put(TupleScheme.class, new ComponentCommonTupleSchemeFactory()); + } + + private Map inputs; // required + private Map streams; // required + private int parallelism_hint; // optional + private String json_conf; // 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 { + INPUTS((short)1, "inputs"), + STREAMS((short)2, "streams"), + PARALLELISM_HINT((short)3, "parallelism_hint"), + JSON_CONF((short)4, "json_conf"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // INPUTS + return INPUTS; + case 2: // STREAMS + return STREAMS; + case 3: // PARALLELISM_HINT + return PARALLELISM_HINT; + case 4: // JSON_CONF + return JSON_CONF; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __PARALLELISM_HINT_ISSET_ID = 0; + private BitSet __isset_bit_vector = new BitSet(1); + private _Fields optionals[] = {_Fields.PARALLELISM_HINT,_Fields.JSON_CONF}; + 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); + tmpMap.put(_Fields.INPUTS, new org.apache.thrift.meta_data.FieldMetaData("inputs", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, GlobalStreamId.class), + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Grouping.class)))); + tmpMap.put(_Fields.STREAMS, new org.apache.thrift.meta_data.FieldMetaData("streams", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, StreamInfo.class)))); + tmpMap.put(_Fields.PARALLELISM_HINT, new org.apache.thrift.meta_data.FieldMetaData("parallelism_hint", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.JSON_CONF, new org.apache.thrift.meta_data.FieldMetaData("json_conf", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ComponentCommon.class, metaDataMap); + } + + public ComponentCommon() { + } + + public ComponentCommon( + Map inputs, + Map streams) + { + this(); + this.inputs = inputs; + this.streams = streams; + } + + /** + * Performs a deep copy on other. + */ + public ComponentCommon(ComponentCommon other) { + __isset_bit_vector.clear(); + __isset_bit_vector.or(other.__isset_bit_vector); + if (other.is_set_inputs()) { + Map __this__inputs = new HashMap(); + for (Map.Entry other_element : other.inputs.entrySet()) { + + GlobalStreamId other_element_key = other_element.getKey(); + Grouping other_element_value = other_element.getValue(); + + GlobalStreamId __this__inputs_copy_key = new GlobalStreamId(other_element_key); + + Grouping __this__inputs_copy_value = new Grouping(other_element_value); + + __this__inputs.put(__this__inputs_copy_key, __this__inputs_copy_value); + } + this.inputs = __this__inputs; + } + if (other.is_set_streams()) { + Map __this__streams = new HashMap(); + for (Map.Entry other_element : other.streams.entrySet()) { + + String other_element_key = other_element.getKey(); + StreamInfo other_element_value = other_element.getValue(); + + String __this__streams_copy_key = other_element_key; + + StreamInfo __this__streams_copy_value = new StreamInfo(other_element_value); + + __this__streams.put(__this__streams_copy_key, __this__streams_copy_value); + } + this.streams = __this__streams; + } + this.parallelism_hint = other.parallelism_hint; + if (other.is_set_json_conf()) { + this.json_conf = other.json_conf; + } + } + + public ComponentCommon deepCopy() { + return new ComponentCommon(this); + } + + @Override + public void clear() { + this.inputs = null; + this.streams = null; + set_parallelism_hint_isSet(false); + this.parallelism_hint = 0; + this.json_conf = null; + } + + public int get_inputs_size() { + return (this.inputs == null) ? 0 : this.inputs.size(); + } + + public void put_to_inputs(GlobalStreamId key, Grouping val) { + if (this.inputs == null) { + this.inputs = new HashMap(); + } + this.inputs.put(key, val); + } + + public Map get_inputs() { + return this.inputs; + } + + public void set_inputs(Map inputs) { + this.inputs = inputs; + } + + public void unset_inputs() { + this.inputs = null; + } + + /** Returns true if field inputs is set (has been assigned a value) and false otherwise */ + public boolean is_set_inputs() { + return this.inputs != null; + } + + public void set_inputs_isSet(boolean value) { + if (!value) { + this.inputs = null; + } + } + + public int get_streams_size() { + return (this.streams == null) ? 0 : this.streams.size(); + } + + public void put_to_streams(String key, StreamInfo val) { + if (this.streams == null) { + this.streams = new HashMap(); + } + this.streams.put(key, val); + } + + public Map get_streams() { + return this.streams; + } + + public void set_streams(Map streams) { + this.streams = streams; + } + + public void unset_streams() { + this.streams = null; + } + + /** Returns true if field streams is set (has been assigned a value) and false otherwise */ + public boolean is_set_streams() { + return this.streams != null; + } + + public void set_streams_isSet(boolean value) { + if (!value) { + this.streams = null; + } + } + + public int get_parallelism_hint() { + return this.parallelism_hint; + } + + public void set_parallelism_hint(int parallelism_hint) { + this.parallelism_hint = parallelism_hint; + set_parallelism_hint_isSet(true); + } + + public void unset_parallelism_hint() { + __isset_bit_vector.clear(__PARALLELISM_HINT_ISSET_ID); + } + + /** Returns true if field parallelism_hint is set (has been assigned a value) and false otherwise */ + public boolean is_set_parallelism_hint() { + return __isset_bit_vector.get(__PARALLELISM_HINT_ISSET_ID); + } + + public void set_parallelism_hint_isSet(boolean value) { + __isset_bit_vector.set(__PARALLELISM_HINT_ISSET_ID, value); + } + + public String get_json_conf() { + return this.json_conf; + } + + public void set_json_conf(String json_conf) { + this.json_conf = json_conf; + } + + public void unset_json_conf() { + this.json_conf = null; + } + + /** Returns true if field json_conf is set (has been assigned a value) and false otherwise */ + public boolean is_set_json_conf() { + return this.json_conf != null; + } + + public void set_json_conf_isSet(boolean value) { + if (!value) { + this.json_conf = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case INPUTS: + if (value == null) { + unset_inputs(); + } else { + set_inputs((Map)value); + } + break; + + case STREAMS: + if (value == null) { + unset_streams(); + } else { + set_streams((Map)value); + } + break; + + case PARALLELISM_HINT: + if (value == null) { + unset_parallelism_hint(); + } else { + set_parallelism_hint((Integer)value); + } + break; + + case JSON_CONF: + if (value == null) { + unset_json_conf(); + } else { + set_json_conf((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case INPUTS: + return get_inputs(); + + case STREAMS: + return get_streams(); + + case PARALLELISM_HINT: + return Integer.valueOf(get_parallelism_hint()); + + case JSON_CONF: + return get_json_conf(); + + } + throw new 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(); + } + + switch (field) { + case INPUTS: + return is_set_inputs(); + case STREAMS: + return is_set_streams(); + case PARALLELISM_HINT: + return is_set_parallelism_hint(); + case JSON_CONF: + return is_set_json_conf(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof ComponentCommon) + return this.equals((ComponentCommon)that); + return false; + } + + public boolean equals(ComponentCommon that) { + if (that == null) + return false; + + boolean this_present_inputs = true && this.is_set_inputs(); + boolean that_present_inputs = true && that.is_set_inputs(); + if (this_present_inputs || that_present_inputs) { + if (!(this_present_inputs && that_present_inputs)) + return false; + if (!this.inputs.equals(that.inputs)) + return false; + } + + boolean this_present_streams = true && this.is_set_streams(); + boolean that_present_streams = true && that.is_set_streams(); + if (this_present_streams || that_present_streams) { + if (!(this_present_streams && that_present_streams)) + return false; + if (!this.streams.equals(that.streams)) + return false; + } + + boolean this_present_parallelism_hint = true && this.is_set_parallelism_hint(); + boolean that_present_parallelism_hint = true && that.is_set_parallelism_hint(); + if (this_present_parallelism_hint || that_present_parallelism_hint) { + if (!(this_present_parallelism_hint && that_present_parallelism_hint)) + return false; + if (this.parallelism_hint != that.parallelism_hint) + return false; + } + + boolean this_present_json_conf = true && this.is_set_json_conf(); + boolean that_present_json_conf = true && that.is_set_json_conf(); + if (this_present_json_conf || that_present_json_conf) { + if (!(this_present_json_conf && that_present_json_conf)) + return false; + if (!this.json_conf.equals(that.json_conf)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_inputs = true && (is_set_inputs()); + builder.append(present_inputs); + if (present_inputs) + builder.append(inputs); + + boolean present_streams = true && (is_set_streams()); + builder.append(present_streams); + if (present_streams) + builder.append(streams); + + boolean present_parallelism_hint = true && (is_set_parallelism_hint()); + builder.append(present_parallelism_hint); + if (present_parallelism_hint) + builder.append(parallelism_hint); + + boolean present_json_conf = true && (is_set_json_conf()); + builder.append(present_json_conf); + if (present_json_conf) + builder.append(json_conf); + + return builder.toHashCode(); + } + + public int compareTo(ComponentCommon other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + ComponentCommon typedOther = (ComponentCommon)other; + + lastComparison = Boolean.valueOf(is_set_inputs()).compareTo(typedOther.is_set_inputs()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_inputs()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.inputs, typedOther.inputs); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_streams()).compareTo(typedOther.is_set_streams()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_streams()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.streams, typedOther.streams); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_parallelism_hint()).compareTo(typedOther.is_set_parallelism_hint()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_parallelism_hint()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parallelism_hint, typedOther.parallelism_hint); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_json_conf()).compareTo(typedOther.is_set_json_conf()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_json_conf()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.json_conf, typedOther.json_conf); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("ComponentCommon("); + boolean first = true; + + sb.append("inputs:"); + if (this.inputs == null) { + sb.append("null"); + } else { + sb.append(this.inputs); + } + first = false; + if (!first) sb.append(", "); + sb.append("streams:"); + if (this.streams == null) { + sb.append("null"); + } else { + sb.append(this.streams); + } + first = false; + if (is_set_parallelism_hint()) { + if (!first) sb.append(", "); + sb.append("parallelism_hint:"); + sb.append(this.parallelism_hint); + first = false; + } + if (is_set_json_conf()) { + if (!first) sb.append(", "); + sb.append("json_conf:"); + if (this.json_conf == null) { + sb.append("null"); + } else { + sb.append(this.json_conf); + } + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!is_set_inputs()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'inputs' is unset! Struct:" + toString()); + } + + if (!is_set_streams()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'streams' is unset! Struct:" + toString()); + } + + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + 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); + 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 ComponentCommonStandardSchemeFactory implements SchemeFactory { + public ComponentCommonStandardScheme getScheme() { + return new ComponentCommonStandardScheme(); + } + } + + private static class ComponentCommonStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, ComponentCommon 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: // INPUTS + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map24 = iprot.readMapBegin(); + struct.inputs = new HashMap(2*_map24.size); + for (int _i25 = 0; _i25 < _map24.size; ++_i25) + { + GlobalStreamId _key26; // required + Grouping _val27; // required + _key26 = new GlobalStreamId(); + _key26.read(iprot); + _val27 = new Grouping(); + _val27.read(iprot); + struct.inputs.put(_key26, _val27); + } + iprot.readMapEnd(); + } + struct.set_inputs_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // STREAMS + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map28 = iprot.readMapBegin(); + struct.streams = new HashMap(2*_map28.size); + for (int _i29 = 0; _i29 < _map28.size; ++_i29) + { + String _key30; // required + StreamInfo _val31; // required + _key30 = iprot.readString(); + _val31 = new StreamInfo(); + _val31.read(iprot); + struct.streams.put(_key30, _val31); + } + iprot.readMapEnd(); + } + struct.set_streams_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // PARALLELISM_HINT + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.parallelism_hint = iprot.readI32(); + struct.set_parallelism_hint_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // JSON_CONF + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.json_conf = iprot.readString(); + struct.set_json_conf_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, ComponentCommon struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.inputs != null) { + oprot.writeFieldBegin(INPUTS_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.STRUCT, struct.inputs.size())); + for (Map.Entry _iter32 : struct.inputs.entrySet()) + { + _iter32.getKey().write(oprot); + _iter32.getValue().write(oprot); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.streams != null) { + oprot.writeFieldBegin(STREAMS_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.streams.size())); + for (Map.Entry _iter33 : struct.streams.entrySet()) + { + oprot.writeString(_iter33.getKey()); + _iter33.getValue().write(oprot); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.is_set_parallelism_hint()) { + oprot.writeFieldBegin(PARALLELISM_HINT_FIELD_DESC); + oprot.writeI32(struct.parallelism_hint); + oprot.writeFieldEnd(); + } + if (struct.json_conf != null) { + if (struct.is_set_json_conf()) { + oprot.writeFieldBegin(JSON_CONF_FIELD_DESC); + oprot.writeString(struct.json_conf); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class ComponentCommonTupleSchemeFactory implements SchemeFactory { + public ComponentCommonTupleScheme getScheme() { + return new ComponentCommonTupleScheme(); + } + } + + private static class ComponentCommonTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, ComponentCommon struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + { + oprot.writeI32(struct.inputs.size()); + for (Map.Entry _iter34 : struct.inputs.entrySet()) + { + _iter34.getKey().write(oprot); + _iter34.getValue().write(oprot); + } + } + { + oprot.writeI32(struct.streams.size()); + for (Map.Entry _iter35 : struct.streams.entrySet()) + { + oprot.writeString(_iter35.getKey()); + _iter35.getValue().write(oprot); + } + } + BitSet optionals = new BitSet(); + if (struct.is_set_parallelism_hint()) { + optionals.set(0); + } + if (struct.is_set_json_conf()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.is_set_parallelism_hint()) { + oprot.writeI32(struct.parallelism_hint); + } + if (struct.is_set_json_conf()) { + oprot.writeString(struct.json_conf); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, ComponentCommon struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + { + org.apache.thrift.protocol.TMap _map36 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.inputs = new HashMap(2*_map36.size); + for (int _i37 = 0; _i37 < _map36.size; ++_i37) + { + GlobalStreamId _key38; // required + Grouping _val39; // required + _key38 = new GlobalStreamId(); + _key38.read(iprot); + _val39 = new Grouping(); + _val39.read(iprot); + struct.inputs.put(_key38, _val39); + } + } + struct.set_inputs_isSet(true); + { + org.apache.thrift.protocol.TMap _map40 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.streams = new HashMap(2*_map40.size); + for (int _i41 = 0; _i41 < _map40.size; ++_i41) + { + String _key42; // required + StreamInfo _val43; // required + _key42 = iprot.readString(); + _val43 = new StreamInfo(); + _val43.read(iprot); + struct.streams.put(_key42, _val43); + } + } + struct.set_streams_isSet(true); + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.parallelism_hint = iprot.readI32(); + struct.set_parallelism_hint_isSet(true); + } + if (incoming.get(1)) { + struct.json_conf = iprot.readString(); + struct.set_json_conf_isSet(true); + } + } + } + +} + diff --git a/jstorm-client/src/main/java/backtype/storm/generated/ComponentObject.java b/jstorm-client/src/main/java/backtype/storm/generated/ComponentObject.java index ade598df7..2f1b97f0c 100644 --- a/jstorm-client/src/main/java/backtype/storm/generated/ComponentObject.java +++ b/jstorm-client/src/main/java/backtype/storm/generated/ComponentObject.java @@ -1,385 +1,438 @@ -/** - * Autogenerated by Thrift Compiler (0.7.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - */ -package backtype.storm.generated; - -import org.apache.commons.lang.builder.HashCodeBuilder; -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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class ComponentObject extends org.apache.thrift.TUnion { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ComponentObject"); - private static final org.apache.thrift.protocol.TField SERIALIZED_JAVA_FIELD_DESC = new org.apache.thrift.protocol.TField("serialized_java", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField SHELL_FIELD_DESC = new org.apache.thrift.protocol.TField("shell", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.protocol.TField JAVA_OBJECT_FIELD_DESC = new org.apache.thrift.protocol.TField("java_object", org.apache.thrift.protocol.TType.STRUCT, (short)3); - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SERIALIZED_JAVA((short)1, "serialized_java"), - SHELL((short)2, "shell"), - JAVA_OBJECT((short)3, "java_object"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SERIALIZED_JAVA - return SERIALIZED_JAVA; - case 2: // SHELL - return SHELL; - case 3: // JAVA_OBJECT - return JAVA_OBJECT; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - 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); - tmpMap.put(_Fields.SERIALIZED_JAVA, new org.apache.thrift.meta_data.FieldMetaData("serialized_java", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - tmpMap.put(_Fields.SHELL, new org.apache.thrift.meta_data.FieldMetaData("shell", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ShellComponent.class))); - tmpMap.put(_Fields.JAVA_OBJECT, new org.apache.thrift.meta_data.FieldMetaData("java_object", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, JavaObject.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ComponentObject.class, metaDataMap); - } - - public ComponentObject() { - super(); - } - - public ComponentObject(_Fields setField, Object value) { - super(setField, value); - } - - public ComponentObject(ComponentObject other) { - super(other); - } - public ComponentObject deepCopy() { - return new ComponentObject(this); - } - - public static ComponentObject serialized_java(ByteBuffer value) { - ComponentObject x = new ComponentObject(); - x.set_serialized_java(value); - return x; - } - - public static ComponentObject serialized_java(byte[] value) { - ComponentObject x = new ComponentObject(); - x.set_serialized_java(ByteBuffer.wrap(value)); - return x; - } - - public static ComponentObject shell(ShellComponent value) { - ComponentObject x = new ComponentObject(); - x.set_shell(value); - return x; - } - - public static ComponentObject java_object(JavaObject value) { - ComponentObject x = new ComponentObject(); - x.set_java_object(value); - return x; - } - - - @Override - protected void checkType(_Fields setField, Object value) throws ClassCastException { - switch (setField) { - case SERIALIZED_JAVA: - if (value instanceof ByteBuffer) { - break; - } - throw new ClassCastException("Was expecting value of type ByteBuffer for field 'serialized_java', but got " + value.getClass().getSimpleName()); - case SHELL: - if (value instanceof ShellComponent) { - break; - } - throw new ClassCastException("Was expecting value of type ShellComponent for field 'shell', but got " + value.getClass().getSimpleName()); - case JAVA_OBJECT: - if (value instanceof JavaObject) { - break; - } - throw new ClassCastException("Was expecting value of type JavaObject for field 'java_object', but got " + value.getClass().getSimpleName()); - default: - throw new IllegalArgumentException("Unknown field id " + setField); - } - } - - @Override - protected Object readValue(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 SERIALIZED_JAVA: - if (field.type == SERIALIZED_JAVA_FIELD_DESC.type) { - ByteBuffer serialized_java; - serialized_java = iprot.readBinary(); - return serialized_java; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case SHELL: - if (field.type == SHELL_FIELD_DESC.type) { - ShellComponent shell; - shell = new ShellComponent(); - shell.read(iprot); - return shell; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case JAVA_OBJECT: - if (field.type == JAVA_OBJECT_FIELD_DESC.type) { - JavaObject java_object; - java_object = new JavaObject(); - java_object.read(iprot); - return java_object; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - default: - throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - } - - @Override - protected void writeValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - switch (setField_) { - case SERIALIZED_JAVA: - ByteBuffer serialized_java = (ByteBuffer)value_; - oprot.writeBinary(serialized_java); - return; - case SHELL: - ShellComponent shell = (ShellComponent)value_; - shell.write(oprot); - return; - case JAVA_OBJECT: - JavaObject java_object = (JavaObject)value_; - java_object.write(oprot); - return; - default: - throw new IllegalStateException("Cannot write union with unknown field " + setField_); - } - } - - @Override - protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { - switch (setField) { - case SERIALIZED_JAVA: - return SERIALIZED_JAVA_FIELD_DESC; - case SHELL: - return SHELL_FIELD_DESC; - case JAVA_OBJECT: - return JAVA_OBJECT_FIELD_DESC; - default: - throw new IllegalArgumentException("Unknown field id " + setField); - } - } - - @Override - protected org.apache.thrift.protocol.TStruct getStructDesc() { - return STRUCT_DESC; - } - - @Override - protected _Fields enumForId(short id) { - return _Fields.findByThriftIdOrThrow(id); - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - - public byte[] get_serialized_java() { - set_serialized_java(org.apache.thrift.TBaseHelper.rightSize(buffer_for_serialized_java())); - ByteBuffer b = buffer_for_serialized_java(); - return b == null ? null : b.array(); - } - - public ByteBuffer buffer_for_serialized_java() { - if (getSetField() == _Fields.SERIALIZED_JAVA) { - return (ByteBuffer)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'serialized_java' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void set_serialized_java(byte[] value) { - set_serialized_java(ByteBuffer.wrap(value)); - } - - public void set_serialized_java(ByteBuffer value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.SERIALIZED_JAVA; - value_ = value; - } - - public ShellComponent get_shell() { - if (getSetField() == _Fields.SHELL) { - return (ShellComponent)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'shell' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void set_shell(ShellComponent value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.SHELL; - value_ = value; - } - - public JavaObject get_java_object() { - if (getSetField() == _Fields.JAVA_OBJECT) { - return (JavaObject)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'java_object' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void set_java_object(JavaObject value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.JAVA_OBJECT; - value_ = value; - } - - public boolean is_set_serialized_java() { - return setField_ == _Fields.SERIALIZED_JAVA; - } - - - public boolean is_set_shell() { - return setField_ == _Fields.SHELL; - } - - - public boolean is_set_java_object() { - return setField_ == _Fields.JAVA_OBJECT; - } - - - public boolean equals(Object other) { - if (other instanceof ComponentObject) { - return equals((ComponentObject)other); - } else { - return false; - } - } - - public boolean equals(ComponentObject other) { - return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); - } - - @Override - public int compareTo(ComponentObject other) { - int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); - if (lastComparison == 0) { - return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); - } - return lastComparison; - } - - - @Override - public int hashCode() { - HashCodeBuilder hcb = new HashCodeBuilder(); - hcb.append(this.getClass().getName()); - org.apache.thrift.TFieldIdEnum setField = getSetField(); - if (setField != null) { - hcb.append(setField.getThriftFieldId()); - Object value = getFieldValue(); - if (value instanceof org.apache.thrift.TEnum) { - hcb.append(((org.apache.thrift.TEnum)getFieldValue()).getValue()); - } else { - hcb.append(value); - } - } - return hcb.toHashCode(); - } - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - -} +/** + * Autogenerated by Thrift Compiler (0.8.0) + * + * 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 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class ComponentObject extends org.apache.thrift.TUnion { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ComponentObject"); + private static final org.apache.thrift.protocol.TField SERIALIZED_JAVA_FIELD_DESC = new org.apache.thrift.protocol.TField("serialized_java", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField SHELL_FIELD_DESC = new org.apache.thrift.protocol.TField("shell", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField JAVA_OBJECT_FIELD_DESC = new org.apache.thrift.protocol.TField("java_object", org.apache.thrift.protocol.TType.STRUCT, (short)3); + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SERIALIZED_JAVA((short)1, "serialized_java"), + SHELL((short)2, "shell"), + JAVA_OBJECT((short)3, "java_object"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // SERIALIZED_JAVA + return SERIALIZED_JAVA; + case 2: // SHELL + return SHELL; + case 3: // JAVA_OBJECT + return JAVA_OBJECT; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + 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); + tmpMap.put(_Fields.SERIALIZED_JAVA, new org.apache.thrift.meta_data.FieldMetaData("serialized_java", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.SHELL, new org.apache.thrift.meta_data.FieldMetaData("shell", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ShellComponent.class))); + tmpMap.put(_Fields.JAVA_OBJECT, new org.apache.thrift.meta_data.FieldMetaData("java_object", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, JavaObject.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ComponentObject.class, metaDataMap); + } + + public ComponentObject() { + super(); + } + + public ComponentObject(_Fields setField, Object value) { + super(setField, value); + } + + public ComponentObject(ComponentObject other) { + super(other); + } + public ComponentObject deepCopy() { + return new ComponentObject(this); + } + + public static ComponentObject serialized_java(ByteBuffer value) { + ComponentObject x = new ComponentObject(); + x.set_serialized_java(value); + return x; + } + + public static ComponentObject serialized_java(byte[] value) { + ComponentObject x = new ComponentObject(); + x.set_serialized_java(ByteBuffer.wrap(value)); + return x; + } + + public static ComponentObject shell(ShellComponent value) { + ComponentObject x = new ComponentObject(); + x.set_shell(value); + return x; + } + + public static ComponentObject java_object(JavaObject value) { + ComponentObject x = new ComponentObject(); + x.set_java_object(value); + return x; + } + + + @Override + protected void checkType(_Fields setField, Object value) throws ClassCastException { + switch (setField) { + case SERIALIZED_JAVA: + if (value instanceof ByteBuffer) { + break; + } + throw new ClassCastException("Was expecting value of type ByteBuffer for field 'serialized_java', but got " + value.getClass().getSimpleName()); + case SHELL: + if (value instanceof ShellComponent) { + break; + } + throw new ClassCastException("Was expecting value of type ShellComponent for field 'shell', but got " + value.getClass().getSimpleName()); + case JAVA_OBJECT: + if (value instanceof JavaObject) { + break; + } + throw new ClassCastException("Was expecting value of type JavaObject for field 'java_object', but got " + value.getClass().getSimpleName()); + default: + throw new 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 { + _Fields setField = _Fields.findByThriftId(field.id); + if (setField != null) { + switch (setField) { + case SERIALIZED_JAVA: + if (field.type == SERIALIZED_JAVA_FIELD_DESC.type) { + ByteBuffer serialized_java; + serialized_java = iprot.readBinary(); + return serialized_java; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case SHELL: + if (field.type == SHELL_FIELD_DESC.type) { + ShellComponent shell; + shell = new ShellComponent(); + shell.read(iprot); + return shell; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case JAVA_OBJECT: + if (field.type == JAVA_OBJECT_FIELD_DESC.type) { + JavaObject java_object; + java_object = new JavaObject(); + java_object.read(iprot); + return java_object; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + default: + throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + } + } else { + return null; + } + } + + @Override + protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + switch (setField_) { + case SERIALIZED_JAVA: + ByteBuffer serialized_java = (ByteBuffer)value_; + oprot.writeBinary(serialized_java); + return; + case SHELL: + ShellComponent shell = (ShellComponent)value_; + shell.write(oprot); + return; + case JAVA_OBJECT: + JavaObject java_object = (JavaObject)value_; + java_object.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 SERIALIZED_JAVA: + ByteBuffer serialized_java; + serialized_java = iprot.readBinary(); + return serialized_java; + case SHELL: + ShellComponent shell; + shell = new ShellComponent(); + shell.read(iprot); + return shell; + case JAVA_OBJECT: + JavaObject java_object; + java_object = new JavaObject(); + java_object.read(iprot); + return java_object; + default: + throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + } + } else { + return null; + } + } + + @Override + protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + switch (setField_) { + case SERIALIZED_JAVA: + ByteBuffer serialized_java = (ByteBuffer)value_; + oprot.writeBinary(serialized_java); + return; + case SHELL: + ShellComponent shell = (ShellComponent)value_; + shell.write(oprot); + return; + case JAVA_OBJECT: + JavaObject java_object = (JavaObject)value_; + java_object.write(oprot); + return; + default: + throw new IllegalStateException("Cannot write union with unknown field " + setField_); + } + } + + @Override + protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { + switch (setField) { + case SERIALIZED_JAVA: + return SERIALIZED_JAVA_FIELD_DESC; + case SHELL: + return SHELL_FIELD_DESC; + case JAVA_OBJECT: + return JAVA_OBJECT_FIELD_DESC; + default: + throw new IllegalArgumentException("Unknown field id " + setField); + } + } + + @Override + protected org.apache.thrift.protocol.TStruct getStructDesc() { + return STRUCT_DESC; + } + + @Override + protected _Fields enumForId(short id) { + return _Fields.findByThriftIdOrThrow(id); + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + + public byte[] get_serialized_java() { + set_serialized_java(org.apache.thrift.TBaseHelper.rightSize(buffer_for_serialized_java())); + ByteBuffer b = buffer_for_serialized_java(); + return b == null ? null : b.array(); + } + + public ByteBuffer buffer_for_serialized_java() { + if (getSetField() == _Fields.SERIALIZED_JAVA) { + return (ByteBuffer)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'serialized_java' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void set_serialized_java(byte[] value) { + set_serialized_java(ByteBuffer.wrap(value)); + } + + public void set_serialized_java(ByteBuffer value) { + if (value == null) throw new NullPointerException(); + setField_ = _Fields.SERIALIZED_JAVA; + value_ = value; + } + + public ShellComponent get_shell() { + if (getSetField() == _Fields.SHELL) { + return (ShellComponent)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'shell' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void set_shell(ShellComponent value) { + if (value == null) throw new NullPointerException(); + setField_ = _Fields.SHELL; + value_ = value; + } + + public JavaObject get_java_object() { + if (getSetField() == _Fields.JAVA_OBJECT) { + return (JavaObject)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'java_object' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void set_java_object(JavaObject value) { + if (value == null) throw new NullPointerException(); + setField_ = _Fields.JAVA_OBJECT; + value_ = value; + } + + public boolean is_set_serialized_java() { + return setField_ == _Fields.SERIALIZED_JAVA; + } + + + public boolean is_set_shell() { + return setField_ == _Fields.SHELL; + } + + + public boolean is_set_java_object() { + return setField_ == _Fields.JAVA_OBJECT; + } + + + public boolean equals(Object other) { + if (other instanceof ComponentObject) { + return equals((ComponentObject)other); + } else { + return false; + } + } + + public boolean equals(ComponentObject other) { + return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); + } + + @Override + public int compareTo(ComponentObject other) { + int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); + if (lastComparison == 0) { + return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); + } + return lastComparison; + } + + + @Override + public int hashCode() { + HashCodeBuilder hcb = new HashCodeBuilder(); + hcb.append(this.getClass().getName()); + org.apache.thrift.TFieldIdEnum setField = getSetField(); + if (setField != null) { + hcb.append(setField.getThriftFieldId()); + Object value = getFieldValue(); + if (value instanceof org.apache.thrift.TEnum) { + hcb.append(((org.apache.thrift.TEnum)getFieldValue()).getValue()); + } else { + hcb.append(value); + } + } + return hcb.toHashCode(); + } + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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); + } + } + + +} diff --git a/jstorm-client/src/main/java/backtype/storm/generated/DRPCExecutionException.java b/jstorm-client/src/main/java/backtype/storm/generated/DRPCExecutionException.java index 2bbee0949..45016e4dc 100644 --- a/jstorm-client/src/main/java/backtype/storm/generated/DRPCExecutionException.java +++ b/jstorm-client/src/main/java/backtype/storm/generated/DRPCExecutionException.java @@ -1,328 +1,381 @@ -/** - * Autogenerated by Thrift Compiler (0.7.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - */ -package backtype.storm.generated; - -import org.apache.commons.lang.builder.HashCodeBuilder; -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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class DRPCExecutionException extends Exception implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - 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 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 byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // MSG - return MSG; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - 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); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DRPCExecutionException.class, metaDataMap); - } - - public DRPCExecutionException() { - } - - public DRPCExecutionException( - String msg) - { - this(); - this.msg = msg; - } - - /** - * Performs a deep copy on other. - */ - public DRPCExecutionException(DRPCExecutionException other) { - if (other.is_set_msg()) { - this.msg = other.msg; - } - } - - public DRPCExecutionException deepCopy() { - return new DRPCExecutionException(this); - } - - @Override - public void clear() { - this.msg = null; - } - - public String get_msg() { - return this.msg; - } - - public void set_msg(String msg) { - this.msg = msg; - } - - public void unset_msg() { - this.msg = null; - } - - /** Returns true if field msg is set (has been assigned a value) and false otherwise */ - public boolean is_set_msg() { - return this.msg != null; - } - - public void set_msg_isSet(boolean value) { - if (!value) { - this.msg = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case MSG: - if (value == null) { - unset_msg(); - } else { - set_msg((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case MSG: - return get_msg(); - - } - throw new 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(); - } - - switch (field) { - case MSG: - return is_set_msg(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof DRPCExecutionException) - return this.equals((DRPCExecutionException)that); - return false; - } - - public boolean equals(DRPCExecutionException that) { - if (that == null) - return false; - - boolean this_present_msg = true && this.is_set_msg(); - boolean that_present_msg = true && that.is_set_msg(); - if (this_present_msg || that_present_msg) { - if (!(this_present_msg && that_present_msg)) - return false; - if (!this.msg.equals(that.msg)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_msg = true && (is_set_msg()); - builder.append(present_msg); - if (present_msg) - builder.append(msg); - - return builder.toHashCode(); - } - - public int compareTo(DRPCExecutionException other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - DRPCExecutionException typedOther = (DRPCExecutionException)other; - - lastComparison = Boolean.valueOf(is_set_msg()).compareTo(typedOther.is_set_msg()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_msg()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.msg, typedOther.msg); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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(); - } - - 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(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("DRPCExecutionException("); - boolean first = true; - - sb.append("msg:"); - if (this.msg == null) { - sb.append("null"); - } else { - sb.append(this.msg); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!is_set_msg()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'msg' is unset! Struct:" + toString()); - } - - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - -} - +/** + * Autogenerated by Thrift Compiler (0.8.0) + * + * 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 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class DRPCExecutionException extends Exception implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new DRPCExecutionExceptionStandardSchemeFactory()); + schemes.put(TupleScheme.class, new DRPCExecutionExceptionTupleSchemeFactory()); + } + + private 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 byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // MSG + return MSG; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + 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); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DRPCExecutionException.class, metaDataMap); + } + + public DRPCExecutionException() { + } + + public DRPCExecutionException( + String msg) + { + this(); + this.msg = msg; + } + + /** + * Performs a deep copy on other. + */ + public DRPCExecutionException(DRPCExecutionException other) { + if (other.is_set_msg()) { + this.msg = other.msg; + } + } + + public DRPCExecutionException deepCopy() { + return new DRPCExecutionException(this); + } + + @Override + public void clear() { + this.msg = null; + } + + public String get_msg() { + return this.msg; + } + + public void set_msg(String msg) { + this.msg = msg; + } + + public void unset_msg() { + this.msg = null; + } + + /** Returns true if field msg is set (has been assigned a value) and false otherwise */ + public boolean is_set_msg() { + return this.msg != null; + } + + public void set_msg_isSet(boolean value) { + if (!value) { + this.msg = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case MSG: + if (value == null) { + unset_msg(); + } else { + set_msg((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case MSG: + return get_msg(); + + } + throw new 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(); + } + + switch (field) { + case MSG: + return is_set_msg(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof DRPCExecutionException) + return this.equals((DRPCExecutionException)that); + return false; + } + + public boolean equals(DRPCExecutionException that) { + if (that == null) + return false; + + boolean this_present_msg = true && this.is_set_msg(); + boolean that_present_msg = true && that.is_set_msg(); + if (this_present_msg || that_present_msg) { + if (!(this_present_msg && that_present_msg)) + return false; + if (!this.msg.equals(that.msg)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_msg = true && (is_set_msg()); + builder.append(present_msg); + if (present_msg) + builder.append(msg); + + return builder.toHashCode(); + } + + public int compareTo(DRPCExecutionException other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + DRPCExecutionException typedOther = (DRPCExecutionException)other; + + lastComparison = Boolean.valueOf(is_set_msg()).compareTo(typedOther.is_set_msg()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_msg()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.msg, typedOther.msg); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("DRPCExecutionException("); + boolean first = true; + + sb.append("msg:"); + if (this.msg == null) { + sb.append("null"); + } else { + sb.append(this.msg); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!is_set_msg()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'msg' is unset! Struct:" + toString()); + } + + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 DRPCExecutionExceptionStandardSchemeFactory implements SchemeFactory { + public DRPCExecutionExceptionStandardScheme getScheme() { + return new DRPCExecutionExceptionStandardScheme(); + } + } + + private static class DRPCExecutionExceptionStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, DRPCExecutionException 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, DRPCExecutionException 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 DRPCExecutionExceptionTupleSchemeFactory implements SchemeFactory { + public DRPCExecutionExceptionTupleScheme getScheme() { + return new DRPCExecutionExceptionTupleScheme(); + } + } + + private static class DRPCExecutionExceptionTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, DRPCExecutionException struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.msg); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, DRPCExecutionException struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.msg = iprot.readString(); + struct.set_msg_isSet(true); + } + } + +} + diff --git a/jstorm-client/src/main/java/backtype/storm/generated/DRPCRequest.java b/jstorm-client/src/main/java/backtype/storm/generated/DRPCRequest.java index a2fcc6b72..ffb070814 100644 --- a/jstorm-client/src/main/java/backtype/storm/generated/DRPCRequest.java +++ b/jstorm-client/src/main/java/backtype/storm/generated/DRPCRequest.java @@ -1,425 +1,482 @@ -/** - * Autogenerated by Thrift Compiler (0.7.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - */ -package backtype.storm.generated; - -import org.apache.commons.lang.builder.HashCodeBuilder; -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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class DRPCRequest implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - 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 String func_args; // required - private 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 byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // FUNC_ARGS - return FUNC_ARGS; - case 2: // REQUEST_ID - return REQUEST_ID; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - 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); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DRPCRequest.class, metaDataMap); - } - - public DRPCRequest() { - } - - public DRPCRequest( - String func_args, - String request_id) - { - this(); - this.func_args = func_args; - this.request_id = request_id; - } - - /** - * Performs a deep copy on other. - */ - public DRPCRequest(DRPCRequest other) { - if (other.is_set_func_args()) { - this.func_args = other.func_args; - } - if (other.is_set_request_id()) { - this.request_id = other.request_id; - } - } - - public DRPCRequest deepCopy() { - return new DRPCRequest(this); - } - - @Override - public void clear() { - this.func_args = null; - this.request_id = null; - } - - public String get_func_args() { - return this.func_args; - } - - public void set_func_args(String func_args) { - this.func_args = func_args; - } - - public void unset_func_args() { - this.func_args = null; - } - - /** Returns true if field func_args is set (has been assigned a value) and false otherwise */ - public boolean is_set_func_args() { - return this.func_args != null; - } - - public void set_func_args_isSet(boolean value) { - if (!value) { - this.func_args = null; - } - } - - public String get_request_id() { - return this.request_id; - } - - public void set_request_id(String request_id) { - this.request_id = request_id; - } - - public void unset_request_id() { - this.request_id = null; - } - - /** Returns true if field request_id is set (has been assigned a value) and false otherwise */ - public boolean is_set_request_id() { - return this.request_id != null; - } - - public void set_request_id_isSet(boolean value) { - if (!value) { - this.request_id = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case FUNC_ARGS: - if (value == null) { - unset_func_args(); - } else { - set_func_args((String)value); - } - break; - - case REQUEST_ID: - if (value == null) { - unset_request_id(); - } else { - set_request_id((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case FUNC_ARGS: - return get_func_args(); - - case REQUEST_ID: - return get_request_id(); - - } - throw new 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(); - } - - switch (field) { - case FUNC_ARGS: - return is_set_func_args(); - case REQUEST_ID: - return is_set_request_id(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof DRPCRequest) - return this.equals((DRPCRequest)that); - return false; - } - - public boolean equals(DRPCRequest that) { - if (that == null) - return false; - - boolean this_present_func_args = true && this.is_set_func_args(); - boolean that_present_func_args = true && that.is_set_func_args(); - if (this_present_func_args || that_present_func_args) { - if (!(this_present_func_args && that_present_func_args)) - return false; - if (!this.func_args.equals(that.func_args)) - return false; - } - - boolean this_present_request_id = true && this.is_set_request_id(); - boolean that_present_request_id = true && that.is_set_request_id(); - if (this_present_request_id || that_present_request_id) { - if (!(this_present_request_id && that_present_request_id)) - return false; - if (!this.request_id.equals(that.request_id)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_func_args = true && (is_set_func_args()); - builder.append(present_func_args); - if (present_func_args) - builder.append(func_args); - - boolean present_request_id = true && (is_set_request_id()); - builder.append(present_request_id); - if (present_request_id) - builder.append(request_id); - - return builder.toHashCode(); - } - - public int compareTo(DRPCRequest other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - DRPCRequest typedOther = (DRPCRequest)other; - - lastComparison = Boolean.valueOf(is_set_func_args()).compareTo(typedOther.is_set_func_args()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_func_args()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.func_args, typedOther.func_args); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_request_id()).compareTo(typedOther.is_set_request_id()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_request_id()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request_id, typedOther.request_id); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // FUNC_ARGS - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.func_args = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // REQUEST_ID - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.request_id = 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.func_args != null) { - oprot.writeFieldBegin(FUNC_ARGS_FIELD_DESC); - oprot.writeString(this.func_args); - oprot.writeFieldEnd(); - } - if (this.request_id != null) { - oprot.writeFieldBegin(REQUEST_ID_FIELD_DESC); - oprot.writeString(this.request_id); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("DRPCRequest("); - boolean first = true; - - sb.append("func_args:"); - if (this.func_args == null) { - sb.append("null"); - } else { - sb.append(this.func_args); - } - first = false; - if (!first) sb.append(", "); - sb.append("request_id:"); - if (this.request_id == null) { - sb.append("null"); - } else { - sb.append(this.request_id); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!is_set_func_args()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'func_args' is unset! Struct:" + toString()); - } - - if (!is_set_request_id()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'request_id' is unset! Struct:" + toString()); - } - - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - -} - +/** + * Autogenerated by Thrift Compiler (0.8.0) + * + * 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 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class DRPCRequest implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + 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, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new DRPCRequestStandardSchemeFactory()); + schemes.put(TupleScheme.class, new DRPCRequestTupleSchemeFactory()); + } + + private String func_args; // required + private 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 byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // FUNC_ARGS + return FUNC_ARGS; + case 2: // REQUEST_ID + return REQUEST_ID; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + 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); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DRPCRequest.class, metaDataMap); + } + + public DRPCRequest() { + } + + public DRPCRequest( + String func_args, + String request_id) + { + this(); + this.func_args = func_args; + this.request_id = request_id; + } + + /** + * Performs a deep copy on other. + */ + public DRPCRequest(DRPCRequest other) { + if (other.is_set_func_args()) { + this.func_args = other.func_args; + } + if (other.is_set_request_id()) { + this.request_id = other.request_id; + } + } + + public DRPCRequest deepCopy() { + return new DRPCRequest(this); + } + + @Override + public void clear() { + this.func_args = null; + this.request_id = null; + } + + public String get_func_args() { + return this.func_args; + } + + public void set_func_args(String func_args) { + this.func_args = func_args; + } + + public void unset_func_args() { + this.func_args = null; + } + + /** Returns true if field func_args is set (has been assigned a value) and false otherwise */ + public boolean is_set_func_args() { + return this.func_args != null; + } + + public void set_func_args_isSet(boolean value) { + if (!value) { + this.func_args = null; + } + } + + public String get_request_id() { + return this.request_id; + } + + public void set_request_id(String request_id) { + this.request_id = request_id; + } + + public void unset_request_id() { + this.request_id = null; + } + + /** Returns true if field request_id is set (has been assigned a value) and false otherwise */ + public boolean is_set_request_id() { + return this.request_id != null; + } + + public void set_request_id_isSet(boolean value) { + if (!value) { + this.request_id = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case FUNC_ARGS: + if (value == null) { + unset_func_args(); + } else { + set_func_args((String)value); + } + break; + + case REQUEST_ID: + if (value == null) { + unset_request_id(); + } else { + set_request_id((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case FUNC_ARGS: + return get_func_args(); + + case REQUEST_ID: + return get_request_id(); + + } + throw new 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(); + } + + switch (field) { + case FUNC_ARGS: + return is_set_func_args(); + case REQUEST_ID: + return is_set_request_id(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof DRPCRequest) + return this.equals((DRPCRequest)that); + return false; + } + + public boolean equals(DRPCRequest that) { + if (that == null) + return false; + + boolean this_present_func_args = true && this.is_set_func_args(); + boolean that_present_func_args = true && that.is_set_func_args(); + if (this_present_func_args || that_present_func_args) { + if (!(this_present_func_args && that_present_func_args)) + return false; + if (!this.func_args.equals(that.func_args)) + return false; + } + + boolean this_present_request_id = true && this.is_set_request_id(); + boolean that_present_request_id = true && that.is_set_request_id(); + if (this_present_request_id || that_present_request_id) { + if (!(this_present_request_id && that_present_request_id)) + return false; + if (!this.request_id.equals(that.request_id)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_func_args = true && (is_set_func_args()); + builder.append(present_func_args); + if (present_func_args) + builder.append(func_args); + + boolean present_request_id = true && (is_set_request_id()); + builder.append(present_request_id); + if (present_request_id) + builder.append(request_id); + + return builder.toHashCode(); + } + + public int compareTo(DRPCRequest other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + DRPCRequest typedOther = (DRPCRequest)other; + + lastComparison = Boolean.valueOf(is_set_func_args()).compareTo(typedOther.is_set_func_args()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_func_args()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.func_args, typedOther.func_args); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_request_id()).compareTo(typedOther.is_set_request_id()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_request_id()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request_id, typedOther.request_id); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("DRPCRequest("); + boolean first = true; + + sb.append("func_args:"); + if (this.func_args == null) { + sb.append("null"); + } else { + sb.append(this.func_args); + } + first = false; + if (!first) sb.append(", "); + sb.append("request_id:"); + if (this.request_id == null) { + sb.append("null"); + } else { + sb.append(this.request_id); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!is_set_func_args()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'func_args' is unset! Struct:" + toString()); + } + + if (!is_set_request_id()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'request_id' is unset! Struct:" + toString()); + } + + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 DRPCRequestStandardSchemeFactory implements SchemeFactory { + public DRPCRequestStandardScheme getScheme() { + return new DRPCRequestStandardScheme(); + } + } + + private static class DRPCRequestStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, DRPCRequest 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: // FUNC_ARGS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.func_args = iprot.readString(); + struct.set_func_args_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // REQUEST_ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.request_id = iprot.readString(); + struct.set_request_id_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, DRPCRequest struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.func_args != null) { + oprot.writeFieldBegin(FUNC_ARGS_FIELD_DESC); + oprot.writeString(struct.func_args); + oprot.writeFieldEnd(); + } + if (struct.request_id != null) { + oprot.writeFieldBegin(REQUEST_ID_FIELD_DESC); + oprot.writeString(struct.request_id); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class DRPCRequestTupleSchemeFactory implements SchemeFactory { + public DRPCRequestTupleScheme getScheme() { + return new DRPCRequestTupleScheme(); + } + } + + private static class DRPCRequestTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, DRPCRequest struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (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; + struct.func_args = iprot.readString(); + struct.set_func_args_isSet(true); + struct.request_id = iprot.readString(); + struct.set_request_id_isSet(true); + } + } + +} + diff --git a/jstorm-client/src/main/java/backtype/storm/generated/DistributedRPC.java b/jstorm-client/src/main/java/backtype/storm/generated/DistributedRPC.java index 48d7c9c69..a5171079f 100644 --- a/jstorm-client/src/main/java/backtype/storm/generated/DistributedRPC.java +++ b/jstorm-client/src/main/java/backtype/storm/generated/DistributedRPC.java @@ -1,964 +1,1108 @@ -/** - * Autogenerated by Thrift Compiler (0.7.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - */ -package backtype.storm.generated; - -import org.apache.commons.lang.builder.HashCodeBuilder; -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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class DistributedRPC { - - public interface Iface { - - public String execute(String functionName, String funcArgs) throws DRPCExecutionException, org.apache.thrift.TException; - - } - - public interface AsyncIface { - - public void execute(String functionName, String funcArgs, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - } - - public static class Client extends org.apache.thrift.TServiceClient implements Iface { - public static class Factory implements org.apache.thrift.TServiceClientFactory { - public Factory() {} - public Client getClient(org.apache.thrift.protocol.TProtocol prot) { - return new Client(prot); - } - public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { - return new Client(iprot, oprot); - } - } - - public Client(org.apache.thrift.protocol.TProtocol prot) - { - super(prot, prot); - } - - public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { - super(iprot, oprot); - } - - public String execute(String functionName, String funcArgs) throws DRPCExecutionException, org.apache.thrift.TException - { - send_execute(functionName, funcArgs); - return recv_execute(); - } - - public void send_execute(String functionName, String funcArgs) throws org.apache.thrift.TException - { - execute_args args = new execute_args(); - args.set_functionName(functionName); - args.set_funcArgs(funcArgs); - sendBase("execute", args); - } - - public String recv_execute() throws DRPCExecutionException, org.apache.thrift.TException - { - execute_result result = new execute_result(); - receiveBase(result, "execute"); - if (result.is_set_success()) { - return result.success; - } - if (result.e != null) { - throw result.e; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "execute failed: unknown result"); - } - - } - public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { - public static class Factory implements org.apache.thrift.async.TAsyncClientFactory { - private org.apache.thrift.async.TAsyncClientManager clientManager; - private org.apache.thrift.protocol.TProtocolFactory protocolFactory; - public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) { - this.clientManager = clientManager; - this.protocolFactory = protocolFactory; - } - public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) { - return new AsyncClient(protocolFactory, clientManager, transport); - } - } - - public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) { - super(protocolFactory, clientManager, transport); - } - - public void execute(String functionName, String funcArgs, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - execute_call method_call = new execute_call(functionName, funcArgs, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class execute_call extends org.apache.thrift.async.TAsyncMethodCall { - private String functionName; - private String funcArgs; - public execute_call(String functionName, String funcArgs, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.functionName = functionName; - this.funcArgs = funcArgs; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("execute", org.apache.thrift.protocol.TMessageType.CALL, 0)); - execute_args args = new execute_args(); - args.set_functionName(functionName); - args.set_funcArgs(funcArgs); - args.write(prot); - prot.writeMessageEnd(); - } - - public String getResult() throws DRPCExecutionException, org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_execute(); - } - } - - } - - public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor { - private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName()); - public Processor(I iface) { - super(iface, getProcessMap(new HashMap>())); - } - - protected Processor(I iface, Map> processMap) { - super(iface, getProcessMap(processMap)); - } - - private static Map> getProcessMap(Map> processMap) { - processMap.put("execute", new execute()); - return processMap; - } - - private static class execute extends org.apache.thrift.ProcessFunction { - public execute() { - super("execute"); - } - - protected execute_args getEmptyArgsInstance() { - return new execute_args(); - } - - protected execute_result getResult(I iface, execute_args args) throws org.apache.thrift.TException { - execute_result result = new execute_result(); - try { - result.success = iface.execute(args.functionName, args.funcArgs); - } catch (DRPCExecutionException e) { - result.e = e; - } - return result; - } - } - - } - - public static class execute_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("execute_args"); - - private static final org.apache.thrift.protocol.TField FUNCTION_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("functionName", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField FUNC_ARGS_FIELD_DESC = new org.apache.thrift.protocol.TField("funcArgs", org.apache.thrift.protocol.TType.STRING, (short)2); - - private String functionName; // required - private String funcArgs; // 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 { - FUNCTION_NAME((short)1, "functionName"), - FUNC_ARGS((short)2, "funcArgs"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // FUNCTION_NAME - return FUNCTION_NAME; - case 2: // FUNC_ARGS - return FUNC_ARGS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.FUNCTION_NAME, new org.apache.thrift.meta_data.FieldMetaData("functionName", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.FUNC_ARGS, new org.apache.thrift.meta_data.FieldMetaData("funcArgs", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(execute_args.class, metaDataMap); - } - - public execute_args() { - } - - public execute_args( - String functionName, - String funcArgs) - { - this(); - this.functionName = functionName; - this.funcArgs = funcArgs; - } - - /** - * Performs a deep copy on other. - */ - public execute_args(execute_args other) { - if (other.is_set_functionName()) { - this.functionName = other.functionName; - } - if (other.is_set_funcArgs()) { - this.funcArgs = other.funcArgs; - } - } - - public execute_args deepCopy() { - return new execute_args(this); - } - - @Override - public void clear() { - this.functionName = null; - this.funcArgs = null; - } - - public String get_functionName() { - return this.functionName; - } - - public void set_functionName(String functionName) { - this.functionName = functionName; - } - - public void unset_functionName() { - this.functionName = null; - } - - /** Returns true if field functionName is set (has been assigned a value) and false otherwise */ - public boolean is_set_functionName() { - return this.functionName != null; - } - - public void set_functionName_isSet(boolean value) { - if (!value) { - this.functionName = null; - } - } - - public String get_funcArgs() { - return this.funcArgs; - } - - public void set_funcArgs(String funcArgs) { - this.funcArgs = funcArgs; - } - - public void unset_funcArgs() { - this.funcArgs = null; - } - - /** Returns true if field funcArgs is set (has been assigned a value) and false otherwise */ - public boolean is_set_funcArgs() { - return this.funcArgs != null; - } - - public void set_funcArgs_isSet(boolean value) { - if (!value) { - this.funcArgs = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case FUNCTION_NAME: - if (value == null) { - unset_functionName(); - } else { - set_functionName((String)value); - } - break; - - case FUNC_ARGS: - if (value == null) { - unset_funcArgs(); - } else { - set_funcArgs((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case FUNCTION_NAME: - return get_functionName(); - - case FUNC_ARGS: - return get_funcArgs(); - - } - throw new 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(); - } - - switch (field) { - case FUNCTION_NAME: - return is_set_functionName(); - case FUNC_ARGS: - return is_set_funcArgs(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof execute_args) - return this.equals((execute_args)that); - return false; - } - - public boolean equals(execute_args that) { - if (that == null) - return false; - - boolean this_present_functionName = true && this.is_set_functionName(); - boolean that_present_functionName = true && that.is_set_functionName(); - if (this_present_functionName || that_present_functionName) { - if (!(this_present_functionName && that_present_functionName)) - return false; - if (!this.functionName.equals(that.functionName)) - return false; - } - - boolean this_present_funcArgs = true && this.is_set_funcArgs(); - boolean that_present_funcArgs = true && that.is_set_funcArgs(); - if (this_present_funcArgs || that_present_funcArgs) { - if (!(this_present_funcArgs && that_present_funcArgs)) - return false; - if (!this.funcArgs.equals(that.funcArgs)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_functionName = true && (is_set_functionName()); - builder.append(present_functionName); - if (present_functionName) - builder.append(functionName); - - boolean present_funcArgs = true && (is_set_funcArgs()); - builder.append(present_funcArgs); - if (present_funcArgs) - builder.append(funcArgs); - - return builder.toHashCode(); - } - - public int compareTo(execute_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - execute_args typedOther = (execute_args)other; - - lastComparison = Boolean.valueOf(is_set_functionName()).compareTo(typedOther.is_set_functionName()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_functionName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.functionName, typedOther.functionName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_funcArgs()).compareTo(typedOther.is_set_funcArgs()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_funcArgs()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.funcArgs, typedOther.funcArgs); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // FUNCTION_NAME - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.functionName = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // FUNC_ARGS - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.funcArgs = 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.functionName != null) { - oprot.writeFieldBegin(FUNCTION_NAME_FIELD_DESC); - oprot.writeString(this.functionName); - oprot.writeFieldEnd(); - } - if (this.funcArgs != null) { - oprot.writeFieldBegin(FUNC_ARGS_FIELD_DESC); - oprot.writeString(this.funcArgs); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("execute_args("); - boolean first = true; - - sb.append("functionName:"); - if (this.functionName == null) { - sb.append("null"); - } else { - sb.append(this.functionName); - } - first = false; - if (!first) sb.append(", "); - sb.append("funcArgs:"); - if (this.funcArgs == null) { - sb.append("null"); - } else { - sb.append(this.funcArgs); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - } - - public static class execute_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("execute_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); - private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private String success; // required - private DRPCExecutionException e; // 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 { - SUCCESS((short)0, "success"), - E((short)1, "e"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - case 1: // E - return E; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(execute_result.class, metaDataMap); - } - - public execute_result() { - } - - public execute_result( - String success, - DRPCExecutionException e) - { - this(); - this.success = success; - this.e = e; - } - - /** - * Performs a deep copy on other. - */ - public execute_result(execute_result other) { - if (other.is_set_success()) { - this.success = other.success; - } - if (other.is_set_e()) { - this.e = new DRPCExecutionException(other.e); - } - } - - public execute_result deepCopy() { - return new execute_result(this); - } - - @Override - public void clear() { - this.success = null; - this.e = null; - } - - public String get_success() { - return this.success; - } - - public void set_success(String success) { - this.success = success; - } - - public void unset_success() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean is_set_success() { - return this.success != null; - } - - public void set_success_isSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public DRPCExecutionException get_e() { - return this.e; - } - - public void set_e(DRPCExecutionException e) { - this.e = e; - } - - public void unset_e() { - this.e = null; - } - - /** Returns true if field e is set (has been assigned a value) and false otherwise */ - public boolean is_set_e() { - return this.e != null; - } - - public void set_e_isSet(boolean value) { - if (!value) { - this.e = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unset_success(); - } else { - set_success((String)value); - } - break; - - case E: - if (value == null) { - unset_e(); - } else { - set_e((DRPCExecutionException)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return get_success(); - - case E: - return get_e(); - - } - throw new 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(); - } - - switch (field) { - case SUCCESS: - return is_set_success(); - case E: - return is_set_e(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof execute_result) - return this.equals((execute_result)that); - return false; - } - - public boolean equals(execute_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.is_set_success(); - boolean that_present_success = true && that.is_set_success(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - boolean this_present_e = true && this.is_set_e(); - boolean that_present_e = true && that.is_set_e(); - if (this_present_e || that_present_e) { - if (!(this_present_e && that_present_e)) - return false; - if (!this.e.equals(that.e)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_success = true && (is_set_success()); - builder.append(present_success); - if (present_success) - builder.append(success); - - boolean present_e = true && (is_set_e()); - builder.append(present_e); - if (present_e) - builder.append(e); - - return builder.toHashCode(); - } - - public int compareTo(execute_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - execute_result typedOther = (execute_result)other; - - lastComparison = Boolean.valueOf(is_set_success()).compareTo(typedOther.is_set_success()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_success()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_e()).compareTo(typedOther.is_set_e()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_e()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.success = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // E - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.e = new DRPCExecutionException(); - this.e.read(iprot); - } 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.is_set_success()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeString(this.success); - oprot.writeFieldEnd(); - } else if (this.is_set_e()) { - oprot.writeFieldBegin(E_FIELD_DESC); - this.e.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("execute_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - if (!first) sb.append(", "); - sb.append("e:"); - if (this.e == null) { - sb.append("null"); - } else { - sb.append(this.e); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - } - -} +/** + * Autogenerated by Thrift Compiler (0.8.0) + * + * 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 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class DistributedRPC { + + public interface Iface { + + public String execute(String functionName, String funcArgs) throws DRPCExecutionException, org.apache.thrift.TException; + + } + + public interface AsyncIface { + + public void execute(String functionName, String funcArgs, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + } + + public static class Client extends org.apache.thrift.TServiceClient implements Iface { + public static class Factory implements org.apache.thrift.TServiceClientFactory { + public Factory() {} + public Client getClient(org.apache.thrift.protocol.TProtocol prot) { + return new Client(prot); + } + public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { + return new Client(iprot, oprot); + } + } + + public Client(org.apache.thrift.protocol.TProtocol prot) + { + super(prot, prot); + } + + public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { + super(iprot, oprot); + } + + public String execute(String functionName, String funcArgs) throws DRPCExecutionException, org.apache.thrift.TException + { + send_execute(functionName, funcArgs); + return recv_execute(); + } + + public void send_execute(String functionName, String funcArgs) throws org.apache.thrift.TException + { + execute_args args = new execute_args(); + args.set_functionName(functionName); + args.set_funcArgs(funcArgs); + sendBase("execute", args); + } + + public String recv_execute() throws DRPCExecutionException, org.apache.thrift.TException + { + execute_result result = new execute_result(); + receiveBase(result, "execute"); + if (result.is_set_success()) { + return result.success; + } + if (result.e != null) { + throw result.e; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "execute failed: unknown result"); + } + + } + public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { + public static class Factory implements org.apache.thrift.async.TAsyncClientFactory { + private org.apache.thrift.async.TAsyncClientManager clientManager; + private org.apache.thrift.protocol.TProtocolFactory protocolFactory; + public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) { + this.clientManager = clientManager; + this.protocolFactory = protocolFactory; + } + public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) { + return new AsyncClient(protocolFactory, clientManager, transport); + } + } + + public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) { + super(protocolFactory, clientManager, transport); + } + + public void execute(String functionName, String funcArgs, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + execute_call method_call = new execute_call(functionName, funcArgs, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class execute_call extends org.apache.thrift.async.TAsyncMethodCall { + private String functionName; + private String funcArgs; + public execute_call(String functionName, String funcArgs, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.functionName = functionName; + this.funcArgs = funcArgs; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("execute", org.apache.thrift.protocol.TMessageType.CALL, 0)); + execute_args args = new execute_args(); + args.set_functionName(functionName); + args.set_funcArgs(funcArgs); + args.write(prot); + prot.writeMessageEnd(); + } + + public String getResult() throws DRPCExecutionException, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_execute(); + } + } + + } + + public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor { + private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName()); + public Processor(I iface) { + super(iface, getProcessMap(new HashMap>())); + } + + protected Processor(I iface, Map> processMap) { + super(iface, getProcessMap(processMap)); + } + + private static Map> getProcessMap(Map> processMap) { + processMap.put("execute", new execute()); + return processMap; + } + + private static class execute extends org.apache.thrift.ProcessFunction { + public execute() { + super("execute"); + } + + protected execute_args getEmptyArgsInstance() { + return new execute_args(); + } + + protected execute_result getResult(I iface, execute_args args) throws org.apache.thrift.TException { + execute_result result = new execute_result(); + try { + result.success = iface.execute(args.functionName, args.funcArgs); + } catch (DRPCExecutionException e) { + result.e = e; + } + return result; + } + } + + } + + public static class execute_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("execute_args"); + + private static final org.apache.thrift.protocol.TField FUNCTION_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("functionName", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField FUNC_ARGS_FIELD_DESC = new org.apache.thrift.protocol.TField("funcArgs", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new execute_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new execute_argsTupleSchemeFactory()); + } + + private String functionName; // required + private String funcArgs; // 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 { + FUNCTION_NAME((short)1, "functionName"), + FUNC_ARGS((short)2, "funcArgs"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // FUNCTION_NAME + return FUNCTION_NAME; + case 2: // FUNC_ARGS + return FUNC_ARGS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.FUNCTION_NAME, new org.apache.thrift.meta_data.FieldMetaData("functionName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.FUNC_ARGS, new org.apache.thrift.meta_data.FieldMetaData("funcArgs", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(execute_args.class, metaDataMap); + } + + public execute_args() { + } + + public execute_args( + String functionName, + String funcArgs) + { + this(); + this.functionName = functionName; + this.funcArgs = funcArgs; + } + + /** + * Performs a deep copy on other. + */ + public execute_args(execute_args other) { + if (other.is_set_functionName()) { + this.functionName = other.functionName; + } + if (other.is_set_funcArgs()) { + this.funcArgs = other.funcArgs; + } + } + + public execute_args deepCopy() { + return new execute_args(this); + } + + @Override + public void clear() { + this.functionName = null; + this.funcArgs = null; + } + + public String get_functionName() { + return this.functionName; + } + + public void set_functionName(String functionName) { + this.functionName = functionName; + } + + public void unset_functionName() { + this.functionName = null; + } + + /** Returns true if field functionName is set (has been assigned a value) and false otherwise */ + public boolean is_set_functionName() { + return this.functionName != null; + } + + public void set_functionName_isSet(boolean value) { + if (!value) { + this.functionName = null; + } + } + + public String get_funcArgs() { + return this.funcArgs; + } + + public void set_funcArgs(String funcArgs) { + this.funcArgs = funcArgs; + } + + public void unset_funcArgs() { + this.funcArgs = null; + } + + /** Returns true if field funcArgs is set (has been assigned a value) and false otherwise */ + public boolean is_set_funcArgs() { + return this.funcArgs != null; + } + + public void set_funcArgs_isSet(boolean value) { + if (!value) { + this.funcArgs = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case FUNCTION_NAME: + if (value == null) { + unset_functionName(); + } else { + set_functionName((String)value); + } + break; + + case FUNC_ARGS: + if (value == null) { + unset_funcArgs(); + } else { + set_funcArgs((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case FUNCTION_NAME: + return get_functionName(); + + case FUNC_ARGS: + return get_funcArgs(); + + } + throw new 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(); + } + + switch (field) { + case FUNCTION_NAME: + return is_set_functionName(); + case FUNC_ARGS: + return is_set_funcArgs(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof execute_args) + return this.equals((execute_args)that); + return false; + } + + public boolean equals(execute_args that) { + if (that == null) + return false; + + boolean this_present_functionName = true && this.is_set_functionName(); + boolean that_present_functionName = true && that.is_set_functionName(); + if (this_present_functionName || that_present_functionName) { + if (!(this_present_functionName && that_present_functionName)) + return false; + if (!this.functionName.equals(that.functionName)) + return false; + } + + boolean this_present_funcArgs = true && this.is_set_funcArgs(); + boolean that_present_funcArgs = true && that.is_set_funcArgs(); + if (this_present_funcArgs || that_present_funcArgs) { + if (!(this_present_funcArgs && that_present_funcArgs)) + return false; + if (!this.funcArgs.equals(that.funcArgs)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_functionName = true && (is_set_functionName()); + builder.append(present_functionName); + if (present_functionName) + builder.append(functionName); + + boolean present_funcArgs = true && (is_set_funcArgs()); + builder.append(present_funcArgs); + if (present_funcArgs) + builder.append(funcArgs); + + return builder.toHashCode(); + } + + public int compareTo(execute_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + execute_args typedOther = (execute_args)other; + + lastComparison = Boolean.valueOf(is_set_functionName()).compareTo(typedOther.is_set_functionName()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_functionName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.functionName, typedOther.functionName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_funcArgs()).compareTo(typedOther.is_set_funcArgs()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_funcArgs()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.funcArgs, typedOther.funcArgs); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("execute_args("); + boolean first = true; + + sb.append("functionName:"); + if (this.functionName == null) { + sb.append("null"); + } else { + sb.append(this.functionName); + } + first = false; + if (!first) sb.append(", "); + sb.append("funcArgs:"); + if (this.funcArgs == null) { + sb.append("null"); + } else { + sb.append(this.funcArgs); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 execute_argsStandardSchemeFactory implements SchemeFactory { + public execute_argsStandardScheme getScheme() { + return new execute_argsStandardScheme(); + } + } + + private static class execute_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, execute_args 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: // FUNCTION_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.functionName = iprot.readString(); + struct.set_functionName_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // FUNC_ARGS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.funcArgs = iprot.readString(); + struct.set_funcArgs_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, execute_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.functionName != null) { + oprot.writeFieldBegin(FUNCTION_NAME_FIELD_DESC); + oprot.writeString(struct.functionName); + oprot.writeFieldEnd(); + } + if (struct.funcArgs != null) { + oprot.writeFieldBegin(FUNC_ARGS_FIELD_DESC); + oprot.writeString(struct.funcArgs); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class execute_argsTupleSchemeFactory implements SchemeFactory { + public execute_argsTupleScheme getScheme() { + return new execute_argsTupleScheme(); + } + } + + private static class execute_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, execute_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.is_set_functionName()) { + optionals.set(0); + } + if (struct.is_set_funcArgs()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.is_set_functionName()) { + oprot.writeString(struct.functionName); + } + if (struct.is_set_funcArgs()) { + oprot.writeString(struct.funcArgs); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, execute_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.functionName = iprot.readString(); + struct.set_functionName_isSet(true); + } + if (incoming.get(1)) { + struct.funcArgs = iprot.readString(); + struct.set_funcArgs_isSet(true); + } + } + } + + } + + public static class execute_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("execute_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); + private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new execute_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new execute_resultTupleSchemeFactory()); + } + + private String success; // required + private DRPCExecutionException e; // 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 { + SUCCESS((short)0, "success"), + E((short)1, "e"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + case 1: // E + return E; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(execute_result.class, metaDataMap); + } + + public execute_result() { + } + + public execute_result( + String success, + DRPCExecutionException e) + { + this(); + this.success = success; + this.e = e; + } + + /** + * Performs a deep copy on other. + */ + public execute_result(execute_result other) { + if (other.is_set_success()) { + this.success = other.success; + } + if (other.is_set_e()) { + this.e = new DRPCExecutionException(other.e); + } + } + + public execute_result deepCopy() { + return new execute_result(this); + } + + @Override + public void clear() { + this.success = null; + this.e = null; + } + + public String get_success() { + return this.success; + } + + public void set_success(String success) { + this.success = success; + } + + public void unset_success() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean is_set_success() { + return this.success != null; + } + + public void set_success_isSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public DRPCExecutionException get_e() { + return this.e; + } + + public void set_e(DRPCExecutionException e) { + this.e = e; + } + + public void unset_e() { + this.e = null; + } + + /** Returns true if field e is set (has been assigned a value) and false otherwise */ + public boolean is_set_e() { + return this.e != null; + } + + public void set_e_isSet(boolean value) { + if (!value) { + this.e = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unset_success(); + } else { + set_success((String)value); + } + break; + + case E: + if (value == null) { + unset_e(); + } else { + set_e((DRPCExecutionException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return get_success(); + + case E: + return get_e(); + + } + throw new 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(); + } + + switch (field) { + case SUCCESS: + return is_set_success(); + case E: + return is_set_e(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof execute_result) + return this.equals((execute_result)that); + return false; + } + + public boolean equals(execute_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.is_set_success(); + boolean that_present_success = true && that.is_set_success(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_e = true && this.is_set_e(); + boolean that_present_e = true && that.is_set_e(); + if (this_present_e || that_present_e) { + if (!(this_present_e && that_present_e)) + return false; + if (!this.e.equals(that.e)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_success = true && (is_set_success()); + builder.append(present_success); + if (present_success) + builder.append(success); + + boolean present_e = true && (is_set_e()); + builder.append(present_e); + if (present_e) + builder.append(e); + + return builder.toHashCode(); + } + + public int compareTo(execute_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + execute_result typedOther = (execute_result)other; + + lastComparison = Boolean.valueOf(is_set_success()).compareTo(typedOther.is_set_success()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_success()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_e()).compareTo(typedOther.is_set_e()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_e()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("execute_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("e:"); + if (this.e == null) { + sb.append("null"); + } else { + sb.append(this.e); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 execute_resultStandardSchemeFactory implements SchemeFactory { + public execute_resultStandardScheme getScheme() { + return new execute_resultStandardScheme(); + } + } + + private static class execute_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, execute_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.success = iprot.readString(); + struct.set_success_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // E + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.e = new DRPCExecutionException(); + struct.e.read(iprot); + struct.set_e_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, execute_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeString(struct.success); + oprot.writeFieldEnd(); + } + if (struct.e != null) { + oprot.writeFieldBegin(E_FIELD_DESC); + struct.e.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class execute_resultTupleSchemeFactory implements SchemeFactory { + public execute_resultTupleScheme getScheme() { + return new execute_resultTupleScheme(); + } + } + + private static class execute_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, execute_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.is_set_success()) { + optionals.set(0); + } + if (struct.is_set_e()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.is_set_success()) { + oprot.writeString(struct.success); + } + if (struct.is_set_e()) { + struct.e.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, execute_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = iprot.readString(); + struct.set_success_isSet(true); + } + if (incoming.get(1)) { + struct.e = new DRPCExecutionException(); + struct.e.read(iprot); + struct.set_e_isSet(true); + } + } + } + + } + +} diff --git a/jstorm-client/src/main/java/backtype/storm/generated/DistributedRPCInvocations.java b/jstorm-client/src/main/java/backtype/storm/generated/DistributedRPCInvocations.java index efb5091b3..d0f6bbd5c 100644 --- a/jstorm-client/src/main/java/backtype/storm/generated/DistributedRPCInvocations.java +++ b/jstorm-client/src/main/java/backtype/storm/generated/DistributedRPCInvocations.java @@ -1,2015 +1,2347 @@ -/** - * Autogenerated by Thrift Compiler (0.7.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - */ -package backtype.storm.generated; - -import org.apache.commons.lang.builder.HashCodeBuilder; -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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class DistributedRPCInvocations { - - public interface Iface { - - public void result(String id, String result) throws org.apache.thrift.TException; - - public DRPCRequest fetchRequest(String functionName) throws org.apache.thrift.TException; - - public void failRequest(String id) throws org.apache.thrift.TException; - - } - - public interface AsyncIface { - - public void result(String id, String result, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void fetchRequest(String functionName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void failRequest(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - } - - public static class Client extends org.apache.thrift.TServiceClient implements Iface { - public static class Factory implements org.apache.thrift.TServiceClientFactory { - public Factory() {} - public Client getClient(org.apache.thrift.protocol.TProtocol prot) { - return new Client(prot); - } - public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { - return new Client(iprot, oprot); - } - } - - public Client(org.apache.thrift.protocol.TProtocol prot) - { - super(prot, prot); - } - - public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { - super(iprot, oprot); - } - - public void result(String id, String result) throws org.apache.thrift.TException - { - send_result(id, result); - recv_result(); - } - - public void send_result(String id, String result) throws org.apache.thrift.TException - { - result_args args = new result_args(); - args.set_id(id); - args.set_result(result); - sendBase("result", args); - } - - public void recv_result() throws org.apache.thrift.TException - { - result_result result = new result_result(); - receiveBase(result, "result"); - return; - } - - public DRPCRequest fetchRequest(String functionName) throws org.apache.thrift.TException - { - send_fetchRequest(functionName); - return recv_fetchRequest(); - } - - public void send_fetchRequest(String functionName) throws org.apache.thrift.TException - { - fetchRequest_args args = new fetchRequest_args(); - args.set_functionName(functionName); - sendBase("fetchRequest", args); - } - - public DRPCRequest recv_fetchRequest() throws org.apache.thrift.TException - { - fetchRequest_result result = new fetchRequest_result(); - receiveBase(result, "fetchRequest"); - if (result.is_set_success()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "fetchRequest failed: unknown result"); - } - - public void failRequest(String id) throws org.apache.thrift.TException - { - send_failRequest(id); - recv_failRequest(); - } - - public void send_failRequest(String id) throws org.apache.thrift.TException - { - failRequest_args args = new failRequest_args(); - args.set_id(id); - sendBase("failRequest", args); - } - - public void recv_failRequest() throws org.apache.thrift.TException - { - failRequest_result result = new failRequest_result(); - receiveBase(result, "failRequest"); - return; - } - - } - public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { - public static class Factory implements org.apache.thrift.async.TAsyncClientFactory { - private org.apache.thrift.async.TAsyncClientManager clientManager; - private org.apache.thrift.protocol.TProtocolFactory protocolFactory; - public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) { - this.clientManager = clientManager; - this.protocolFactory = protocolFactory; - } - public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) { - return new AsyncClient(protocolFactory, clientManager, transport); - } - } - - public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) { - super(protocolFactory, clientManager, transport); - } - - public void result(String id, String result, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - result_call method_call = new result_call(id, result, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class result_call extends org.apache.thrift.async.TAsyncMethodCall { - private String id; - private String result; - public result_call(String id, String result, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.id = id; - this.result = result; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("result", org.apache.thrift.protocol.TMessageType.CALL, 0)); - result_args args = new result_args(); - args.set_id(id); - args.set_result(result); - args.write(prot); - prot.writeMessageEnd(); - } - - public void getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - (new Client(prot)).recv_result(); - } - } - - public void fetchRequest(String functionName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - fetchRequest_call method_call = new fetchRequest_call(functionName, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class fetchRequest_call extends org.apache.thrift.async.TAsyncMethodCall { - private String functionName; - public fetchRequest_call(String functionName, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.functionName = functionName; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("fetchRequest", org.apache.thrift.protocol.TMessageType.CALL, 0)); - fetchRequest_args args = new fetchRequest_args(); - args.set_functionName(functionName); - args.write(prot); - prot.writeMessageEnd(); - } - - public DRPCRequest getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_fetchRequest(); - } - } - - public void failRequest(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - failRequest_call method_call = new failRequest_call(id, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class failRequest_call extends org.apache.thrift.async.TAsyncMethodCall { - private String id; - public failRequest_call(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.id = id; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("failRequest", org.apache.thrift.protocol.TMessageType.CALL, 0)); - failRequest_args args = new failRequest_args(); - args.set_id(id); - args.write(prot); - prot.writeMessageEnd(); - } - - public void getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - (new Client(prot)).recv_failRequest(); - } - } - - } - - public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor { - private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName()); - public Processor(I iface) { - super(iface, getProcessMap(new HashMap>())); - } - - protected Processor(I iface, Map> processMap) { - super(iface, getProcessMap(processMap)); - } - - private static Map> getProcessMap(Map> processMap) { - processMap.put("result", new result()); - processMap.put("fetchRequest", new fetchRequest()); - processMap.put("failRequest", new failRequest()); - return processMap; - } - - private static class result extends org.apache.thrift.ProcessFunction { - public result() { - super("result"); - } - - protected result_args getEmptyArgsInstance() { - return new result_args(); - } - - protected result_result getResult(I iface, result_args args) throws org.apache.thrift.TException { - result_result result = new result_result(); - iface.result(args.id, args.result); - return result; - } - } - - private static class fetchRequest extends org.apache.thrift.ProcessFunction { - public fetchRequest() { - super("fetchRequest"); - } - - protected fetchRequest_args getEmptyArgsInstance() { - return new fetchRequest_args(); - } - - protected fetchRequest_result getResult(I iface, fetchRequest_args args) throws org.apache.thrift.TException { - fetchRequest_result result = new fetchRequest_result(); - result.success = iface.fetchRequest(args.functionName); - return result; - } - } - - private static class failRequest extends org.apache.thrift.ProcessFunction { - public failRequest() { - super("failRequest"); - } - - protected failRequest_args getEmptyArgsInstance() { - return new failRequest_args(); - } - - protected failRequest_result getResult(I iface, failRequest_args args) throws org.apache.thrift.TException { - failRequest_result result = new failRequest_result(); - iface.failRequest(args.id); - return result; - } - } - - } - - public static class result_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("result_args"); - - private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField RESULT_FIELD_DESC = new org.apache.thrift.protocol.TField("result", org.apache.thrift.protocol.TType.STRING, (short)2); - - private String id; // required - private String result; // 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 { - ID((short)1, "id"), - RESULT((short)2, "result"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // ID - return ID; - case 2: // RESULT - return RESULT; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.RESULT, new org.apache.thrift.meta_data.FieldMetaData("result", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(result_args.class, metaDataMap); - } - - public result_args() { - } - - public result_args( - String id, - String result) - { - this(); - this.id = id; - this.result = result; - } - - /** - * Performs a deep copy on other. - */ - public result_args(result_args other) { - if (other.is_set_id()) { - this.id = other.id; - } - if (other.is_set_result()) { - this.result = other.result; - } - } - - public result_args deepCopy() { - return new result_args(this); - } - - @Override - public void clear() { - this.id = null; - this.result = null; - } - - public String get_id() { - return this.id; - } - - public void set_id(String id) { - this.id = id; - } - - public void unset_id() { - this.id = null; - } - - /** Returns true if field id is set (has been assigned a value) and false otherwise */ - public boolean is_set_id() { - return this.id != null; - } - - public void set_id_isSet(boolean value) { - if (!value) { - this.id = null; - } - } - - public String get_result() { - return this.result; - } - - public void set_result(String result) { - this.result = result; - } - - public void unset_result() { - this.result = null; - } - - /** Returns true if field result is set (has been assigned a value) and false otherwise */ - public boolean is_set_result() { - return this.result != null; - } - - public void set_result_isSet(boolean value) { - if (!value) { - this.result = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case ID: - if (value == null) { - unset_id(); - } else { - set_id((String)value); - } - break; - - case RESULT: - if (value == null) { - unset_result(); - } else { - set_result((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case ID: - return get_id(); - - case RESULT: - return get_result(); - - } - throw new 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(); - } - - switch (field) { - case ID: - return is_set_id(); - case RESULT: - return is_set_result(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof result_args) - return this.equals((result_args)that); - return false; - } - - public boolean equals(result_args that) { - if (that == null) - return false; - - boolean this_present_id = true && this.is_set_id(); - boolean that_present_id = true && that.is_set_id(); - if (this_present_id || that_present_id) { - if (!(this_present_id && that_present_id)) - return false; - if (!this.id.equals(that.id)) - return false; - } - - boolean this_present_result = true && this.is_set_result(); - boolean that_present_result = true && that.is_set_result(); - if (this_present_result || that_present_result) { - if (!(this_present_result && that_present_result)) - return false; - if (!this.result.equals(that.result)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_id = true && (is_set_id()); - builder.append(present_id); - if (present_id) - builder.append(id); - - boolean present_result = true && (is_set_result()); - builder.append(present_result); - if (present_result) - builder.append(result); - - return builder.toHashCode(); - } - - public int compareTo(result_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - result_args typedOther = (result_args)other; - - lastComparison = Boolean.valueOf(is_set_id()).compareTo(typedOther.is_set_id()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_id()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_result()).compareTo(typedOther.is_set_result()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_result()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.result, typedOther.result); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // ID - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.id = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // RESULT - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.result = 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.id != null) { - oprot.writeFieldBegin(ID_FIELD_DESC); - oprot.writeString(this.id); - oprot.writeFieldEnd(); - } - if (this.result != null) { - oprot.writeFieldBegin(RESULT_FIELD_DESC); - oprot.writeString(this.result); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("result_args("); - boolean first = true; - - sb.append("id:"); - if (this.id == null) { - sb.append("null"); - } else { - sb.append(this.id); - } - first = false; - if (!first) sb.append(", "); - sb.append("result:"); - if (this.result == null) { - sb.append("null"); - } else { - sb.append(this.result); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - } - - public static class result_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("result_result"); - - - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -; - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - 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); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(result_result.class, metaDataMap); - } - - public result_result() { - } - - /** - * Performs a deep copy on other. - */ - public result_result(result_result other) { - } - - public result_result deepCopy() { - return new result_result(this); - } - - @Override - public void clear() { - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - } - throw new 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(); - } - - switch (field) { - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof result_result) - return this.equals((result_result)that); - return false; - } - - public boolean equals(result_result that) { - if (that == null) - return false; - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - return builder.toHashCode(); - } - - public int compareTo(result_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - result_result typedOther = (result_result)other; - - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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) { - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("result_result("); - boolean first = true; - - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - } - - public static class fetchRequest_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("fetchRequest_args"); - - private static final org.apache.thrift.protocol.TField FUNCTION_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("functionName", org.apache.thrift.protocol.TType.STRING, (short)1); - - private String functionName; // 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 { - FUNCTION_NAME((short)1, "functionName"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // FUNCTION_NAME - return FUNCTION_NAME; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.FUNCTION_NAME, new org.apache.thrift.meta_data.FieldMetaData("functionName", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(fetchRequest_args.class, metaDataMap); - } - - public fetchRequest_args() { - } - - public fetchRequest_args( - String functionName) - { - this(); - this.functionName = functionName; - } - - /** - * Performs a deep copy on other. - */ - public fetchRequest_args(fetchRequest_args other) { - if (other.is_set_functionName()) { - this.functionName = other.functionName; - } - } - - public fetchRequest_args deepCopy() { - return new fetchRequest_args(this); - } - - @Override - public void clear() { - this.functionName = null; - } - - public String get_functionName() { - return this.functionName; - } - - public void set_functionName(String functionName) { - this.functionName = functionName; - } - - public void unset_functionName() { - this.functionName = null; - } - - /** Returns true if field functionName is set (has been assigned a value) and false otherwise */ - public boolean is_set_functionName() { - return this.functionName != null; - } - - public void set_functionName_isSet(boolean value) { - if (!value) { - this.functionName = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case FUNCTION_NAME: - if (value == null) { - unset_functionName(); - } else { - set_functionName((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case FUNCTION_NAME: - return get_functionName(); - - } - throw new 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(); - } - - switch (field) { - case FUNCTION_NAME: - return is_set_functionName(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof fetchRequest_args) - return this.equals((fetchRequest_args)that); - return false; - } - - public boolean equals(fetchRequest_args that) { - if (that == null) - return false; - - boolean this_present_functionName = true && this.is_set_functionName(); - boolean that_present_functionName = true && that.is_set_functionName(); - if (this_present_functionName || that_present_functionName) { - if (!(this_present_functionName && that_present_functionName)) - return false; - if (!this.functionName.equals(that.functionName)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_functionName = true && (is_set_functionName()); - builder.append(present_functionName); - if (present_functionName) - builder.append(functionName); - - return builder.toHashCode(); - } - - public int compareTo(fetchRequest_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - fetchRequest_args typedOther = (fetchRequest_args)other; - - lastComparison = Boolean.valueOf(is_set_functionName()).compareTo(typedOther.is_set_functionName()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_functionName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.functionName, typedOther.functionName); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // FUNCTION_NAME - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.functionName = 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.functionName != null) { - oprot.writeFieldBegin(FUNCTION_NAME_FIELD_DESC); - oprot.writeString(this.functionName); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("fetchRequest_args("); - boolean first = true; - - sb.append("functionName:"); - if (this.functionName == null) { - sb.append("null"); - } else { - sb.append(this.functionName); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - } - - public static class fetchRequest_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("fetchRequest_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private DRPCRequest success; // 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 { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, DRPCRequest.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(fetchRequest_result.class, metaDataMap); - } - - public fetchRequest_result() { - } - - public fetchRequest_result( - DRPCRequest success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public fetchRequest_result(fetchRequest_result other) { - if (other.is_set_success()) { - this.success = new DRPCRequest(other.success); - } - } - - public fetchRequest_result deepCopy() { - return new fetchRequest_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public DRPCRequest get_success() { - return this.success; - } - - public void set_success(DRPCRequest success) { - this.success = success; - } - - public void unset_success() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean is_set_success() { - return this.success != null; - } - - public void set_success_isSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unset_success(); - } else { - set_success((DRPCRequest)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return get_success(); - - } - throw new 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(); - } - - switch (field) { - case SUCCESS: - return is_set_success(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof fetchRequest_result) - return this.equals((fetchRequest_result)that); - return false; - } - - public boolean equals(fetchRequest_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.is_set_success(); - boolean that_present_success = true && that.is_set_success(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_success = true && (is_set_success()); - builder.append(present_success); - if (present_success) - builder.append(success); - - return builder.toHashCode(); - } - - public int compareTo(fetchRequest_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - fetchRequest_result typedOther = (fetchRequest_result)other; - - lastComparison = Boolean.valueOf(is_set_success()).compareTo(typedOther.is_set_success()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_success()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.success = new DRPCRequest(); - this.success.read(iprot); - } 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.is_set_success()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - this.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("fetchRequest_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - } - - public static class failRequest_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("failRequest_args"); - - private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1); - - private String 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 { - ID((short)1, "id"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // ID - return ID; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(failRequest_args.class, metaDataMap); - } - - public failRequest_args() { - } - - public failRequest_args( - String id) - { - this(); - this.id = id; - } - - /** - * Performs a deep copy on other. - */ - public failRequest_args(failRequest_args other) { - if (other.is_set_id()) { - this.id = other.id; - } - } - - public failRequest_args deepCopy() { - return new failRequest_args(this); - } - - @Override - public void clear() { - this.id = null; - } - - public String get_id() { - return this.id; - } - - public void set_id(String id) { - this.id = id; - } - - public void unset_id() { - this.id = null; - } - - /** Returns true if field id is set (has been assigned a value) and false otherwise */ - public boolean is_set_id() { - return this.id != null; - } - - public void set_id_isSet(boolean value) { - if (!value) { - this.id = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case ID: - if (value == null) { - unset_id(); - } else { - set_id((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case ID: - return get_id(); - - } - throw new 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(); - } - - switch (field) { - case ID: - return is_set_id(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof failRequest_args) - return this.equals((failRequest_args)that); - return false; - } - - public boolean equals(failRequest_args that) { - if (that == null) - return false; - - boolean this_present_id = true && this.is_set_id(); - boolean that_present_id = true && that.is_set_id(); - if (this_present_id || that_present_id) { - if (!(this_present_id && that_present_id)) - return false; - if (!this.id.equals(that.id)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_id = true && (is_set_id()); - builder.append(present_id); - if (present_id) - builder.append(id); - - return builder.toHashCode(); - } - - public int compareTo(failRequest_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - failRequest_args typedOther = (failRequest_args)other; - - lastComparison = Boolean.valueOf(is_set_id()).compareTo(typedOther.is_set_id()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_id()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // ID - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.id = 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.id != null) { - oprot.writeFieldBegin(ID_FIELD_DESC); - oprot.writeString(this.id); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("failRequest_args("); - boolean first = true; - - sb.append("id:"); - if (this.id == null) { - sb.append("null"); - } else { - sb.append(this.id); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - } - - public static class failRequest_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("failRequest_result"); - - - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -; - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - 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); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(failRequest_result.class, metaDataMap); - } - - public failRequest_result() { - } - - /** - * Performs a deep copy on other. - */ - public failRequest_result(failRequest_result other) { - } - - public failRequest_result deepCopy() { - return new failRequest_result(this); - } - - @Override - public void clear() { - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - } - throw new 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(); - } - - switch (field) { - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof failRequest_result) - return this.equals((failRequest_result)that); - return false; - } - - public boolean equals(failRequest_result that) { - if (that == null) - return false; - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - return builder.toHashCode(); - } - - public int compareTo(failRequest_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - failRequest_result typedOther = (failRequest_result)other; - - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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) { - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("failRequest_result("); - boolean first = true; - - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - } - -} +/** + * Autogenerated by Thrift Compiler (0.8.0) + * + * 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 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class DistributedRPCInvocations { + + public interface Iface { + + public void result(String id, String result) throws org.apache.thrift.TException; + + public DRPCRequest fetchRequest(String functionName) throws org.apache.thrift.TException; + + public void failRequest(String id) throws org.apache.thrift.TException; + + } + + public interface AsyncIface { + + public void result(String id, String result, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void fetchRequest(String functionName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void failRequest(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + } + + public static class Client extends org.apache.thrift.TServiceClient implements Iface { + public static class Factory implements org.apache.thrift.TServiceClientFactory { + public Factory() {} + public Client getClient(org.apache.thrift.protocol.TProtocol prot) { + return new Client(prot); + } + public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { + return new Client(iprot, oprot); + } + } + + public Client(org.apache.thrift.protocol.TProtocol prot) + { + super(prot, prot); + } + + public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { + super(iprot, oprot); + } + + public void result(String id, String result) throws org.apache.thrift.TException + { + send_result(id, result); + recv_result(); + } + + public void send_result(String id, String result) throws org.apache.thrift.TException + { + result_args args = new result_args(); + args.set_id(id); + args.set_result(result); + sendBase("result", args); + } + + public void recv_result() throws org.apache.thrift.TException + { + result_result result = new result_result(); + receiveBase(result, "result"); + return; + } + + public DRPCRequest fetchRequest(String functionName) throws org.apache.thrift.TException + { + send_fetchRequest(functionName); + return recv_fetchRequest(); + } + + public void send_fetchRequest(String functionName) throws org.apache.thrift.TException + { + fetchRequest_args args = new fetchRequest_args(); + args.set_functionName(functionName); + sendBase("fetchRequest", args); + } + + public DRPCRequest recv_fetchRequest() throws org.apache.thrift.TException + { + fetchRequest_result result = new fetchRequest_result(); + receiveBase(result, "fetchRequest"); + if (result.is_set_success()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "fetchRequest failed: unknown result"); + } + + public void failRequest(String id) throws org.apache.thrift.TException + { + send_failRequest(id); + recv_failRequest(); + } + + public void send_failRequest(String id) throws org.apache.thrift.TException + { + failRequest_args args = new failRequest_args(); + args.set_id(id); + sendBase("failRequest", args); + } + + public void recv_failRequest() throws org.apache.thrift.TException + { + failRequest_result result = new failRequest_result(); + receiveBase(result, "failRequest"); + return; + } + + } + public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { + public static class Factory implements org.apache.thrift.async.TAsyncClientFactory { + private org.apache.thrift.async.TAsyncClientManager clientManager; + private org.apache.thrift.protocol.TProtocolFactory protocolFactory; + public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) { + this.clientManager = clientManager; + this.protocolFactory = protocolFactory; + } + public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) { + return new AsyncClient(protocolFactory, clientManager, transport); + } + } + + public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) { + super(protocolFactory, clientManager, transport); + } + + public void result(String id, String result, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + result_call method_call = new result_call(id, result, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class result_call extends org.apache.thrift.async.TAsyncMethodCall { + private String id; + private String result; + public result_call(String id, String result, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.id = id; + this.result = result; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("result", org.apache.thrift.protocol.TMessageType.CALL, 0)); + result_args args = new result_args(); + args.set_id(id); + args.set_result(result); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_result(); + } + } + + public void fetchRequest(String functionName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + fetchRequest_call method_call = new fetchRequest_call(functionName, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class fetchRequest_call extends org.apache.thrift.async.TAsyncMethodCall { + private String functionName; + public fetchRequest_call(String functionName, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.functionName = functionName; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("fetchRequest", org.apache.thrift.protocol.TMessageType.CALL, 0)); + fetchRequest_args args = new fetchRequest_args(); + args.set_functionName(functionName); + args.write(prot); + prot.writeMessageEnd(); + } + + public DRPCRequest getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_fetchRequest(); + } + } + + public void failRequest(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + failRequest_call method_call = new failRequest_call(id, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class failRequest_call extends org.apache.thrift.async.TAsyncMethodCall { + private String id; + public failRequest_call(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.id = id; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("failRequest", org.apache.thrift.protocol.TMessageType.CALL, 0)); + failRequest_args args = new failRequest_args(); + args.set_id(id); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_failRequest(); + } + } + + } + + public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor { + private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName()); + public Processor(I iface) { + super(iface, getProcessMap(new HashMap>())); + } + + protected Processor(I iface, Map> processMap) { + super(iface, getProcessMap(processMap)); + } + + private static Map> getProcessMap(Map> processMap) { + processMap.put("result", new result()); + processMap.put("fetchRequest", new fetchRequest()); + processMap.put("failRequest", new failRequest()); + return processMap; + } + + private static class result extends org.apache.thrift.ProcessFunction { + public result() { + super("result"); + } + + protected result_args getEmptyArgsInstance() { + return new result_args(); + } + + protected result_result getResult(I iface, result_args args) throws org.apache.thrift.TException { + result_result result = new result_result(); + iface.result(args.id, args.result); + return result; + } + } + + private static class fetchRequest extends org.apache.thrift.ProcessFunction { + public fetchRequest() { + super("fetchRequest"); + } + + protected fetchRequest_args getEmptyArgsInstance() { + return new fetchRequest_args(); + } + + protected fetchRequest_result getResult(I iface, fetchRequest_args args) throws org.apache.thrift.TException { + fetchRequest_result result = new fetchRequest_result(); + result.success = iface.fetchRequest(args.functionName); + return result; + } + } + + private static class failRequest extends org.apache.thrift.ProcessFunction { + public failRequest() { + super("failRequest"); + } + + protected failRequest_args getEmptyArgsInstance() { + return new failRequest_args(); + } + + protected failRequest_result getResult(I iface, failRequest_args args) throws org.apache.thrift.TException { + failRequest_result result = new failRequest_result(); + iface.failRequest(args.id); + return result; + } + } + + } + + public static class result_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("result_args"); + + private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField RESULT_FIELD_DESC = new org.apache.thrift.protocol.TField("result", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new result_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new result_argsTupleSchemeFactory()); + } + + private String id; // required + private String result; // 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 { + ID((short)1, "id"), + RESULT((short)2, "result"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // ID + return ID; + case 2: // RESULT + return RESULT; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.RESULT, new org.apache.thrift.meta_data.FieldMetaData("result", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(result_args.class, metaDataMap); + } + + public result_args() { + } + + public result_args( + String id, + String result) + { + this(); + this.id = id; + this.result = result; + } + + /** + * Performs a deep copy on other. + */ + public result_args(result_args other) { + if (other.is_set_id()) { + this.id = other.id; + } + if (other.is_set_result()) { + this.result = other.result; + } + } + + public result_args deepCopy() { + return new result_args(this); + } + + @Override + public void clear() { + this.id = null; + this.result = null; + } + + public String get_id() { + return this.id; + } + + public void set_id(String id) { + this.id = id; + } + + public void unset_id() { + this.id = null; + } + + /** Returns true if field id is set (has been assigned a value) and false otherwise */ + public boolean is_set_id() { + return this.id != null; + } + + public void set_id_isSet(boolean value) { + if (!value) { + this.id = null; + } + } + + public String get_result() { + return this.result; + } + + public void set_result(String result) { + this.result = result; + } + + public void unset_result() { + this.result = null; + } + + /** Returns true if field result is set (has been assigned a value) and false otherwise */ + public boolean is_set_result() { + return this.result != null; + } + + public void set_result_isSet(boolean value) { + if (!value) { + this.result = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case ID: + if (value == null) { + unset_id(); + } else { + set_id((String)value); + } + break; + + case RESULT: + if (value == null) { + unset_result(); + } else { + set_result((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case ID: + return get_id(); + + case RESULT: + return get_result(); + + } + throw new 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(); + } + + switch (field) { + case ID: + return is_set_id(); + case RESULT: + return is_set_result(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof result_args) + return this.equals((result_args)that); + return false; + } + + public boolean equals(result_args that) { + if (that == null) + return false; + + boolean this_present_id = true && this.is_set_id(); + boolean that_present_id = true && that.is_set_id(); + if (this_present_id || that_present_id) { + if (!(this_present_id && that_present_id)) + return false; + if (!this.id.equals(that.id)) + return false; + } + + boolean this_present_result = true && this.is_set_result(); + boolean that_present_result = true && that.is_set_result(); + if (this_present_result || that_present_result) { + if (!(this_present_result && that_present_result)) + return false; + if (!this.result.equals(that.result)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_id = true && (is_set_id()); + builder.append(present_id); + if (present_id) + builder.append(id); + + boolean present_result = true && (is_set_result()); + builder.append(present_result); + if (present_result) + builder.append(result); + + return builder.toHashCode(); + } + + public int compareTo(result_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + result_args typedOther = (result_args)other; + + lastComparison = Boolean.valueOf(is_set_id()).compareTo(typedOther.is_set_id()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_id()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_result()).compareTo(typedOther.is_set_result()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_result()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.result, typedOther.result); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("result_args("); + boolean first = true; + + sb.append("id:"); + if (this.id == null) { + sb.append("null"); + } else { + sb.append(this.id); + } + first = false; + if (!first) sb.append(", "); + sb.append("result:"); + if (this.result == null) { + sb.append("null"); + } else { + sb.append(this.result); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 result_argsStandardSchemeFactory implements SchemeFactory { + public result_argsStandardScheme getScheme() { + return new result_argsStandardScheme(); + } + } + + private static class result_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, result_args 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: // ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.id = iprot.readString(); + struct.set_id_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // RESULT + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.result = iprot.readString(); + struct.set_result_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, result_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.id != null) { + oprot.writeFieldBegin(ID_FIELD_DESC); + oprot.writeString(struct.id); + oprot.writeFieldEnd(); + } + if (struct.result != null) { + oprot.writeFieldBegin(RESULT_FIELD_DESC); + oprot.writeString(struct.result); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class result_argsTupleSchemeFactory implements SchemeFactory { + public result_argsTupleScheme getScheme() { + return new result_argsTupleScheme(); + } + } + + private static class result_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, result_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.is_set_id()) { + optionals.set(0); + } + if (struct.is_set_result()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.is_set_id()) { + oprot.writeString(struct.id); + } + if (struct.is_set_result()) { + oprot.writeString(struct.result); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, result_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.id = iprot.readString(); + struct.set_id_isSet(true); + } + if (incoming.get(1)) { + struct.result = iprot.readString(); + struct.set_result_isSet(true); + } + } + } + + } + + public static class result_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("result_result"); + + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new result_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new result_resultTupleSchemeFactory()); + } + + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { +; + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + 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); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(result_result.class, metaDataMap); + } + + public result_result() { + } + + /** + * Performs a deep copy on other. + */ + public result_result(result_result other) { + } + + public result_result deepCopy() { + return new result_result(this); + } + + @Override + public void clear() { + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + } + throw new 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(); + } + + switch (field) { + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof result_result) + return this.equals((result_result)that); + return false; + } + + public boolean equals(result_result that) { + if (that == null) + return false; + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + return builder.toHashCode(); + } + + public int compareTo(result_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + result_result typedOther = (result_result)other; + + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("result_result("); + boolean first = true; + + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 result_resultStandardSchemeFactory implements SchemeFactory { + public result_resultStandardScheme getScheme() { + return new result_resultStandardScheme(); + } + } + + private static class result_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, result_result 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) { + 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, result_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class result_resultTupleSchemeFactory implements SchemeFactory { + public result_resultTupleScheme getScheme() { + return new result_resultTupleScheme(); + } + } + + private static class result_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, result_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, result_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + + } + + public static class fetchRequest_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("fetchRequest_args"); + + private static final org.apache.thrift.protocol.TField FUNCTION_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("functionName", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new fetchRequest_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new fetchRequest_argsTupleSchemeFactory()); + } + + private String functionName; // 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 { + FUNCTION_NAME((short)1, "functionName"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // FUNCTION_NAME + return FUNCTION_NAME; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.FUNCTION_NAME, new org.apache.thrift.meta_data.FieldMetaData("functionName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(fetchRequest_args.class, metaDataMap); + } + + public fetchRequest_args() { + } + + public fetchRequest_args( + String functionName) + { + this(); + this.functionName = functionName; + } + + /** + * Performs a deep copy on other. + */ + public fetchRequest_args(fetchRequest_args other) { + if (other.is_set_functionName()) { + this.functionName = other.functionName; + } + } + + public fetchRequest_args deepCopy() { + return new fetchRequest_args(this); + } + + @Override + public void clear() { + this.functionName = null; + } + + public String get_functionName() { + return this.functionName; + } + + public void set_functionName(String functionName) { + this.functionName = functionName; + } + + public void unset_functionName() { + this.functionName = null; + } + + /** Returns true if field functionName is set (has been assigned a value) and false otherwise */ + public boolean is_set_functionName() { + return this.functionName != null; + } + + public void set_functionName_isSet(boolean value) { + if (!value) { + this.functionName = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case FUNCTION_NAME: + if (value == null) { + unset_functionName(); + } else { + set_functionName((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case FUNCTION_NAME: + return get_functionName(); + + } + throw new 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(); + } + + switch (field) { + case FUNCTION_NAME: + return is_set_functionName(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof fetchRequest_args) + return this.equals((fetchRequest_args)that); + return false; + } + + public boolean equals(fetchRequest_args that) { + if (that == null) + return false; + + boolean this_present_functionName = true && this.is_set_functionName(); + boolean that_present_functionName = true && that.is_set_functionName(); + if (this_present_functionName || that_present_functionName) { + if (!(this_present_functionName && that_present_functionName)) + return false; + if (!this.functionName.equals(that.functionName)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_functionName = true && (is_set_functionName()); + builder.append(present_functionName); + if (present_functionName) + builder.append(functionName); + + return builder.toHashCode(); + } + + public int compareTo(fetchRequest_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + fetchRequest_args typedOther = (fetchRequest_args)other; + + lastComparison = Boolean.valueOf(is_set_functionName()).compareTo(typedOther.is_set_functionName()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_functionName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.functionName, typedOther.functionName); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("fetchRequest_args("); + boolean first = true; + + sb.append("functionName:"); + if (this.functionName == null) { + sb.append("null"); + } else { + sb.append(this.functionName); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 fetchRequest_argsStandardSchemeFactory implements SchemeFactory { + public fetchRequest_argsStandardScheme getScheme() { + return new fetchRequest_argsStandardScheme(); + } + } + + private static class fetchRequest_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, fetchRequest_args 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: // FUNCTION_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.functionName = iprot.readString(); + struct.set_functionName_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, fetchRequest_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.functionName != null) { + oprot.writeFieldBegin(FUNCTION_NAME_FIELD_DESC); + oprot.writeString(struct.functionName); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class fetchRequest_argsTupleSchemeFactory implements SchemeFactory { + public fetchRequest_argsTupleScheme getScheme() { + return new fetchRequest_argsTupleScheme(); + } + } + + private static class fetchRequest_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, fetchRequest_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.is_set_functionName()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.is_set_functionName()) { + oprot.writeString(struct.functionName); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, fetchRequest_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.functionName = iprot.readString(); + struct.set_functionName_isSet(true); + } + } + } + + } + + public static class fetchRequest_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("fetchRequest_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new fetchRequest_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new fetchRequest_resultTupleSchemeFactory()); + } + + private DRPCRequest success; // 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 { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, DRPCRequest.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(fetchRequest_result.class, metaDataMap); + } + + public fetchRequest_result() { + } + + public fetchRequest_result( + DRPCRequest success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public fetchRequest_result(fetchRequest_result other) { + if (other.is_set_success()) { + this.success = new DRPCRequest(other.success); + } + } + + public fetchRequest_result deepCopy() { + return new fetchRequest_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public DRPCRequest get_success() { + return this.success; + } + + public void set_success(DRPCRequest success) { + this.success = success; + } + + public void unset_success() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean is_set_success() { + return this.success != null; + } + + public void set_success_isSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unset_success(); + } else { + set_success((DRPCRequest)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return get_success(); + + } + throw new 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(); + } + + switch (field) { + case SUCCESS: + return is_set_success(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof fetchRequest_result) + return this.equals((fetchRequest_result)that); + return false; + } + + public boolean equals(fetchRequest_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.is_set_success(); + boolean that_present_success = true && that.is_set_success(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_success = true && (is_set_success()); + builder.append(present_success); + if (present_success) + builder.append(success); + + return builder.toHashCode(); + } + + public int compareTo(fetchRequest_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + fetchRequest_result typedOther = (fetchRequest_result)other; + + lastComparison = Boolean.valueOf(is_set_success()).compareTo(typedOther.is_set_success()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_success()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("fetchRequest_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 fetchRequest_resultStandardSchemeFactory implements SchemeFactory { + public fetchRequest_resultStandardScheme getScheme() { + return new fetchRequest_resultStandardScheme(); + } + } + + private static class fetchRequest_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, fetchRequest_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new DRPCRequest(); + struct.success.read(iprot); + struct.set_success_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, fetchRequest_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class fetchRequest_resultTupleSchemeFactory implements SchemeFactory { + public fetchRequest_resultTupleScheme getScheme() { + return new fetchRequest_resultTupleScheme(); + } + } + + private static class fetchRequest_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, fetchRequest_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.is_set_success()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.is_set_success()) { + struct.success.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, fetchRequest_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new DRPCRequest(); + struct.success.read(iprot); + struct.set_success_isSet(true); + } + } + } + + } + + public static class failRequest_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("failRequest_args"); + + private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new failRequest_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new failRequest_argsTupleSchemeFactory()); + } + + private String 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 { + ID((short)1, "id"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // ID + return ID; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(failRequest_args.class, metaDataMap); + } + + public failRequest_args() { + } + + public failRequest_args( + String id) + { + this(); + this.id = id; + } + + /** + * Performs a deep copy on other. + */ + public failRequest_args(failRequest_args other) { + if (other.is_set_id()) { + this.id = other.id; + } + } + + public failRequest_args deepCopy() { + return new failRequest_args(this); + } + + @Override + public void clear() { + this.id = null; + } + + public String get_id() { + return this.id; + } + + public void set_id(String id) { + this.id = id; + } + + public void unset_id() { + this.id = null; + } + + /** Returns true if field id is set (has been assigned a value) and false otherwise */ + public boolean is_set_id() { + return this.id != null; + } + + public void set_id_isSet(boolean value) { + if (!value) { + this.id = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case ID: + if (value == null) { + unset_id(); + } else { + set_id((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case ID: + return get_id(); + + } + throw new 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(); + } + + switch (field) { + case ID: + return is_set_id(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof failRequest_args) + return this.equals((failRequest_args)that); + return false; + } + + public boolean equals(failRequest_args that) { + if (that == null) + return false; + + boolean this_present_id = true && this.is_set_id(); + boolean that_present_id = true && that.is_set_id(); + if (this_present_id || that_present_id) { + if (!(this_present_id && that_present_id)) + return false; + if (!this.id.equals(that.id)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_id = true && (is_set_id()); + builder.append(present_id); + if (present_id) + builder.append(id); + + return builder.toHashCode(); + } + + public int compareTo(failRequest_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + failRequest_args typedOther = (failRequest_args)other; + + lastComparison = Boolean.valueOf(is_set_id()).compareTo(typedOther.is_set_id()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_id()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("failRequest_args("); + boolean first = true; + + sb.append("id:"); + if (this.id == null) { + sb.append("null"); + } else { + sb.append(this.id); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 failRequest_argsStandardSchemeFactory implements SchemeFactory { + public failRequest_argsStandardScheme getScheme() { + return new failRequest_argsStandardScheme(); + } + } + + private static class failRequest_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, failRequest_args 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: // ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.id = iprot.readString(); + struct.set_id_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, failRequest_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.id != null) { + oprot.writeFieldBegin(ID_FIELD_DESC); + oprot.writeString(struct.id); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class failRequest_argsTupleSchemeFactory implements SchemeFactory { + public failRequest_argsTupleScheme getScheme() { + return new failRequest_argsTupleScheme(); + } + } + + private static class failRequest_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, failRequest_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.is_set_id()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.is_set_id()) { + oprot.writeString(struct.id); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, failRequest_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.id = iprot.readString(); + struct.set_id_isSet(true); + } + } + } + + } + + public static class failRequest_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("failRequest_result"); + + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new failRequest_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new failRequest_resultTupleSchemeFactory()); + } + + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { +; + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + 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); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(failRequest_result.class, metaDataMap); + } + + public failRequest_result() { + } + + /** + * Performs a deep copy on other. + */ + public failRequest_result(failRequest_result other) { + } + + public failRequest_result deepCopy() { + return new failRequest_result(this); + } + + @Override + public void clear() { + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + } + throw new 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(); + } + + switch (field) { + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof failRequest_result) + return this.equals((failRequest_result)that); + return false; + } + + public boolean equals(failRequest_result that) { + if (that == null) + return false; + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + return builder.toHashCode(); + } + + public int compareTo(failRequest_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + failRequest_result typedOther = (failRequest_result)other; + + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("failRequest_result("); + boolean first = true; + + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 failRequest_resultStandardSchemeFactory implements SchemeFactory { + public failRequest_resultStandardScheme getScheme() { + return new failRequest_resultStandardScheme(); + } + } + + private static class failRequest_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, failRequest_result 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) { + 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, failRequest_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class failRequest_resultTupleSchemeFactory implements SchemeFactory { + public failRequest_resultTupleScheme getScheme() { + return new failRequest_resultTupleScheme(); + } + } + + private static class failRequest_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, failRequest_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, failRequest_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + + } + +} diff --git a/jstorm-client/src/main/java/backtype/storm/generated/ErrorInfo.java b/jstorm-client/src/main/java/backtype/storm/generated/ErrorInfo.java index 713c23b5e..dff878ab4 100644 --- a/jstorm-client/src/main/java/backtype/storm/generated/ErrorInfo.java +++ b/jstorm-client/src/main/java/backtype/storm/generated/ErrorInfo.java @@ -1,425 +1,481 @@ -/** - * Autogenerated by Thrift Compiler (0.7.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - */ -package backtype.storm.generated; - -import org.apache.commons.lang.builder.HashCodeBuilder; -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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class ErrorInfo implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ErrorInfo"); - - private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField ERROR_TIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("error_time_secs", org.apache.thrift.protocol.TType.I32, (short)2); - - private String error; // required - private int error_time_secs; // 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 { - ERROR((short)1, "error"), - ERROR_TIME_SECS((short)2, "error_time_secs"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // ERROR - return ERROR; - case 2: // ERROR_TIME_SECS - return ERROR_TIME_SECS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __ERROR_TIME_SECS_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - - 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); - tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.ERROR_TIME_SECS, new org.apache.thrift.meta_data.FieldMetaData("error_time_secs", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ErrorInfo.class, metaDataMap); - } - - public ErrorInfo() { - } - - public ErrorInfo( - String error, - int error_time_secs) - { - this(); - this.error = error; - this.error_time_secs = error_time_secs; - set_error_time_secs_isSet(true); - } - - /** - * Performs a deep copy on other. - */ - public ErrorInfo(ErrorInfo other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); - if (other.is_set_error()) { - this.error = other.error; - } - this.error_time_secs = other.error_time_secs; - } - - public ErrorInfo deepCopy() { - return new ErrorInfo(this); - } - - @Override - public void clear() { - this.error = null; - set_error_time_secs_isSet(false); - this.error_time_secs = 0; - } - - public String get_error() { - return this.error; - } - - public void set_error(String error) { - this.error = error; - } - - public void unset_error() { - this.error = null; - } - - /** Returns true if field error is set (has been assigned a value) and false otherwise */ - public boolean is_set_error() { - return this.error != null; - } - - public void set_error_isSet(boolean value) { - if (!value) { - this.error = null; - } - } - - public int get_error_time_secs() { - return this.error_time_secs; - } - - public void set_error_time_secs(int error_time_secs) { - this.error_time_secs = error_time_secs; - set_error_time_secs_isSet(true); - } - - public void unset_error_time_secs() { - __isset_bit_vector.clear(__ERROR_TIME_SECS_ISSET_ID); - } - - /** Returns true if field error_time_secs is set (has been assigned a value) and false otherwise */ - public boolean is_set_error_time_secs() { - return __isset_bit_vector.get(__ERROR_TIME_SECS_ISSET_ID); - } - - public void set_error_time_secs_isSet(boolean value) { - __isset_bit_vector.set(__ERROR_TIME_SECS_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case ERROR: - if (value == null) { - unset_error(); - } else { - set_error((String)value); - } - break; - - case ERROR_TIME_SECS: - if (value == null) { - unset_error_time_secs(); - } else { - set_error_time_secs((Integer)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case ERROR: - return get_error(); - - case ERROR_TIME_SECS: - return Integer.valueOf(get_error_time_secs()); - - } - throw new 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(); - } - - switch (field) { - case ERROR: - return is_set_error(); - case ERROR_TIME_SECS: - return is_set_error_time_secs(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof ErrorInfo) - return this.equals((ErrorInfo)that); - return false; - } - - public boolean equals(ErrorInfo that) { - if (that == null) - return false; - - boolean this_present_error = true && this.is_set_error(); - boolean that_present_error = true && that.is_set_error(); - if (this_present_error || that_present_error) { - if (!(this_present_error && that_present_error)) - return false; - if (!this.error.equals(that.error)) - return false; - } - - boolean this_present_error_time_secs = true; - boolean that_present_error_time_secs = true; - if (this_present_error_time_secs || that_present_error_time_secs) { - if (!(this_present_error_time_secs && that_present_error_time_secs)) - return false; - if (this.error_time_secs != that.error_time_secs) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_error = true && (is_set_error()); - builder.append(present_error); - if (present_error) - builder.append(error); - - boolean present_error_time_secs = true; - builder.append(present_error_time_secs); - if (present_error_time_secs) - builder.append(error_time_secs); - - return builder.toHashCode(); - } - - public int compareTo(ErrorInfo other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - ErrorInfo typedOther = (ErrorInfo)other; - - lastComparison = Boolean.valueOf(is_set_error()).compareTo(typedOther.is_set_error()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_error()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, typedOther.error); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_error_time_secs()).compareTo(typedOther.is_set_error_time_secs()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_error_time_secs()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error_time_secs, typedOther.error_time_secs); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // ERROR - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.error = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // ERROR_TIME_SECS - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.error_time_secs = iprot.readI32(); - set_error_time_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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.error != null) { - oprot.writeFieldBegin(ERROR_FIELD_DESC); - oprot.writeString(this.error); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(ERROR_TIME_SECS_FIELD_DESC); - oprot.writeI32(this.error_time_secs); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("ErrorInfo("); - boolean first = true; - - sb.append("error:"); - if (this.error == null) { - sb.append("null"); - } else { - sb.append(this.error); - } - first = false; - if (!first) sb.append(", "); - sb.append("error_time_secs:"); - sb.append(this.error_time_secs); - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!is_set_error()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'error' is unset! Struct:" + toString()); - } - - if (!is_set_error_time_secs()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'error_time_secs' is unset! Struct:" + toString()); - } - - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - 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); - 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); - } - } - -} - +/** + * Autogenerated by Thrift Compiler (0.8.0) + * + * 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 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class ErrorInfo implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ErrorInfo"); + + private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField ERROR_TIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("error_time_secs", org.apache.thrift.protocol.TType.I32, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new ErrorInfoStandardSchemeFactory()); + schemes.put(TupleScheme.class, new ErrorInfoTupleSchemeFactory()); + } + + private String error; // required + private int error_time_secs; // 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 { + ERROR((short)1, "error"), + ERROR_TIME_SECS((short)2, "error_time_secs"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // ERROR + return ERROR; + case 2: // ERROR_TIME_SECS + return ERROR_TIME_SECS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __ERROR_TIME_SECS_ISSET_ID = 0; + private BitSet __isset_bit_vector = new BitSet(1); + 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); + tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.ERROR_TIME_SECS, new org.apache.thrift.meta_data.FieldMetaData("error_time_secs", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ErrorInfo.class, metaDataMap); + } + + public ErrorInfo() { + } + + public ErrorInfo( + String error, + int error_time_secs) + { + this(); + this.error = error; + this.error_time_secs = error_time_secs; + set_error_time_secs_isSet(true); + } + + /** + * Performs a deep copy on other. + */ + public ErrorInfo(ErrorInfo other) { + __isset_bit_vector.clear(); + __isset_bit_vector.or(other.__isset_bit_vector); + if (other.is_set_error()) { + this.error = other.error; + } + this.error_time_secs = other.error_time_secs; + } + + public ErrorInfo deepCopy() { + return new ErrorInfo(this); + } + + @Override + public void clear() { + this.error = null; + set_error_time_secs_isSet(false); + this.error_time_secs = 0; + } + + public String get_error() { + return this.error; + } + + public void set_error(String error) { + this.error = error; + } + + public void unset_error() { + this.error = null; + } + + /** Returns true if field error is set (has been assigned a value) and false otherwise */ + public boolean is_set_error() { + return this.error != null; + } + + public void set_error_isSet(boolean value) { + if (!value) { + this.error = null; + } + } + + public int get_error_time_secs() { + return this.error_time_secs; + } + + public void set_error_time_secs(int error_time_secs) { + this.error_time_secs = error_time_secs; + set_error_time_secs_isSet(true); + } + + public void unset_error_time_secs() { + __isset_bit_vector.clear(__ERROR_TIME_SECS_ISSET_ID); + } + + /** Returns true if field error_time_secs is set (has been assigned a value) and false otherwise */ + public boolean is_set_error_time_secs() { + return __isset_bit_vector.get(__ERROR_TIME_SECS_ISSET_ID); + } + + public void set_error_time_secs_isSet(boolean value) { + __isset_bit_vector.set(__ERROR_TIME_SECS_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case ERROR: + if (value == null) { + unset_error(); + } else { + set_error((String)value); + } + break; + + case ERROR_TIME_SECS: + if (value == null) { + unset_error_time_secs(); + } else { + set_error_time_secs((Integer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case ERROR: + return get_error(); + + case ERROR_TIME_SECS: + return Integer.valueOf(get_error_time_secs()); + + } + throw new 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(); + } + + switch (field) { + case ERROR: + return is_set_error(); + case ERROR_TIME_SECS: + return is_set_error_time_secs(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof ErrorInfo) + return this.equals((ErrorInfo)that); + return false; + } + + public boolean equals(ErrorInfo that) { + if (that == null) + return false; + + boolean this_present_error = true && this.is_set_error(); + boolean that_present_error = true && that.is_set_error(); + if (this_present_error || that_present_error) { + if (!(this_present_error && that_present_error)) + return false; + if (!this.error.equals(that.error)) + return false; + } + + boolean this_present_error_time_secs = true; + boolean that_present_error_time_secs = true; + if (this_present_error_time_secs || that_present_error_time_secs) { + if (!(this_present_error_time_secs && that_present_error_time_secs)) + return false; + if (this.error_time_secs != that.error_time_secs) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_error = true && (is_set_error()); + builder.append(present_error); + if (present_error) + builder.append(error); + + boolean present_error_time_secs = true; + builder.append(present_error_time_secs); + if (present_error_time_secs) + builder.append(error_time_secs); + + return builder.toHashCode(); + } + + public int compareTo(ErrorInfo other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + ErrorInfo typedOther = (ErrorInfo)other; + + lastComparison = Boolean.valueOf(is_set_error()).compareTo(typedOther.is_set_error()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_error()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, typedOther.error); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_error_time_secs()).compareTo(typedOther.is_set_error_time_secs()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_error_time_secs()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error_time_secs, typedOther.error_time_secs); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("ErrorInfo("); + boolean first = true; + + sb.append("error:"); + if (this.error == null) { + sb.append("null"); + } else { + sb.append(this.error); + } + first = false; + if (!first) sb.append(", "); + sb.append("error_time_secs:"); + sb.append(this.error_time_secs); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!is_set_error()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'error' is unset! Struct:" + toString()); + } + + if (!is_set_error_time_secs()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'error_time_secs' is unset! Struct:" + toString()); + } + + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + 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); + 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 ErrorInfoStandardSchemeFactory implements SchemeFactory { + public ErrorInfoStandardScheme getScheme() { + return new ErrorInfoStandardScheme(); + } + } + + private static class ErrorInfoStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, ErrorInfo 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: // ERROR + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.error = iprot.readString(); + struct.set_error_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ERROR_TIME_SECS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.error_time_secs = iprot.readI32(); + struct.set_error_time_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, ErrorInfo struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.error != null) { + oprot.writeFieldBegin(ERROR_FIELD_DESC); + oprot.writeString(struct.error); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(ERROR_TIME_SECS_FIELD_DESC); + oprot.writeI32(struct.error_time_secs); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class ErrorInfoTupleSchemeFactory implements SchemeFactory { + public ErrorInfoTupleScheme getScheme() { + return new ErrorInfoTupleScheme(); + } + } + + private static class ErrorInfoTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, ErrorInfo struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.error); + oprot.writeI32(struct.error_time_secs); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, ErrorInfo struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.error = iprot.readString(); + struct.set_error_isSet(true); + struct.error_time_secs = iprot.readI32(); + struct.set_error_time_secs_isSet(true); + } + } + +} + diff --git a/jstorm-client/src/main/java/backtype/storm/generated/GlobalStreamId.java b/jstorm-client/src/main/java/backtype/storm/generated/GlobalStreamId.java index 62b37f3cf..08a709331 100644 --- a/jstorm-client/src/main/java/backtype/storm/generated/GlobalStreamId.java +++ b/jstorm-client/src/main/java/backtype/storm/generated/GlobalStreamId.java @@ -1,425 +1,482 @@ -/** - * Autogenerated by Thrift Compiler (0.7.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - */ -package backtype.storm.generated; - -import org.apache.commons.lang.builder.HashCodeBuilder; -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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class GlobalStreamId implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GlobalStreamId"); - - private static final org.apache.thrift.protocol.TField COMPONENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("componentId", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField STREAM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("streamId", org.apache.thrift.protocol.TType.STRING, (short)2); - - private String componentId; // required - private String streamId; // 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 { - COMPONENT_ID((short)1, "componentId"), - STREAM_ID((short)2, "streamId"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // COMPONENT_ID - return COMPONENT_ID; - case 2: // STREAM_ID - return STREAM_ID; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.COMPONENT_ID, new org.apache.thrift.meta_data.FieldMetaData("componentId", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.STREAM_ID, new org.apache.thrift.meta_data.FieldMetaData("streamId", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GlobalStreamId.class, metaDataMap); - } - - public GlobalStreamId() { - } - - public GlobalStreamId( - String componentId, - String streamId) - { - this(); - this.componentId = componentId; - this.streamId = streamId; - } - - /** - * Performs a deep copy on other. - */ - public GlobalStreamId(GlobalStreamId other) { - if (other.is_set_componentId()) { - this.componentId = other.componentId; - } - if (other.is_set_streamId()) { - this.streamId = other.streamId; - } - } - - public GlobalStreamId deepCopy() { - return new GlobalStreamId(this); - } - - @Override - public void clear() { - this.componentId = null; - this.streamId = null; - } - - public String get_componentId() { - return this.componentId; - } - - public void set_componentId(String componentId) { - this.componentId = componentId; - } - - public void unset_componentId() { - this.componentId = null; - } - - /** Returns true if field componentId is set (has been assigned a value) and false otherwise */ - public boolean is_set_componentId() { - return this.componentId != null; - } - - public void set_componentId_isSet(boolean value) { - if (!value) { - this.componentId = null; - } - } - - public String get_streamId() { - return this.streamId; - } - - public void set_streamId(String streamId) { - this.streamId = streamId; - } - - public void unset_streamId() { - this.streamId = null; - } - - /** Returns true if field streamId is set (has been assigned a value) and false otherwise */ - public boolean is_set_streamId() { - return this.streamId != null; - } - - public void set_streamId_isSet(boolean value) { - if (!value) { - this.streamId = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case COMPONENT_ID: - if (value == null) { - unset_componentId(); - } else { - set_componentId((String)value); - } - break; - - case STREAM_ID: - if (value == null) { - unset_streamId(); - } else { - set_streamId((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case COMPONENT_ID: - return get_componentId(); - - case STREAM_ID: - return get_streamId(); - - } - throw new 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(); - } - - switch (field) { - case COMPONENT_ID: - return is_set_componentId(); - case STREAM_ID: - return is_set_streamId(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GlobalStreamId) - return this.equals((GlobalStreamId)that); - return false; - } - - public boolean equals(GlobalStreamId that) { - if (that == null) - return false; - - boolean this_present_componentId = true && this.is_set_componentId(); - boolean that_present_componentId = true && that.is_set_componentId(); - if (this_present_componentId || that_present_componentId) { - if (!(this_present_componentId && that_present_componentId)) - return false; - if (!this.componentId.equals(that.componentId)) - return false; - } - - boolean this_present_streamId = true && this.is_set_streamId(); - boolean that_present_streamId = true && that.is_set_streamId(); - if (this_present_streamId || that_present_streamId) { - if (!(this_present_streamId && that_present_streamId)) - return false; - if (!this.streamId.equals(that.streamId)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_componentId = true && (is_set_componentId()); - builder.append(present_componentId); - if (present_componentId) - builder.append(componentId); - - boolean present_streamId = true && (is_set_streamId()); - builder.append(present_streamId); - if (present_streamId) - builder.append(streamId); - - return builder.toHashCode(); - } - - public int compareTo(GlobalStreamId other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - GlobalStreamId typedOther = (GlobalStreamId)other; - - lastComparison = Boolean.valueOf(is_set_componentId()).compareTo(typedOther.is_set_componentId()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_componentId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.componentId, typedOther.componentId); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_streamId()).compareTo(typedOther.is_set_streamId()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_streamId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.streamId, typedOther.streamId); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // COMPONENT_ID - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.componentId = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // STREAM_ID - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.streamId = 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.componentId != null) { - oprot.writeFieldBegin(COMPONENT_ID_FIELD_DESC); - oprot.writeString(this.componentId); - oprot.writeFieldEnd(); - } - if (this.streamId != null) { - oprot.writeFieldBegin(STREAM_ID_FIELD_DESC); - oprot.writeString(this.streamId); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GlobalStreamId("); - boolean first = true; - - sb.append("componentId:"); - if (this.componentId == null) { - sb.append("null"); - } else { - sb.append(this.componentId); - } - first = false; - if (!first) sb.append(", "); - sb.append("streamId:"); - if (this.streamId == null) { - sb.append("null"); - } else { - sb.append(this.streamId); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!is_set_componentId()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'componentId' is unset! Struct:" + toString()); - } - - if (!is_set_streamId()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'streamId' is unset! Struct:" + toString()); - } - - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - -} - +/** + * Autogenerated by Thrift Compiler (0.8.0) + * + * 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 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class GlobalStreamId implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GlobalStreamId"); + + private static final org.apache.thrift.protocol.TField COMPONENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("componentId", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField STREAM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("streamId", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new GlobalStreamIdStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GlobalStreamIdTupleSchemeFactory()); + } + + private String componentId; // required + private String streamId; // 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 { + COMPONENT_ID((short)1, "componentId"), + STREAM_ID((short)2, "streamId"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // COMPONENT_ID + return COMPONENT_ID; + case 2: // STREAM_ID + return STREAM_ID; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.COMPONENT_ID, new org.apache.thrift.meta_data.FieldMetaData("componentId", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.STREAM_ID, new org.apache.thrift.meta_data.FieldMetaData("streamId", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GlobalStreamId.class, metaDataMap); + } + + public GlobalStreamId() { + } + + public GlobalStreamId( + String componentId, + String streamId) + { + this(); + this.componentId = componentId; + this.streamId = streamId; + } + + /** + * Performs a deep copy on other. + */ + public GlobalStreamId(GlobalStreamId other) { + if (other.is_set_componentId()) { + this.componentId = other.componentId; + } + if (other.is_set_streamId()) { + this.streamId = other.streamId; + } + } + + public GlobalStreamId deepCopy() { + return new GlobalStreamId(this); + } + + @Override + public void clear() { + this.componentId = null; + this.streamId = null; + } + + public String get_componentId() { + return this.componentId; + } + + public void set_componentId(String componentId) { + this.componentId = componentId; + } + + public void unset_componentId() { + this.componentId = null; + } + + /** Returns true if field componentId is set (has been assigned a value) and false otherwise */ + public boolean is_set_componentId() { + return this.componentId != null; + } + + public void set_componentId_isSet(boolean value) { + if (!value) { + this.componentId = null; + } + } + + public String get_streamId() { + return this.streamId; + } + + public void set_streamId(String streamId) { + this.streamId = streamId; + } + + public void unset_streamId() { + this.streamId = null; + } + + /** Returns true if field streamId is set (has been assigned a value) and false otherwise */ + public boolean is_set_streamId() { + return this.streamId != null; + } + + public void set_streamId_isSet(boolean value) { + if (!value) { + this.streamId = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case COMPONENT_ID: + if (value == null) { + unset_componentId(); + } else { + set_componentId((String)value); + } + break; + + case STREAM_ID: + if (value == null) { + unset_streamId(); + } else { + set_streamId((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case COMPONENT_ID: + return get_componentId(); + + case STREAM_ID: + return get_streamId(); + + } + throw new 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(); + } + + switch (field) { + case COMPONENT_ID: + return is_set_componentId(); + case STREAM_ID: + return is_set_streamId(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof GlobalStreamId) + return this.equals((GlobalStreamId)that); + return false; + } + + public boolean equals(GlobalStreamId that) { + if (that == null) + return false; + + boolean this_present_componentId = true && this.is_set_componentId(); + boolean that_present_componentId = true && that.is_set_componentId(); + if (this_present_componentId || that_present_componentId) { + if (!(this_present_componentId && that_present_componentId)) + return false; + if (!this.componentId.equals(that.componentId)) + return false; + } + + boolean this_present_streamId = true && this.is_set_streamId(); + boolean that_present_streamId = true && that.is_set_streamId(); + if (this_present_streamId || that_present_streamId) { + if (!(this_present_streamId && that_present_streamId)) + return false; + if (!this.streamId.equals(that.streamId)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_componentId = true && (is_set_componentId()); + builder.append(present_componentId); + if (present_componentId) + builder.append(componentId); + + boolean present_streamId = true && (is_set_streamId()); + builder.append(present_streamId); + if (present_streamId) + builder.append(streamId); + + return builder.toHashCode(); + } + + public int compareTo(GlobalStreamId other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + GlobalStreamId typedOther = (GlobalStreamId)other; + + lastComparison = Boolean.valueOf(is_set_componentId()).compareTo(typedOther.is_set_componentId()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_componentId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.componentId, typedOther.componentId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_streamId()).compareTo(typedOther.is_set_streamId()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_streamId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.streamId, typedOther.streamId); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("GlobalStreamId("); + boolean first = true; + + sb.append("componentId:"); + if (this.componentId == null) { + sb.append("null"); + } else { + sb.append(this.componentId); + } + first = false; + if (!first) sb.append(", "); + sb.append("streamId:"); + if (this.streamId == null) { + sb.append("null"); + } else { + sb.append(this.streamId); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!is_set_componentId()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'componentId' is unset! Struct:" + toString()); + } + + if (!is_set_streamId()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'streamId' is unset! Struct:" + toString()); + } + + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 GlobalStreamIdStandardSchemeFactory implements SchemeFactory { + public GlobalStreamIdStandardScheme getScheme() { + return new GlobalStreamIdStandardScheme(); + } + } + + private static class GlobalStreamIdStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GlobalStreamId 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: // COMPONENT_ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.componentId = iprot.readString(); + struct.set_componentId_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // STREAM_ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.streamId = iprot.readString(); + struct.set_streamId_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, GlobalStreamId struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.componentId != null) { + oprot.writeFieldBegin(COMPONENT_ID_FIELD_DESC); + oprot.writeString(struct.componentId); + oprot.writeFieldEnd(); + } + if (struct.streamId != null) { + oprot.writeFieldBegin(STREAM_ID_FIELD_DESC); + oprot.writeString(struct.streamId); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class GlobalStreamIdTupleSchemeFactory implements SchemeFactory { + public GlobalStreamIdTupleScheme getScheme() { + return new GlobalStreamIdTupleScheme(); + } + } + + private static class GlobalStreamIdTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GlobalStreamId struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.componentId); + oprot.writeString(struct.streamId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, GlobalStreamId struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.componentId = iprot.readString(); + struct.set_componentId_isSet(true); + struct.streamId = iprot.readString(); + struct.set_streamId_isSet(true); + } + } + +} + diff --git a/jstorm-client/src/main/java/backtype/storm/generated/Grouping.java b/jstorm-client/src/main/java/backtype/storm/generated/Grouping.java index 69fcd3fd4..9276cd44d 100644 --- a/jstorm-client/src/main/java/backtype/storm/generated/Grouping.java +++ b/jstorm-client/src/main/java/backtype/storm/generated/Grouping.java @@ -1,662 +1,776 @@ -/** - * Autogenerated by Thrift Compiler (0.7.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - */ -package backtype.storm.generated; - -import org.apache.commons.lang.builder.HashCodeBuilder; -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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class Grouping extends org.apache.thrift.TUnion { - 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); - private static final org.apache.thrift.protocol.TField SHUFFLE_FIELD_DESC = new org.apache.thrift.protocol.TField("shuffle", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.protocol.TField ALL_FIELD_DESC = new org.apache.thrift.protocol.TField("all", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.protocol.TField NONE_FIELD_DESC = new org.apache.thrift.protocol.TField("none", org.apache.thrift.protocol.TType.STRUCT, (short)4); - private static final org.apache.thrift.protocol.TField DIRECT_FIELD_DESC = new org.apache.thrift.protocol.TField("direct", org.apache.thrift.protocol.TType.STRUCT, (short)5); - private static final org.apache.thrift.protocol.TField CUSTOM_OBJECT_FIELD_DESC = new org.apache.thrift.protocol.TField("custom_object", org.apache.thrift.protocol.TType.STRUCT, (short)6); - private static final org.apache.thrift.protocol.TField CUSTOM_SERIALIZED_FIELD_DESC = new org.apache.thrift.protocol.TField("custom_serialized", org.apache.thrift.protocol.TType.STRING, (short)7); - private static final org.apache.thrift.protocol.TField LOCAL_OR_SHUFFLE_FIELD_DESC = new org.apache.thrift.protocol.TField("local_or_shuffle", org.apache.thrift.protocol.TType.STRUCT, (short)8); - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - FIELDS((short)1, "fields"), - SHUFFLE((short)2, "shuffle"), - ALL((short)3, "all"), - NONE((short)4, "none"), - DIRECT((short)5, "direct"), - CUSTOM_OBJECT((short)6, "custom_object"), - CUSTOM_SERIALIZED((short)7, "custom_serialized"), - LOCAL_OR_SHUFFLE((short)8, "local_or_shuffle"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // FIELDS - return FIELDS; - case 2: // SHUFFLE - return SHUFFLE; - case 3: // ALL - return ALL; - case 4: // NONE - return NONE; - case 5: // DIRECT - return DIRECT; - case 6: // CUSTOM_OBJECT - return CUSTOM_OBJECT; - case 7: // CUSTOM_SERIALIZED - return CUSTOM_SERIALIZED; - case 8: // LOCAL_OR_SHUFFLE - return LOCAL_OR_SHUFFLE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - 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); - tmpMap.put(_Fields.FIELDS, new org.apache.thrift.meta_data.FieldMetaData("fields", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - tmpMap.put(_Fields.SHUFFLE, new org.apache.thrift.meta_data.FieldMetaData("shuffle", org.apache.thrift.TFieldRequirementType.DEFAULT, - 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, - 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, - 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, - 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, - 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, - 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, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, NullStruct.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Grouping.class, metaDataMap); - } - - public Grouping() { - super(); - } - - public Grouping(_Fields setField, Object value) { - super(setField, value); - } - - public Grouping(Grouping other) { - super(other); - } - public Grouping deepCopy() { - return new Grouping(this); - } - - public static Grouping fields(List value) { - Grouping x = new Grouping(); - x.set_fields(value); - return x; - } - - public static Grouping shuffle(NullStruct value) { - Grouping x = new Grouping(); - x.set_shuffle(value); - return x; - } - - public static Grouping all(NullStruct value) { - Grouping x = new Grouping(); - x.set_all(value); - return x; - } - - public static Grouping none(NullStruct value) { - Grouping x = new Grouping(); - x.set_none(value); - return x; - } - - public static Grouping direct(NullStruct value) { - Grouping x = new Grouping(); - x.set_direct(value); - return x; - } - - public static Grouping custom_object(JavaObject value) { - Grouping x = new Grouping(); - x.set_custom_object(value); - return x; - } - - public static Grouping custom_serialized(ByteBuffer value) { - Grouping x = new Grouping(); - x.set_custom_serialized(value); - return x; - } - - public static Grouping custom_serialized(byte[] value) { - Grouping x = new Grouping(); - x.set_custom_serialized(ByteBuffer.wrap(value)); - return x; - } - - public static Grouping local_or_shuffle(NullStruct value) { - Grouping x = new Grouping(); - x.set_local_or_shuffle(value); - return x; - } - - - @Override - protected void checkType(_Fields setField, Object value) throws ClassCastException { - switch (setField) { - case FIELDS: - if (value instanceof List) { - break; - } - throw new ClassCastException("Was expecting value of type List 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()); - case ALL: - if (value instanceof NullStruct) { - break; - } - throw new 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()); - case DIRECT: - if (value instanceof NullStruct) { - break; - } - throw new 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()); - case CUSTOM_SERIALIZED: - if (value instanceof ByteBuffer) { - break; - } - throw new ClassCastException("Was expecting value of type 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()); - default: - throw new IllegalArgumentException("Unknown field id " + setField); - } - } - - @Override - protected Object readValue(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 fields; - { - org.apache.thrift.protocol.TList _list4 = iprot.readListBegin(); - fields = new ArrayList(_list4.size); - for (int _i5 = 0; _i5 < _list4.size; ++_i5) - { - String _elem6; // required - _elem6 = iprot.readString(); - fields.add(_elem6); - } - iprot.readListEnd(); - } - return fields; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case SHUFFLE: - if (field.type == SHUFFLE_FIELD_DESC.type) { - NullStruct shuffle; - shuffle = new NullStruct(); - shuffle.read(iprot); - return shuffle; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case ALL: - if (field.type == ALL_FIELD_DESC.type) { - NullStruct all; - all = new NullStruct(); - all.read(iprot); - return all; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case NONE: - if (field.type == NONE_FIELD_DESC.type) { - NullStruct none; - none = new NullStruct(); - none.read(iprot); - return none; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case DIRECT: - if (field.type == DIRECT_FIELD_DESC.type) { - NullStruct direct; - direct = new NullStruct(); - direct.read(iprot); - return direct; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case CUSTOM_OBJECT: - if (field.type == CUSTOM_OBJECT_FIELD_DESC.type) { - JavaObject custom_object; - custom_object = new JavaObject(); - custom_object.read(iprot); - return custom_object; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case CUSTOM_SERIALIZED: - if (field.type == CUSTOM_SERIALIZED_FIELD_DESC.type) { - ByteBuffer custom_serialized; - custom_serialized = iprot.readBinary(); - return custom_serialized; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case LOCAL_OR_SHUFFLE: - if (field.type == LOCAL_OR_SHUFFLE_FIELD_DESC.type) { - NullStruct local_or_shuffle; - local_or_shuffle = new NullStruct(); - local_or_shuffle.read(iprot); - return local_or_shuffle; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - default: - throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - } - - @Override - protected void writeValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - switch (setField_) { - case FIELDS: - List fields = (List)value_; - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, fields.size())); - for (String _iter7 : fields) - { - oprot.writeString(_iter7); - } - 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 org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { - switch (setField) { - case FIELDS: - return FIELDS_FIELD_DESC; - case SHUFFLE: - return SHUFFLE_FIELD_DESC; - case ALL: - return ALL_FIELD_DESC; - case NONE: - return NONE_FIELD_DESC; - case DIRECT: - return DIRECT_FIELD_DESC; - case CUSTOM_OBJECT: - return CUSTOM_OBJECT_FIELD_DESC; - case CUSTOM_SERIALIZED: - return CUSTOM_SERIALIZED_FIELD_DESC; - case LOCAL_OR_SHUFFLE: - return LOCAL_OR_SHUFFLE_FIELD_DESC; - default: - throw new IllegalArgumentException("Unknown field id " + setField); - } - } - - @Override - protected org.apache.thrift.protocol.TStruct getStructDesc() { - return STRUCT_DESC; - } - - @Override - protected _Fields enumForId(short id) { - return _Fields.findByThriftIdOrThrow(id); - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - - public List get_fields() { - if (getSetField() == _Fields.FIELDS) { - return (List)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'fields' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void set_fields(List value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.FIELDS; - value_ = value; - } - - public NullStruct get_shuffle() { - if (getSetField() == _Fields.SHUFFLE) { - return (NullStruct)getFieldValue(); - } else { - throw new 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(); - setField_ = _Fields.SHUFFLE; - value_ = value; - } - - public NullStruct get_all() { - if (getSetField() == _Fields.ALL) { - return (NullStruct)getFieldValue(); - } else { - throw new 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(); - setField_ = _Fields.ALL; - value_ = value; - } - - public NullStruct get_none() { - if (getSetField() == _Fields.NONE) { - return (NullStruct)getFieldValue(); - } else { - throw new 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(); - setField_ = _Fields.NONE; - value_ = value; - } - - public NullStruct get_direct() { - if (getSetField() == _Fields.DIRECT) { - return (NullStruct)getFieldValue(); - } else { - throw new 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(); - setField_ = _Fields.DIRECT; - value_ = value; - } - - public JavaObject get_custom_object() { - 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); - } - } - - public void set_custom_object(JavaObject value) { - if (value == null) throw new 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(); - return b == null ? null : b.array(); - } - - public ByteBuffer buffer_for_custom_serialized() { - if (getSetField() == _Fields.CUSTOM_SERIALIZED) { - return (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)); - } - - public void set_custom_serialized(ByteBuffer value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.CUSTOM_SERIALIZED; - value_ = value; - } - - public NullStruct get_local_or_shuffle() { - 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); - } - } - - public void set_local_or_shuffle(NullStruct value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.LOCAL_OR_SHUFFLE; - value_ = value; - } - - public boolean is_set_fields() { - return setField_ == _Fields.FIELDS; - } - - - public boolean is_set_shuffle() { - return setField_ == _Fields.SHUFFLE; - } - - - public boolean is_set_all() { - return setField_ == _Fields.ALL; - } - - - public boolean is_set_none() { - return setField_ == _Fields.NONE; - } - - - public boolean is_set_direct() { - return setField_ == _Fields.DIRECT; - } - - - public boolean is_set_custom_object() { - return setField_ == _Fields.CUSTOM_OBJECT; - } - - - public boolean is_set_custom_serialized() { - return setField_ == _Fields.CUSTOM_SERIALIZED; - } - - - public boolean is_set_local_or_shuffle() { - return setField_ == _Fields.LOCAL_OR_SHUFFLE; - } - - - public boolean equals(Object other) { - if (other instanceof Grouping) { - return equals((Grouping)other); - } else { - return false; - } - } - - public boolean equals(Grouping other) { - return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); - } - - @Override - public int compareTo(Grouping other) { - int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); - if (lastComparison == 0) { - return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); - } - return lastComparison; - } - - - @Override - public int hashCode() { - HashCodeBuilder hcb = new HashCodeBuilder(); - hcb.append(this.getClass().getName()); - org.apache.thrift.TFieldIdEnum setField = getSetField(); - if (setField != null) { - hcb.append(setField.getThriftFieldId()); - Object value = getFieldValue(); - if (value instanceof org.apache.thrift.TEnum) { - hcb.append(((org.apache.thrift.TEnum)getFieldValue()).getValue()); - } else { - hcb.append(value); - } - } - return hcb.toHashCode(); - } - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - -} +/** + * Autogenerated by Thrift Compiler (0.8.0) + * + * 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 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class Grouping extends org.apache.thrift.TUnion { + 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); + private static final org.apache.thrift.protocol.TField SHUFFLE_FIELD_DESC = new org.apache.thrift.protocol.TField("shuffle", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField ALL_FIELD_DESC = new org.apache.thrift.protocol.TField("all", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final org.apache.thrift.protocol.TField NONE_FIELD_DESC = new org.apache.thrift.protocol.TField("none", org.apache.thrift.protocol.TType.STRUCT, (short)4); + private static final org.apache.thrift.protocol.TField DIRECT_FIELD_DESC = new org.apache.thrift.protocol.TField("direct", org.apache.thrift.protocol.TType.STRUCT, (short)5); + private static final org.apache.thrift.protocol.TField CUSTOM_OBJECT_FIELD_DESC = new org.apache.thrift.protocol.TField("custom_object", org.apache.thrift.protocol.TType.STRUCT, (short)6); + private static final org.apache.thrift.protocol.TField CUSTOM_SERIALIZED_FIELD_DESC = new org.apache.thrift.protocol.TField("custom_serialized", org.apache.thrift.protocol.TType.STRING, (short)7); + private static final org.apache.thrift.protocol.TField LOCAL_OR_SHUFFLE_FIELD_DESC = new org.apache.thrift.protocol.TField("local_or_shuffle", org.apache.thrift.protocol.TType.STRUCT, (short)8); + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + FIELDS((short)1, "fields"), + SHUFFLE((short)2, "shuffle"), + ALL((short)3, "all"), + NONE((short)4, "none"), + DIRECT((short)5, "direct"), + CUSTOM_OBJECT((short)6, "custom_object"), + CUSTOM_SERIALIZED((short)7, "custom_serialized"), + LOCAL_OR_SHUFFLE((short)8, "local_or_shuffle"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // FIELDS + return FIELDS; + case 2: // SHUFFLE + return SHUFFLE; + case 3: // ALL + return ALL; + case 4: // NONE + return NONE; + case 5: // DIRECT + return DIRECT; + case 6: // CUSTOM_OBJECT + return CUSTOM_OBJECT; + case 7: // CUSTOM_SERIALIZED + return CUSTOM_SERIALIZED; + case 8: // LOCAL_OR_SHUFFLE + return LOCAL_OR_SHUFFLE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + 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); + tmpMap.put(_Fields.FIELDS, new org.apache.thrift.meta_data.FieldMetaData("fields", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + tmpMap.put(_Fields.SHUFFLE, new org.apache.thrift.meta_data.FieldMetaData("shuffle", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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, + 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, + 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, + 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, + 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, + 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, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, NullStruct.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Grouping.class, metaDataMap); + } + + public Grouping() { + super(); + } + + public Grouping(_Fields setField, Object value) { + super(setField, value); + } + + public Grouping(Grouping other) { + super(other); + } + public Grouping deepCopy() { + return new Grouping(this); + } + + public static Grouping fields(List value) { + Grouping x = new Grouping(); + x.set_fields(value); + return x; + } + + public static Grouping shuffle(NullStruct value) { + Grouping x = new Grouping(); + x.set_shuffle(value); + return x; + } + + public static Grouping all(NullStruct value) { + Grouping x = new Grouping(); + x.set_all(value); + return x; + } + + public static Grouping none(NullStruct value) { + Grouping x = new Grouping(); + x.set_none(value); + return x; + } + + public static Grouping direct(NullStruct value) { + Grouping x = new Grouping(); + x.set_direct(value); + return x; + } + + public static Grouping custom_object(JavaObject value) { + Grouping x = new Grouping(); + x.set_custom_object(value); + return x; + } + + public static Grouping custom_serialized(ByteBuffer value) { + Grouping x = new Grouping(); + x.set_custom_serialized(value); + return x; + } + + public static Grouping custom_serialized(byte[] value) { + Grouping x = new Grouping(); + x.set_custom_serialized(ByteBuffer.wrap(value)); + return x; + } + + public static Grouping local_or_shuffle(NullStruct value) { + Grouping x = new Grouping(); + x.set_local_or_shuffle(value); + return x; + } + + + @Override + protected void checkType(_Fields setField, Object value) throws ClassCastException { + switch (setField) { + case FIELDS: + if (value instanceof List) { + break; + } + throw new ClassCastException("Was expecting value of type List 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()); + case ALL: + if (value instanceof NullStruct) { + break; + } + throw new 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()); + case DIRECT: + if (value instanceof NullStruct) { + break; + } + throw new 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()); + case CUSTOM_SERIALIZED: + if (value instanceof ByteBuffer) { + break; + } + throw new ClassCastException("Was expecting value of type 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()); + default: + throw new 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 { + _Fields setField = _Fields.findByThriftId(field.id); + if (setField != null) { + switch (setField) { + case FIELDS: + if (field.type == FIELDS_FIELD_DESC.type) { + List fields; + { + org.apache.thrift.protocol.TList _list8 = iprot.readListBegin(); + fields = new ArrayList(_list8.size); + for (int _i9 = 0; _i9 < _list8.size; ++_i9) + { + String _elem10; // required + _elem10 = iprot.readString(); + fields.add(_elem10); + } + iprot.readListEnd(); + } + return fields; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case SHUFFLE: + if (field.type == SHUFFLE_FIELD_DESC.type) { + NullStruct shuffle; + shuffle = new NullStruct(); + shuffle.read(iprot); + return shuffle; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case ALL: + if (field.type == ALL_FIELD_DESC.type) { + NullStruct all; + all = new NullStruct(); + all.read(iprot); + return all; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case NONE: + if (field.type == NONE_FIELD_DESC.type) { + NullStruct none; + none = new NullStruct(); + none.read(iprot); + return none; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case DIRECT: + if (field.type == DIRECT_FIELD_DESC.type) { + NullStruct direct; + direct = new NullStruct(); + direct.read(iprot); + return direct; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case CUSTOM_OBJECT: + if (field.type == CUSTOM_OBJECT_FIELD_DESC.type) { + JavaObject custom_object; + custom_object = new JavaObject(); + custom_object.read(iprot); + return custom_object; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case CUSTOM_SERIALIZED: + if (field.type == CUSTOM_SERIALIZED_FIELD_DESC.type) { + ByteBuffer custom_serialized; + custom_serialized = iprot.readBinary(); + return custom_serialized; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case LOCAL_OR_SHUFFLE: + if (field.type == LOCAL_OR_SHUFFLE_FIELD_DESC.type) { + NullStruct local_or_shuffle; + local_or_shuffle = new NullStruct(); + local_or_shuffle.read(iprot); + return local_or_shuffle; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + default: + throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + } + } else { + return null; + } + } + + @Override + protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + switch (setField_) { + case FIELDS: + List fields = (List)value_; + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, fields.size())); + for (String _iter11 : fields) + { + 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 fields; + { + org.apache.thrift.protocol.TList _list12 = iprot.readListBegin(); + fields = new ArrayList(_list12.size); + for (int _i13 = 0; _i13 < _list12.size; ++_i13) + { + String _elem14; // required + _elem14 = iprot.readString(); + fields.add(_elem14); + } + 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 { + return null; + } + } + + @Override + protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + switch (setField_) { + case FIELDS: + List fields = (List)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(); + } + 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 org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { + switch (setField) { + case FIELDS: + return FIELDS_FIELD_DESC; + case SHUFFLE: + return SHUFFLE_FIELD_DESC; + case ALL: + return ALL_FIELD_DESC; + case NONE: + return NONE_FIELD_DESC; + case DIRECT: + return DIRECT_FIELD_DESC; + case CUSTOM_OBJECT: + return CUSTOM_OBJECT_FIELD_DESC; + case CUSTOM_SERIALIZED: + return CUSTOM_SERIALIZED_FIELD_DESC; + case LOCAL_OR_SHUFFLE: + return LOCAL_OR_SHUFFLE_FIELD_DESC; + default: + throw new IllegalArgumentException("Unknown field id " + setField); + } + } + + @Override + protected org.apache.thrift.protocol.TStruct getStructDesc() { + return STRUCT_DESC; + } + + @Override + protected _Fields enumForId(short id) { + return _Fields.findByThriftIdOrThrow(id); + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + + public List get_fields() { + if (getSetField() == _Fields.FIELDS) { + return (List)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'fields' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void set_fields(List value) { + if (value == null) throw new NullPointerException(); + setField_ = _Fields.FIELDS; + value_ = value; + } + + public NullStruct get_shuffle() { + if (getSetField() == _Fields.SHUFFLE) { + return (NullStruct)getFieldValue(); + } else { + throw new 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(); + setField_ = _Fields.SHUFFLE; + value_ = value; + } + + public NullStruct get_all() { + if (getSetField() == _Fields.ALL) { + return (NullStruct)getFieldValue(); + } else { + throw new 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(); + setField_ = _Fields.ALL; + value_ = value; + } + + public NullStruct get_none() { + if (getSetField() == _Fields.NONE) { + return (NullStruct)getFieldValue(); + } else { + throw new 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(); + setField_ = _Fields.NONE; + value_ = value; + } + + public NullStruct get_direct() { + if (getSetField() == _Fields.DIRECT) { + return (NullStruct)getFieldValue(); + } else { + throw new 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(); + setField_ = _Fields.DIRECT; + value_ = value; + } + + public JavaObject get_custom_object() { + 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); + } + } + + public void set_custom_object(JavaObject value) { + if (value == null) throw new 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(); + return b == null ? null : b.array(); + } + + public ByteBuffer buffer_for_custom_serialized() { + if (getSetField() == _Fields.CUSTOM_SERIALIZED) { + return (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)); + } + + public void set_custom_serialized(ByteBuffer value) { + if (value == null) throw new NullPointerException(); + setField_ = _Fields.CUSTOM_SERIALIZED; + value_ = value; + } + + public NullStruct get_local_or_shuffle() { + 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); + } + } + + public void set_local_or_shuffle(NullStruct value) { + if (value == null) throw new NullPointerException(); + setField_ = _Fields.LOCAL_OR_SHUFFLE; + value_ = value; + } + + public boolean is_set_fields() { + return setField_ == _Fields.FIELDS; + } + + + public boolean is_set_shuffle() { + return setField_ == _Fields.SHUFFLE; + } + + + public boolean is_set_all() { + return setField_ == _Fields.ALL; + } + + + public boolean is_set_none() { + return setField_ == _Fields.NONE; + } + + + public boolean is_set_direct() { + return setField_ == _Fields.DIRECT; + } + + + public boolean is_set_custom_object() { + return setField_ == _Fields.CUSTOM_OBJECT; + } + + + public boolean is_set_custom_serialized() { + return setField_ == _Fields.CUSTOM_SERIALIZED; + } + + + public boolean is_set_local_or_shuffle() { + return setField_ == _Fields.LOCAL_OR_SHUFFLE; + } + + + public boolean equals(Object other) { + if (other instanceof Grouping) { + return equals((Grouping)other); + } else { + return false; + } + } + + public boolean equals(Grouping other) { + return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); + } + + @Override + public int compareTo(Grouping other) { + int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); + if (lastComparison == 0) { + return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); + } + return lastComparison; + } + + + @Override + public int hashCode() { + HashCodeBuilder hcb = new HashCodeBuilder(); + hcb.append(this.getClass().getName()); + org.apache.thrift.TFieldIdEnum setField = getSetField(); + if (setField != null) { + hcb.append(setField.getThriftFieldId()); + Object value = getFieldValue(); + if (value instanceof org.apache.thrift.TEnum) { + hcb.append(((org.apache.thrift.TEnum)getFieldValue()).getValue()); + } else { + hcb.append(value); + } + } + return hcb.toHashCode(); + } + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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); + } + } + + +} diff --git a/jstorm-client/src/main/java/backtype/storm/generated/InvalidTopologyException.java b/jstorm-client/src/main/java/backtype/storm/generated/InvalidTopologyException.java index 54a9ed72a..957594817 100644 --- a/jstorm-client/src/main/java/backtype/storm/generated/InvalidTopologyException.java +++ b/jstorm-client/src/main/java/backtype/storm/generated/InvalidTopologyException.java @@ -1,328 +1,381 @@ -/** - * Autogenerated by Thrift Compiler (0.7.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - */ -package backtype.storm.generated; - -import org.apache.commons.lang.builder.HashCodeBuilder; -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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class InvalidTopologyException extends Exception implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - 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 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 byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // MSG - return MSG; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - 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); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(InvalidTopologyException.class, metaDataMap); - } - - public InvalidTopologyException() { - } - - public InvalidTopologyException( - String msg) - { - this(); - this.msg = msg; - } - - /** - * Performs a deep copy on other. - */ - public InvalidTopologyException(InvalidTopologyException other) { - if (other.is_set_msg()) { - this.msg = other.msg; - } - } - - public InvalidTopologyException deepCopy() { - return new InvalidTopologyException(this); - } - - @Override - public void clear() { - this.msg = null; - } - - public String get_msg() { - return this.msg; - } - - public void set_msg(String msg) { - this.msg = msg; - } - - public void unset_msg() { - this.msg = null; - } - - /** Returns true if field msg is set (has been assigned a value) and false otherwise */ - public boolean is_set_msg() { - return this.msg != null; - } - - public void set_msg_isSet(boolean value) { - if (!value) { - this.msg = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case MSG: - if (value == null) { - unset_msg(); - } else { - set_msg((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case MSG: - return get_msg(); - - } - throw new 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(); - } - - switch (field) { - case MSG: - return is_set_msg(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof InvalidTopologyException) - return this.equals((InvalidTopologyException)that); - return false; - } - - public boolean equals(InvalidTopologyException that) { - if (that == null) - return false; - - boolean this_present_msg = true && this.is_set_msg(); - boolean that_present_msg = true && that.is_set_msg(); - if (this_present_msg || that_present_msg) { - if (!(this_present_msg && that_present_msg)) - return false; - if (!this.msg.equals(that.msg)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_msg = true && (is_set_msg()); - builder.append(present_msg); - if (present_msg) - builder.append(msg); - - return builder.toHashCode(); - } - - 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()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_msg()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.msg, typedOther.msg); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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(); - } - - 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(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("InvalidTopologyException("); - boolean first = true; - - sb.append("msg:"); - if (this.msg == null) { - sb.append("null"); - } else { - sb.append(this.msg); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!is_set_msg()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'msg' is unset! Struct:" + toString()); - } - - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - -} - +/** + * Autogenerated by Thrift Compiler (0.8.0) + * + * 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 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class InvalidTopologyException extends Exception implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + 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, SchemeFactory> schemes = new HashMap, 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. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + MSG((short)1, "msg"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // MSG + return MSG; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + 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); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(InvalidTopologyException.class, metaDataMap); + } + + public InvalidTopologyException() { + } + + public InvalidTopologyException( + String msg) + { + this(); + this.msg = msg; + } + + /** + * Performs a deep copy on other. + */ + public InvalidTopologyException(InvalidTopologyException other) { + if (other.is_set_msg()) { + this.msg = other.msg; + } + } + + public InvalidTopologyException deepCopy() { + return new InvalidTopologyException(this); + } + + @Override + public void clear() { + this.msg = null; + } + + public String get_msg() { + return this.msg; + } + + public void set_msg(String msg) { + this.msg = msg; + } + + public void unset_msg() { + this.msg = null; + } + + /** Returns true if field msg is set (has been assigned a value) and false otherwise */ + public boolean is_set_msg() { + return this.msg != null; + } + + public void set_msg_isSet(boolean value) { + if (!value) { + this.msg = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case MSG: + if (value == null) { + unset_msg(); + } else { + set_msg((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case MSG: + return get_msg(); + + } + throw new 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(); + } + + switch (field) { + case MSG: + return is_set_msg(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof InvalidTopologyException) + return this.equals((InvalidTopologyException)that); + return false; + } + + public boolean equals(InvalidTopologyException that) { + if (that == null) + return false; + + boolean this_present_msg = true && this.is_set_msg(); + boolean that_present_msg = true && that.is_set_msg(); + if (this_present_msg || that_present_msg) { + if (!(this_present_msg && that_present_msg)) + return false; + if (!this.msg.equals(that.msg)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_msg = true && (is_set_msg()); + builder.append(present_msg); + if (present_msg) + builder.append(msg); + + return builder.toHashCode(); + } + + 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()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_msg()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.msg, typedOther.msg); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("InvalidTopologyException("); + boolean first = true; + + sb.append("msg:"); + if (this.msg == null) { + sb.append("null"); + } else { + sb.append(this.msg); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!is_set_msg()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'msg' is unset! Struct:" + toString()); + } + + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 InvalidTopologyExceptionStandardSchemeFactory implements SchemeFactory { + public InvalidTopologyExceptionStandardScheme getScheme() { + return new InvalidTopologyExceptionStandardScheme(); + } + } + + private static class InvalidTopologyExceptionStandardScheme extends StandardScheme { + + 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 { + + @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); + } + } + +} + diff --git a/jstorm-client/src/main/java/backtype/storm/generated/JavaObject.java b/jstorm-client/src/main/java/backtype/storm/generated/JavaObject.java index 5f933eab3..9fdd9db28 100644 --- a/jstorm-client/src/main/java/backtype/storm/generated/JavaObject.java +++ b/jstorm-client/src/main/java/backtype/storm/generated/JavaObject.java @@ -1,463 +1,536 @@ -/** - * Autogenerated by Thrift Compiler (0.7.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - */ -package backtype.storm.generated; - -import org.apache.commons.lang.builder.HashCodeBuilder; -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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class JavaObject implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - 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 String full_class_name; // required - private List args_list; // 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 { - FULL_CLASS_NAME((short)1, "full_class_name"), - ARGS_LIST((short)2, "args_list"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // FULL_CLASS_NAME - return FULL_CLASS_NAME; - case 2: // ARGS_LIST - return ARGS_LIST; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.FULL_CLASS_NAME, new org.apache.thrift.meta_data.FieldMetaData("full_class_name", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.ARGS_LIST, new org.apache.thrift.meta_data.FieldMetaData("args_list", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, JavaObjectArg.class)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(JavaObject.class, metaDataMap); - } - - public JavaObject() { - } - - public JavaObject( - String full_class_name, - List args_list) - { - this(); - this.full_class_name = full_class_name; - this.args_list = args_list; - } - - /** - * Performs a deep copy on other. - */ - public JavaObject(JavaObject other) { - if (other.is_set_full_class_name()) { - this.full_class_name = other.full_class_name; - } - if (other.is_set_args_list()) { - List __this__args_list = new ArrayList(); - for (JavaObjectArg other_element : other.args_list) { - __this__args_list.add(new JavaObjectArg(other_element)); - } - this.args_list = __this__args_list; - } - } - - public JavaObject deepCopy() { - return new JavaObject(this); - } - - @Override - public void clear() { - this.full_class_name = null; - this.args_list = null; - } - - public String get_full_class_name() { - return this.full_class_name; - } - - public void set_full_class_name(String full_class_name) { - this.full_class_name = full_class_name; - } - - public void unset_full_class_name() { - this.full_class_name = null; - } - - /** Returns true if field full_class_name is set (has been assigned a value) and false otherwise */ - public boolean is_set_full_class_name() { - return this.full_class_name != null; - } - - public void set_full_class_name_isSet(boolean value) { - if (!value) { - this.full_class_name = null; - } - } - - public int get_args_list_size() { - return (this.args_list == null) ? 0 : this.args_list.size(); - } - - public java.util.Iterator get_args_list_iterator() { - return (this.args_list == null) ? null : this.args_list.iterator(); - } - - public void add_to_args_list(JavaObjectArg elem) { - if (this.args_list == null) { - this.args_list = new ArrayList(); - } - this.args_list.add(elem); - } - - public List get_args_list() { - return this.args_list; - } - - public void set_args_list(List args_list) { - this.args_list = args_list; - } - - public void unset_args_list() { - this.args_list = null; - } - - /** Returns true if field args_list is set (has been assigned a value) and false otherwise */ - public boolean is_set_args_list() { - return this.args_list != null; - } - - public void set_args_list_isSet(boolean value) { - if (!value) { - this.args_list = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case FULL_CLASS_NAME: - if (value == null) { - unset_full_class_name(); - } else { - set_full_class_name((String)value); - } - break; - - case ARGS_LIST: - if (value == null) { - unset_args_list(); - } else { - set_args_list((List)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case FULL_CLASS_NAME: - return get_full_class_name(); - - case ARGS_LIST: - return get_args_list(); - - } - throw new 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(); - } - - switch (field) { - case FULL_CLASS_NAME: - return is_set_full_class_name(); - case ARGS_LIST: - return is_set_args_list(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof JavaObject) - return this.equals((JavaObject)that); - return false; - } - - public boolean equals(JavaObject that) { - if (that == null) - return false; - - boolean this_present_full_class_name = true && this.is_set_full_class_name(); - boolean that_present_full_class_name = true && that.is_set_full_class_name(); - if (this_present_full_class_name || that_present_full_class_name) { - if (!(this_present_full_class_name && that_present_full_class_name)) - return false; - if (!this.full_class_name.equals(that.full_class_name)) - return false; - } - - boolean this_present_args_list = true && this.is_set_args_list(); - boolean that_present_args_list = true && that.is_set_args_list(); - if (this_present_args_list || that_present_args_list) { - if (!(this_present_args_list && that_present_args_list)) - return false; - if (!this.args_list.equals(that.args_list)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_full_class_name = true && (is_set_full_class_name()); - builder.append(present_full_class_name); - if (present_full_class_name) - builder.append(full_class_name); - - boolean present_args_list = true && (is_set_args_list()); - builder.append(present_args_list); - if (present_args_list) - builder.append(args_list); - - return builder.toHashCode(); - } - - 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()); - 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); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_args_list()).compareTo(typedOther.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); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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(_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(); - } - - 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(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("JavaObject("); - boolean first = true; - - sb.append("full_class_name:"); - if (this.full_class_name == null) { - sb.append("null"); - } else { - sb.append(this.full_class_name); - } - first = false; - if (!first) sb.append(", "); - sb.append("args_list:"); - if (this.args_list == null) { - sb.append("null"); - } else { - sb.append(this.args_list); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!is_set_full_class_name()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'full_class_name' is unset! Struct:" + toString()); - } - - if (!is_set_args_list()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'args_list' is unset! Struct:" + toString()); - } - - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - -} - +/** + * Autogenerated by Thrift Compiler (0.8.0) + * + * 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 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class JavaObject implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + 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, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new JavaObjectStandardSchemeFactory()); + schemes.put(TupleScheme.class, new JavaObjectTupleSchemeFactory()); + } + + private String full_class_name; // required + private List args_list; // 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 { + FULL_CLASS_NAME((short)1, "full_class_name"), + ARGS_LIST((short)2, "args_list"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // FULL_CLASS_NAME + return FULL_CLASS_NAME; + case 2: // ARGS_LIST + return ARGS_LIST; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.FULL_CLASS_NAME, new org.apache.thrift.meta_data.FieldMetaData("full_class_name", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.ARGS_LIST, new org.apache.thrift.meta_data.FieldMetaData("args_list", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, JavaObjectArg.class)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(JavaObject.class, metaDataMap); + } + + public JavaObject() { + } + + public JavaObject( + String full_class_name, + List args_list) + { + this(); + this.full_class_name = full_class_name; + this.args_list = args_list; + } + + /** + * Performs a deep copy on other. + */ + public JavaObject(JavaObject other) { + if (other.is_set_full_class_name()) { + this.full_class_name = other.full_class_name; + } + if (other.is_set_args_list()) { + List __this__args_list = new ArrayList(); + for (JavaObjectArg other_element : other.args_list) { + __this__args_list.add(new JavaObjectArg(other_element)); + } + this.args_list = __this__args_list; + } + } + + public JavaObject deepCopy() { + return new JavaObject(this); + } + + @Override + public void clear() { + this.full_class_name = null; + this.args_list = null; + } + + public String get_full_class_name() { + return this.full_class_name; + } + + public void set_full_class_name(String full_class_name) { + this.full_class_name = full_class_name; + } + + public void unset_full_class_name() { + this.full_class_name = null; + } + + /** Returns true if field full_class_name is set (has been assigned a value) and false otherwise */ + public boolean is_set_full_class_name() { + return this.full_class_name != null; + } + + public void set_full_class_name_isSet(boolean value) { + if (!value) { + this.full_class_name = null; + } + } + + public int get_args_list_size() { + return (this.args_list == null) ? 0 : this.args_list.size(); + } + + public java.util.Iterator get_args_list_iterator() { + return (this.args_list == null) ? null : this.args_list.iterator(); + } + + public void add_to_args_list(JavaObjectArg elem) { + if (this.args_list == null) { + this.args_list = new ArrayList(); + } + this.args_list.add(elem); + } + + public List get_args_list() { + return this.args_list; + } + + public void set_args_list(List args_list) { + this.args_list = args_list; + } + + public void unset_args_list() { + this.args_list = null; + } + + /** Returns true if field args_list is set (has been assigned a value) and false otherwise */ + public boolean is_set_args_list() { + return this.args_list != null; + } + + public void set_args_list_isSet(boolean value) { + if (!value) { + this.args_list = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case FULL_CLASS_NAME: + if (value == null) { + unset_full_class_name(); + } else { + set_full_class_name((String)value); + } + break; + + case ARGS_LIST: + if (value == null) { + unset_args_list(); + } else { + set_args_list((List)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case FULL_CLASS_NAME: + return get_full_class_name(); + + case ARGS_LIST: + return get_args_list(); + + } + throw new 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(); + } + + switch (field) { + case FULL_CLASS_NAME: + return is_set_full_class_name(); + case ARGS_LIST: + return is_set_args_list(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof JavaObject) + return this.equals((JavaObject)that); + return false; + } + + public boolean equals(JavaObject that) { + if (that == null) + return false; + + boolean this_present_full_class_name = true && this.is_set_full_class_name(); + boolean that_present_full_class_name = true && that.is_set_full_class_name(); + if (this_present_full_class_name || that_present_full_class_name) { + if (!(this_present_full_class_name && that_present_full_class_name)) + return false; + if (!this.full_class_name.equals(that.full_class_name)) + return false; + } + + boolean this_present_args_list = true && this.is_set_args_list(); + boolean that_present_args_list = true && that.is_set_args_list(); + if (this_present_args_list || that_present_args_list) { + if (!(this_present_args_list && that_present_args_list)) + return false; + if (!this.args_list.equals(that.args_list)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_full_class_name = true && (is_set_full_class_name()); + builder.append(present_full_class_name); + if (present_full_class_name) + builder.append(full_class_name); + + boolean present_args_list = true && (is_set_args_list()); + builder.append(present_args_list); + if (present_args_list) + builder.append(args_list); + + return builder.toHashCode(); + } + + 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()); + 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); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_args_list()).compareTo(typedOther.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); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("JavaObject("); + boolean first = true; + + sb.append("full_class_name:"); + if (this.full_class_name == null) { + sb.append("null"); + } else { + sb.append(this.full_class_name); + } + first = false; + if (!first) sb.append(", "); + sb.append("args_list:"); + if (this.args_list == null) { + sb.append("null"); + } else { + sb.append(this.args_list); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!is_set_full_class_name()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'full_class_name' is unset! Struct:" + toString()); + } + + if (!is_set_args_list()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'args_list' is unset! Struct:" + toString()); + } + + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 JavaObjectStandardSchemeFactory implements SchemeFactory { + public JavaObjectStandardScheme getScheme() { + return new JavaObjectStandardScheme(); + } + } + + private static class JavaObjectStandardScheme extends StandardScheme { + + 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(_list0.size); + for (int _i1 = 0; _i1 < _list0.size; ++_i1) + { + JavaObjectArg _elem2; // required + _elem2 = new JavaObjectArg(); + _elem2.read(iprot); + struct.args_list.add(_elem2); + } + 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 { + + @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(_list5.size); + for (int _i6 = 0; _i6 < _list5.size; ++_i6) + { + JavaObjectArg _elem7; // required + _elem7 = new JavaObjectArg(); + _elem7.read(iprot); + struct.args_list.add(_elem7); + } + } + struct.set_args_list_isSet(true); + } + } + +} + diff --git a/jstorm-client/src/main/java/backtype/storm/generated/JavaObjectArg.java b/jstorm-client/src/main/java/backtype/storm/generated/JavaObjectArg.java index bc3acf19c..c19fb8967 100644 --- a/jstorm-client/src/main/java/backtype/storm/generated/JavaObjectArg.java +++ b/jstorm-client/src/main/java/backtype/storm/generated/JavaObjectArg.java @@ -1,532 +1,607 @@ -/** - * Autogenerated by Thrift Compiler (0.7.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - */ -package backtype.storm.generated; - -import org.apache.commons.lang.builder.HashCodeBuilder; -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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class JavaObjectArg extends org.apache.thrift.TUnion { - 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); - private static final org.apache.thrift.protocol.TField LONG_ARG_FIELD_DESC = new org.apache.thrift.protocol.TField("long_arg", org.apache.thrift.protocol.TType.I64, (short)2); - private static final org.apache.thrift.protocol.TField STRING_ARG_FIELD_DESC = new org.apache.thrift.protocol.TField("string_arg", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final org.apache.thrift.protocol.TField BOOL_ARG_FIELD_DESC = new org.apache.thrift.protocol.TField("bool_arg", org.apache.thrift.protocol.TType.BOOL, (short)4); - private static final org.apache.thrift.protocol.TField BINARY_ARG_FIELD_DESC = new org.apache.thrift.protocol.TField("binary_arg", org.apache.thrift.protocol.TType.STRING, (short)5); - private static final org.apache.thrift.protocol.TField DOUBLE_ARG_FIELD_DESC = new org.apache.thrift.protocol.TField("double_arg", org.apache.thrift.protocol.TType.DOUBLE, (short)6); - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - INT_ARG((short)1, "int_arg"), - LONG_ARG((short)2, "long_arg"), - STRING_ARG((short)3, "string_arg"), - BOOL_ARG((short)4, "bool_arg"), - BINARY_ARG((short)5, "binary_arg"), - DOUBLE_ARG((short)6, "double_arg"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // INT_ARG - return INT_ARG; - case 2: // LONG_ARG - return LONG_ARG; - case 3: // STRING_ARG - return STRING_ARG; - case 4: // BOOL_ARG - return BOOL_ARG; - case 5: // BINARY_ARG - return BINARY_ARG; - case 6: // DOUBLE_ARG - return DOUBLE_ARG; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - 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); - tmpMap.put(_Fields.INT_ARG, new org.apache.thrift.meta_data.FieldMetaData("int_arg", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.LONG_ARG, new org.apache.thrift.meta_data.FieldMetaData("long_arg", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.STRING_ARG, new org.apache.thrift.meta_data.FieldMetaData("string_arg", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.BOOL_ARG, new org.apache.thrift.meta_data.FieldMetaData("bool_arg", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put(_Fields.BINARY_ARG, new org.apache.thrift.meta_data.FieldMetaData("binary_arg", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - tmpMap.put(_Fields.DOUBLE_ARG, new org.apache.thrift.meta_data.FieldMetaData("double_arg", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(JavaObjectArg.class, metaDataMap); - } - - public JavaObjectArg() { - super(); - } - - public JavaObjectArg(_Fields setField, Object value) { - super(setField, value); - } - - public JavaObjectArg(JavaObjectArg other) { - super(other); - } - public JavaObjectArg deepCopy() { - return new JavaObjectArg(this); - } - - public static JavaObjectArg int_arg(int value) { - JavaObjectArg x = new JavaObjectArg(); - x.set_int_arg(value); - return x; - } - - public static JavaObjectArg long_arg(long value) { - JavaObjectArg x = new JavaObjectArg(); - x.set_long_arg(value); - return x; - } - - public static JavaObjectArg string_arg(String value) { - JavaObjectArg x = new JavaObjectArg(); - x.set_string_arg(value); - return x; - } - - public static JavaObjectArg bool_arg(boolean value) { - JavaObjectArg x = new JavaObjectArg(); - x.set_bool_arg(value); - return x; - } - - public static JavaObjectArg binary_arg(ByteBuffer value) { - JavaObjectArg x = new JavaObjectArg(); - x.set_binary_arg(value); - return x; - } - - public static JavaObjectArg binary_arg(byte[] value) { - JavaObjectArg x = new JavaObjectArg(); - x.set_binary_arg(ByteBuffer.wrap(value)); - return x; - } - - public static JavaObjectArg double_arg(double value) { - JavaObjectArg x = new JavaObjectArg(); - x.set_double_arg(value); - return x; - } - - - @Override - protected void checkType(_Fields setField, Object value) throws ClassCastException { - switch (setField) { - case INT_ARG: - if (value instanceof Integer) { - break; - } - throw new ClassCastException("Was expecting value of type Integer for field 'int_arg', but got " + value.getClass().getSimpleName()); - case LONG_ARG: - if (value instanceof Long) { - break; - } - throw new ClassCastException("Was expecting value of type Long for field 'long_arg', but got " + value.getClass().getSimpleName()); - case STRING_ARG: - if (value instanceof String) { - break; - } - throw new ClassCastException("Was expecting value of type String for field 'string_arg', but got " + value.getClass().getSimpleName()); - case BOOL_ARG: - if (value instanceof Boolean) { - break; - } - throw new ClassCastException("Was expecting value of type Boolean for field 'bool_arg', but got " + value.getClass().getSimpleName()); - case BINARY_ARG: - if (value instanceof ByteBuffer) { - break; - } - throw new ClassCastException("Was expecting value of type ByteBuffer for field 'binary_arg', but got " + value.getClass().getSimpleName()); - case DOUBLE_ARG: - if (value instanceof Double) { - break; - } - throw new ClassCastException("Was expecting value of type Double for field 'double_arg', but got " + value.getClass().getSimpleName()); - default: - throw new IllegalArgumentException("Unknown field id " + setField); - } - } - - @Override - protected Object readValue(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 INT_ARG: - if (field.type == INT_ARG_FIELD_DESC.type) { - Integer int_arg; - int_arg = iprot.readI32(); - return int_arg; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case LONG_ARG: - if (field.type == LONG_ARG_FIELD_DESC.type) { - Long long_arg; - long_arg = iprot.readI64(); - return long_arg; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case STRING_ARG: - if (field.type == STRING_ARG_FIELD_DESC.type) { - String string_arg; - string_arg = iprot.readString(); - return string_arg; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case BOOL_ARG: - if (field.type == BOOL_ARG_FIELD_DESC.type) { - Boolean bool_arg; - bool_arg = iprot.readBool(); - return bool_arg; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case BINARY_ARG: - if (field.type == BINARY_ARG_FIELD_DESC.type) { - ByteBuffer binary_arg; - binary_arg = iprot.readBinary(); - return binary_arg; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case DOUBLE_ARG: - if (field.type == DOUBLE_ARG_FIELD_DESC.type) { - Double double_arg; - double_arg = iprot.readDouble(); - return double_arg; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - default: - throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - } - - @Override - protected void writeValue(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 org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { - switch (setField) { - case INT_ARG: - return INT_ARG_FIELD_DESC; - case LONG_ARG: - return LONG_ARG_FIELD_DESC; - case STRING_ARG: - return STRING_ARG_FIELD_DESC; - case BOOL_ARG: - return BOOL_ARG_FIELD_DESC; - case BINARY_ARG: - return BINARY_ARG_FIELD_DESC; - case DOUBLE_ARG: - return DOUBLE_ARG_FIELD_DESC; - default: - throw new IllegalArgumentException("Unknown field id " + setField); - } - } - - @Override - protected org.apache.thrift.protocol.TStruct getStructDesc() { - return STRUCT_DESC; - } - - @Override - protected _Fields enumForId(short id) { - return _Fields.findByThriftIdOrThrow(id); - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - - public int get_int_arg() { - if (getSetField() == _Fields.INT_ARG) { - return (Integer)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'int_arg' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void set_int_arg(int value) { - setField_ = _Fields.INT_ARG; - value_ = value; - } - - public long get_long_arg() { - if (getSetField() == _Fields.LONG_ARG) { - return (Long)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'long_arg' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void set_long_arg(long value) { - setField_ = _Fields.LONG_ARG; - value_ = value; - } - - public String get_string_arg() { - if (getSetField() == _Fields.STRING_ARG) { - return (String)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'string_arg' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void set_string_arg(String value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.STRING_ARG; - value_ = value; - } - - public boolean get_bool_arg() { - if (getSetField() == _Fields.BOOL_ARG) { - return (Boolean)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'bool_arg' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void set_bool_arg(boolean value) { - setField_ = _Fields.BOOL_ARG; - value_ = value; - } - - public byte[] get_binary_arg() { - set_binary_arg(org.apache.thrift.TBaseHelper.rightSize(buffer_for_binary_arg())); - ByteBuffer b = buffer_for_binary_arg(); - return b == null ? null : b.array(); - } - - public ByteBuffer buffer_for_binary_arg() { - if (getSetField() == _Fields.BINARY_ARG) { - return (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)); - } - - public void set_binary_arg(ByteBuffer value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.BINARY_ARG; - value_ = value; - } - - public double get_double_arg() { - if (getSetField() == _Fields.DOUBLE_ARG) { - return (Double)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'double_arg' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void set_double_arg(double value) { - setField_ = _Fields.DOUBLE_ARG; - value_ = value; - } - - public boolean is_set_int_arg() { - return setField_ == _Fields.INT_ARG; - } - - - public boolean is_set_long_arg() { - return setField_ == _Fields.LONG_ARG; - } - - - public boolean is_set_string_arg() { - return setField_ == _Fields.STRING_ARG; - } - - - public boolean is_set_bool_arg() { - return setField_ == _Fields.BOOL_ARG; - } - - - public boolean is_set_binary_arg() { - return setField_ == _Fields.BINARY_ARG; - } - - - public boolean is_set_double_arg() { - return setField_ == _Fields.DOUBLE_ARG; - } - - - public boolean equals(Object other) { - if (other instanceof JavaObjectArg) { - return equals((JavaObjectArg)other); - } else { - return false; - } - } - - public boolean equals(JavaObjectArg other) { - return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); - } - - @Override - public int compareTo(JavaObjectArg other) { - int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); - if (lastComparison == 0) { - return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); - } - return lastComparison; - } - - - @Override - public int hashCode() { - HashCodeBuilder hcb = new HashCodeBuilder(); - hcb.append(this.getClass().getName()); - org.apache.thrift.TFieldIdEnum setField = getSetField(); - if (setField != null) { - hcb.append(setField.getThriftFieldId()); - Object value = getFieldValue(); - if (value instanceof org.apache.thrift.TEnum) { - hcb.append(((org.apache.thrift.TEnum)getFieldValue()).getValue()); - } else { - hcb.append(value); - } - } - return hcb.toHashCode(); - } - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - -} +/** + * Autogenerated by Thrift Compiler (0.8.0) + * + * 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 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class JavaObjectArg extends org.apache.thrift.TUnion { + 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); + private static final org.apache.thrift.protocol.TField LONG_ARG_FIELD_DESC = new org.apache.thrift.protocol.TField("long_arg", org.apache.thrift.protocol.TType.I64, (short)2); + private static final org.apache.thrift.protocol.TField STRING_ARG_FIELD_DESC = new org.apache.thrift.protocol.TField("string_arg", org.apache.thrift.protocol.TType.STRING, (short)3); + private static final org.apache.thrift.protocol.TField BOOL_ARG_FIELD_DESC = new org.apache.thrift.protocol.TField("bool_arg", org.apache.thrift.protocol.TType.BOOL, (short)4); + private static final org.apache.thrift.protocol.TField BINARY_ARG_FIELD_DESC = new org.apache.thrift.protocol.TField("binary_arg", org.apache.thrift.protocol.TType.STRING, (short)5); + private static final org.apache.thrift.protocol.TField DOUBLE_ARG_FIELD_DESC = new org.apache.thrift.protocol.TField("double_arg", org.apache.thrift.protocol.TType.DOUBLE, (short)6); + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + INT_ARG((short)1, "int_arg"), + LONG_ARG((short)2, "long_arg"), + STRING_ARG((short)3, "string_arg"), + BOOL_ARG((short)4, "bool_arg"), + BINARY_ARG((short)5, "binary_arg"), + DOUBLE_ARG((short)6, "double_arg"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // INT_ARG + return INT_ARG; + case 2: // LONG_ARG + return LONG_ARG; + case 3: // STRING_ARG + return STRING_ARG; + case 4: // BOOL_ARG + return BOOL_ARG; + case 5: // BINARY_ARG + return BINARY_ARG; + case 6: // DOUBLE_ARG + return DOUBLE_ARG; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + 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); + tmpMap.put(_Fields.INT_ARG, new org.apache.thrift.meta_data.FieldMetaData("int_arg", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.LONG_ARG, new org.apache.thrift.meta_data.FieldMetaData("long_arg", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.STRING_ARG, new org.apache.thrift.meta_data.FieldMetaData("string_arg", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.BOOL_ARG, new org.apache.thrift.meta_data.FieldMetaData("bool_arg", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.BINARY_ARG, new org.apache.thrift.meta_data.FieldMetaData("binary_arg", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.DOUBLE_ARG, new org.apache.thrift.meta_data.FieldMetaData("double_arg", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(JavaObjectArg.class, metaDataMap); + } + + public JavaObjectArg() { + super(); + } + + public JavaObjectArg(_Fields setField, Object value) { + super(setField, value); + } + + public JavaObjectArg(JavaObjectArg other) { + super(other); + } + public JavaObjectArg deepCopy() { + return new JavaObjectArg(this); + } + + public static JavaObjectArg int_arg(int value) { + JavaObjectArg x = new JavaObjectArg(); + x.set_int_arg(value); + return x; + } + + public static JavaObjectArg long_arg(long value) { + JavaObjectArg x = new JavaObjectArg(); + x.set_long_arg(value); + return x; + } + + public static JavaObjectArg string_arg(String value) { + JavaObjectArg x = new JavaObjectArg(); + x.set_string_arg(value); + return x; + } + + public static JavaObjectArg bool_arg(boolean value) { + JavaObjectArg x = new JavaObjectArg(); + x.set_bool_arg(value); + return x; + } + + public static JavaObjectArg binary_arg(ByteBuffer value) { + JavaObjectArg x = new JavaObjectArg(); + x.set_binary_arg(value); + return x; + } + + public static JavaObjectArg binary_arg(byte[] value) { + JavaObjectArg x = new JavaObjectArg(); + x.set_binary_arg(ByteBuffer.wrap(value)); + return x; + } + + public static JavaObjectArg double_arg(double value) { + JavaObjectArg x = new JavaObjectArg(); + x.set_double_arg(value); + return x; + } + + + @Override + protected void checkType(_Fields setField, Object value) throws ClassCastException { + switch (setField) { + case INT_ARG: + if (value instanceof Integer) { + break; + } + throw new ClassCastException("Was expecting value of type Integer for field 'int_arg', but got " + value.getClass().getSimpleName()); + case LONG_ARG: + if (value instanceof Long) { + break; + } + throw new ClassCastException("Was expecting value of type Long for field 'long_arg', but got " + value.getClass().getSimpleName()); + case STRING_ARG: + if (value instanceof String) { + break; + } + throw new ClassCastException("Was expecting value of type String for field 'string_arg', but got " + value.getClass().getSimpleName()); + case BOOL_ARG: + if (value instanceof Boolean) { + break; + } + throw new ClassCastException("Was expecting value of type Boolean for field 'bool_arg', but got " + value.getClass().getSimpleName()); + case BINARY_ARG: + if (value instanceof ByteBuffer) { + break; + } + throw new ClassCastException("Was expecting value of type ByteBuffer for field 'binary_arg', but got " + value.getClass().getSimpleName()); + case DOUBLE_ARG: + if (value instanceof Double) { + break; + } + throw new ClassCastException("Was expecting value of type Double for field 'double_arg', but got " + value.getClass().getSimpleName()); + default: + throw new 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 { + _Fields setField = _Fields.findByThriftId(field.id); + if (setField != null) { + switch (setField) { + case INT_ARG: + if (field.type == INT_ARG_FIELD_DESC.type) { + Integer int_arg; + int_arg = iprot.readI32(); + return int_arg; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case LONG_ARG: + if (field.type == LONG_ARG_FIELD_DESC.type) { + Long long_arg; + long_arg = iprot.readI64(); + return long_arg; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case STRING_ARG: + if (field.type == STRING_ARG_FIELD_DESC.type) { + String string_arg; + string_arg = iprot.readString(); + return string_arg; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case BOOL_ARG: + if (field.type == BOOL_ARG_FIELD_DESC.type) { + Boolean bool_arg; + bool_arg = iprot.readBool(); + return bool_arg; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case BINARY_ARG: + if (field.type == BINARY_ARG_FIELD_DESC.type) { + ByteBuffer binary_arg; + binary_arg = iprot.readBinary(); + return binary_arg; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case DOUBLE_ARG: + if (field.type == DOUBLE_ARG_FIELD_DESC.type) { + Double double_arg; + double_arg = iprot.readDouble(); + return double_arg; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + default: + throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + } + } else { + return null; + } + } + + @Override + 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 { + return null; + } + } + + @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_; + 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 org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { + switch (setField) { + case INT_ARG: + return INT_ARG_FIELD_DESC; + case LONG_ARG: + return LONG_ARG_FIELD_DESC; + case STRING_ARG: + return STRING_ARG_FIELD_DESC; + case BOOL_ARG: + return BOOL_ARG_FIELD_DESC; + case BINARY_ARG: + return BINARY_ARG_FIELD_DESC; + case DOUBLE_ARG: + return DOUBLE_ARG_FIELD_DESC; + default: + throw new IllegalArgumentException("Unknown field id " + setField); + } + } + + @Override + protected org.apache.thrift.protocol.TStruct getStructDesc() { + return STRUCT_DESC; + } + + @Override + protected _Fields enumForId(short id) { + return _Fields.findByThriftIdOrThrow(id); + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + + public int get_int_arg() { + if (getSetField() == _Fields.INT_ARG) { + return (Integer)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'int_arg' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void set_int_arg(int value) { + setField_ = _Fields.INT_ARG; + value_ = value; + } + + public long get_long_arg() { + if (getSetField() == _Fields.LONG_ARG) { + return (Long)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'long_arg' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void set_long_arg(long value) { + setField_ = _Fields.LONG_ARG; + value_ = value; + } + + public String get_string_arg() { + if (getSetField() == _Fields.STRING_ARG) { + return (String)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'string_arg' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void set_string_arg(String value) { + if (value == null) throw new NullPointerException(); + setField_ = _Fields.STRING_ARG; + value_ = value; + } + + public boolean get_bool_arg() { + if (getSetField() == _Fields.BOOL_ARG) { + return (Boolean)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'bool_arg' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void set_bool_arg(boolean value) { + setField_ = _Fields.BOOL_ARG; + value_ = value; + } + + public byte[] get_binary_arg() { + set_binary_arg(org.apache.thrift.TBaseHelper.rightSize(buffer_for_binary_arg())); + ByteBuffer b = buffer_for_binary_arg(); + return b == null ? null : b.array(); + } + + public ByteBuffer buffer_for_binary_arg() { + if (getSetField() == _Fields.BINARY_ARG) { + return (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)); + } + + public void set_binary_arg(ByteBuffer value) { + if (value == null) throw new NullPointerException(); + setField_ = _Fields.BINARY_ARG; + value_ = value; + } + + public double get_double_arg() { + if (getSetField() == _Fields.DOUBLE_ARG) { + return (Double)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'double_arg' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void set_double_arg(double value) { + setField_ = _Fields.DOUBLE_ARG; + value_ = value; + } + + public boolean is_set_int_arg() { + return setField_ == _Fields.INT_ARG; + } + + + public boolean is_set_long_arg() { + return setField_ == _Fields.LONG_ARG; + } + + + public boolean is_set_string_arg() { + return setField_ == _Fields.STRING_ARG; + } + + + public boolean is_set_bool_arg() { + return setField_ == _Fields.BOOL_ARG; + } + + + public boolean is_set_binary_arg() { + return setField_ == _Fields.BINARY_ARG; + } + + + public boolean is_set_double_arg() { + return setField_ == _Fields.DOUBLE_ARG; + } + + + public boolean equals(Object other) { + if (other instanceof JavaObjectArg) { + return equals((JavaObjectArg)other); + } else { + return false; + } + } + + public boolean equals(JavaObjectArg other) { + return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); + } + + @Override + public int compareTo(JavaObjectArg other) { + int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); + if (lastComparison == 0) { + return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); + } + return lastComparison; + } + + + @Override + public int hashCode() { + HashCodeBuilder hcb = new HashCodeBuilder(); + hcb.append(this.getClass().getName()); + org.apache.thrift.TFieldIdEnum setField = getSetField(); + if (setField != null) { + hcb.append(setField.getThriftFieldId()); + Object value = getFieldValue(); + if (value instanceof org.apache.thrift.TEnum) { + hcb.append(((org.apache.thrift.TEnum)getFieldValue()).getValue()); + } else { + hcb.append(value); + } + } + return hcb.toHashCode(); + } + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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); + } + } + + +} diff --git a/jstorm-client/src/main/java/backtype/storm/generated/KillOptions.java b/jstorm-client/src/main/java/backtype/storm/generated/KillOptions.java index af57a1a56..c87df5cb5 100644 --- a/jstorm-client/src/main/java/backtype/storm/generated/KillOptions.java +++ b/jstorm-client/src/main/java/backtype/storm/generated/KillOptions.java @@ -1,320 +1,383 @@ -/** - * Autogenerated by Thrift Compiler (0.7.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - */ -package backtype.storm.generated; - -import org.apache.commons.lang.builder.HashCodeBuilder; -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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class KillOptions implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - 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 - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - WAIT_SECS((short)1, "wait_secs"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // WAIT_SECS - return WAIT_SECS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __WAIT_SECS_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - - 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); - tmpMap.put(_Fields.WAIT_SECS, new org.apache.thrift.meta_data.FieldMetaData("wait_secs", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(KillOptions.class, metaDataMap); - } - - public KillOptions() { - } - - /** - * Performs a deep copy on other. - */ - public KillOptions(KillOptions other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); - this.wait_secs = other.wait_secs; - } - - public KillOptions deepCopy() { - return new KillOptions(this); - } - - @Override - public void clear() { - set_wait_secs_isSet(false); - this.wait_secs = 0; - } - - public int get_wait_secs() { - return this.wait_secs; - } - - public void set_wait_secs(int wait_secs) { - this.wait_secs = wait_secs; - set_wait_secs_isSet(true); - } - - public void unset_wait_secs() { - __isset_bit_vector.clear(__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); - } - - public void set_wait_secs_isSet(boolean value) { - __isset_bit_vector.set(__WAIT_SECS_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case WAIT_SECS: - if (value == null) { - unset_wait_secs(); - } else { - set_wait_secs((Integer)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case WAIT_SECS: - return Integer.valueOf(get_wait_secs()); - - } - throw new 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(); - } - - switch (field) { - case WAIT_SECS: - return is_set_wait_secs(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof KillOptions) - return this.equals((KillOptions)that); - return false; - } - - public boolean equals(KillOptions that) { - if (that == null) - return false; - - boolean this_present_wait_secs = true && this.is_set_wait_secs(); - boolean that_present_wait_secs = true && that.is_set_wait_secs(); - if (this_present_wait_secs || that_present_wait_secs) { - if (!(this_present_wait_secs && that_present_wait_secs)) - return false; - if (this.wait_secs != that.wait_secs) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_wait_secs = true && (is_set_wait_secs()); - builder.append(present_wait_secs); - if (present_wait_secs) - builder.append(wait_secs); - - return builder.toHashCode(); - } - - 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()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_wait_secs()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wait_secs, typedOther.wait_secs); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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(); - } - - 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(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("KillOptions("); - boolean first = true; - - if (is_set_wait_secs()) { - sb.append("wait_secs:"); - sb.append(this.wait_secs); - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - 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); - 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); - } - } - -} - +/** + * Autogenerated by Thrift Compiler (0.8.0) + * + * 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 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class KillOptions implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + 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 static final Map, SchemeFactory> schemes = new HashMap, 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 { + WAIT_SECS((short)1, "wait_secs"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // WAIT_SECS + return WAIT_SECS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __WAIT_SECS_ISSET_ID = 0; + private BitSet __isset_bit_vector = new BitSet(1); + private _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); + tmpMap.put(_Fields.WAIT_SECS, new org.apache.thrift.meta_data.FieldMetaData("wait_secs", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(KillOptions.class, metaDataMap); + } + + public KillOptions() { + } + + /** + * Performs a deep copy on other. + */ + public KillOptions(KillOptions other) { + __isset_bit_vector.clear(); + __isset_bit_vector.or(other.__isset_bit_vector); + this.wait_secs = other.wait_secs; + } + + public KillOptions deepCopy() { + return new KillOptions(this); + } + + @Override + public void clear() { + set_wait_secs_isSet(false); + this.wait_secs = 0; + } + + public int get_wait_secs() { + return this.wait_secs; + } + + public void set_wait_secs(int wait_secs) { + this.wait_secs = wait_secs; + set_wait_secs_isSet(true); + } + + public void unset_wait_secs() { + __isset_bit_vector.clear(__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); + } + + public void set_wait_secs_isSet(boolean value) { + __isset_bit_vector.set(__WAIT_SECS_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case WAIT_SECS: + if (value == null) { + unset_wait_secs(); + } else { + set_wait_secs((Integer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case WAIT_SECS: + return Integer.valueOf(get_wait_secs()); + + } + throw new 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(); + } + + switch (field) { + case WAIT_SECS: + return is_set_wait_secs(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof KillOptions) + return this.equals((KillOptions)that); + return false; + } + + public boolean equals(KillOptions that) { + if (that == null) + return false; + + boolean this_present_wait_secs = true && this.is_set_wait_secs(); + boolean that_present_wait_secs = true && that.is_set_wait_secs(); + if (this_present_wait_secs || that_present_wait_secs) { + if (!(this_present_wait_secs && that_present_wait_secs)) + return false; + if (this.wait_secs != that.wait_secs) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_wait_secs = true && (is_set_wait_secs()); + builder.append(present_wait_secs); + if (present_wait_secs) + builder.append(wait_secs); + + return builder.toHashCode(); + } + + 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()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_wait_secs()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wait_secs, typedOther.wait_secs); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("KillOptions("); + boolean first = true; + + if (is_set_wait_secs()) { + sb.append("wait_secs:"); + sb.append(this.wait_secs); + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + 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); + 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 { + + 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 { + + @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); + } + } + } + +} + diff --git a/jstorm-client/src/main/java/backtype/storm/generated/Nimbus.java b/jstorm-client/src/main/java/backtype/storm/generated/Nimbus.java index 495788fcb..4cb4b84ba 100644 --- a/jstorm-client/src/main/java/backtype/storm/generated/Nimbus.java +++ b/jstorm-client/src/main/java/backtype/storm/generated/Nimbus.java @@ -1,11649 +1,13556 @@ -/** - * Autogenerated by Thrift Compiler (0.7.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - */ -package backtype.storm.generated; - -import org.apache.commons.lang.builder.HashCodeBuilder; -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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class Nimbus { - - public interface Iface { - - public void submitTopology(String name, String uploadedJarLocation, String jsonConf, StormTopology topology) throws AlreadyAliveException, InvalidTopologyException, org.apache.thrift.TException; - - public void killTopology(String name) throws NotAliveException, org.apache.thrift.TException; - - public void killTopologyWithOpts(String name, KillOptions options) throws NotAliveException, org.apache.thrift.TException; - - public void activate(String name) throws NotAliveException, org.apache.thrift.TException; - - public void deactivate(String name) throws NotAliveException, org.apache.thrift.TException; - - public void rebalance(String name, RebalanceOptions options) throws NotAliveException, org.apache.thrift.TException; - - public String beginFileUpload() throws org.apache.thrift.TException; - - public void uploadChunk(String location, ByteBuffer chunk) throws org.apache.thrift.TException; - - public void finishFileUpload(String location) throws org.apache.thrift.TException; - - public String beginFileDownload(String file) throws org.apache.thrift.TException; - - public ByteBuffer downloadChunk(String id) throws org.apache.thrift.TException; - - public ClusterSummary getClusterInfo() throws org.apache.thrift.TException; - - public TopologyInfo getTopologyInfo(String id) throws NotAliveException, org.apache.thrift.TException; - - public SupervisorWorkers getSupervisorWorkers(String host) throws NotAliveException, org.apache.thrift.TException; - - public String getTopologyConf(String id) throws NotAliveException, org.apache.thrift.TException; - - public StormTopology getTopology(String id) throws NotAliveException, org.apache.thrift.TException; - - } - - public interface AsyncIface { - - public void submitTopology(String name, String uploadedJarLocation, String jsonConf, StormTopology topology, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void killTopology(String name, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void killTopologyWithOpts(String name, KillOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void activate(String name, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void deactivate(String name, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void rebalance(String name, RebalanceOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void beginFileUpload(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void uploadChunk(String location, ByteBuffer chunk, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void finishFileUpload(String location, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void beginFileDownload(String file, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void downloadChunk(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void getClusterInfo(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void getTopologyInfo(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void getSupervisorWorkers(String host, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void getTopologyConf(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void getTopology(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - } - - public static class Client extends org.apache.thrift.TServiceClient implements Iface { - public static class Factory implements org.apache.thrift.TServiceClientFactory { - public Factory() {} - public Client getClient(org.apache.thrift.protocol.TProtocol prot) { - return new Client(prot); - } - public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { - return new Client(iprot, oprot); - } - } - - public Client(org.apache.thrift.protocol.TProtocol prot) - { - super(prot, prot); - } - - public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { - super(iprot, oprot); - } - - public void submitTopology(String name, String uploadedJarLocation, String jsonConf, StormTopology topology) throws AlreadyAliveException, InvalidTopologyException, org.apache.thrift.TException - { - send_submitTopology(name, uploadedJarLocation, jsonConf, topology); - recv_submitTopology(); - } - - public void send_submitTopology(String name, String uploadedJarLocation, String jsonConf, StormTopology topology) throws org.apache.thrift.TException - { - submitTopology_args args = new submitTopology_args(); - args.set_name(name); - args.set_uploadedJarLocation(uploadedJarLocation); - args.set_jsonConf(jsonConf); - args.set_topology(topology); - sendBase("submitTopology", args); - } - - public void recv_submitTopology() throws AlreadyAliveException, InvalidTopologyException, org.apache.thrift.TException - { - submitTopology_result result = new submitTopology_result(); - receiveBase(result, "submitTopology"); - if (result.e != null) { - throw result.e; - } - if (result.ite != null) { - throw result.ite; - } - return; - } - - public void killTopology(String name) throws NotAliveException, org.apache.thrift.TException - { - send_killTopology(name); - recv_killTopology(); - } - - public void send_killTopology(String name) throws org.apache.thrift.TException - { - killTopology_args args = new killTopology_args(); - args.set_name(name); - sendBase("killTopology", args); - } - - public void recv_killTopology() throws NotAliveException, org.apache.thrift.TException - { - killTopology_result result = new killTopology_result(); - receiveBase(result, "killTopology"); - if (result.e != null) { - throw result.e; - } - return; - } - - public void killTopologyWithOpts(String name, KillOptions options) throws NotAliveException, org.apache.thrift.TException - { - send_killTopologyWithOpts(name, options); - recv_killTopologyWithOpts(); - } - - public void send_killTopologyWithOpts(String name, KillOptions options) throws org.apache.thrift.TException - { - killTopologyWithOpts_args args = new killTopologyWithOpts_args(); - args.set_name(name); - args.set_options(options); - sendBase("killTopologyWithOpts", args); - } - - public void recv_killTopologyWithOpts() throws NotAliveException, org.apache.thrift.TException - { - killTopologyWithOpts_result result = new killTopologyWithOpts_result(); - receiveBase(result, "killTopologyWithOpts"); - if (result.e != null) { - throw result.e; - } - return; - } - - public void activate(String name) throws NotAliveException, org.apache.thrift.TException - { - send_activate(name); - recv_activate(); - } - - public void send_activate(String name) throws org.apache.thrift.TException - { - activate_args args = new activate_args(); - args.set_name(name); - sendBase("activate", args); - } - - public void recv_activate() throws NotAliveException, org.apache.thrift.TException - { - activate_result result = new activate_result(); - receiveBase(result, "activate"); - if (result.e != null) { - throw result.e; - } - return; - } - - public void deactivate(String name) throws NotAliveException, org.apache.thrift.TException - { - send_deactivate(name); - recv_deactivate(); - } - - public void send_deactivate(String name) throws org.apache.thrift.TException - { - deactivate_args args = new deactivate_args(); - args.set_name(name); - sendBase("deactivate", args); - } - - public void recv_deactivate() throws NotAliveException, org.apache.thrift.TException - { - deactivate_result result = new deactivate_result(); - receiveBase(result, "deactivate"); - if (result.e != null) { - throw result.e; - } - return; - } - - public void rebalance(String name, RebalanceOptions options) throws NotAliveException, org.apache.thrift.TException - { - send_rebalance(name, options); - recv_rebalance(); - } - - public void send_rebalance(String name, RebalanceOptions options) throws org.apache.thrift.TException - { - rebalance_args args = new rebalance_args(); - args.set_name(name); - args.set_options(options); - sendBase("rebalance", args); - } - - public void recv_rebalance() throws NotAliveException, org.apache.thrift.TException - { - rebalance_result result = new rebalance_result(); - receiveBase(result, "rebalance"); - if (result.e != null) { - throw result.e; - } - return; - } - - public String beginFileUpload() throws org.apache.thrift.TException - { - send_beginFileUpload(); - return recv_beginFileUpload(); - } - - public void send_beginFileUpload() throws org.apache.thrift.TException - { - beginFileUpload_args args = new beginFileUpload_args(); - sendBase("beginFileUpload", args); - } - - public String recv_beginFileUpload() throws org.apache.thrift.TException - { - beginFileUpload_result result = new beginFileUpload_result(); - receiveBase(result, "beginFileUpload"); - if (result.is_set_success()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "beginFileUpload failed: unknown result"); - } - - public void uploadChunk(String location, ByteBuffer chunk) throws org.apache.thrift.TException - { - send_uploadChunk(location, chunk); - recv_uploadChunk(); - } - - public void send_uploadChunk(String location, ByteBuffer chunk) throws org.apache.thrift.TException - { - uploadChunk_args args = new uploadChunk_args(); - args.set_location(location); - args.set_chunk(chunk); - sendBase("uploadChunk", args); - } - - public void recv_uploadChunk() throws org.apache.thrift.TException - { - uploadChunk_result result = new uploadChunk_result(); - receiveBase(result, "uploadChunk"); - return; - } - - public void finishFileUpload(String location) throws org.apache.thrift.TException - { - send_finishFileUpload(location); - recv_finishFileUpload(); - } - - public void send_finishFileUpload(String location) throws org.apache.thrift.TException - { - finishFileUpload_args args = new finishFileUpload_args(); - args.set_location(location); - sendBase("finishFileUpload", args); - } - - public void recv_finishFileUpload() throws org.apache.thrift.TException - { - finishFileUpload_result result = new finishFileUpload_result(); - receiveBase(result, "finishFileUpload"); - return; - } - - public String beginFileDownload(String file) throws org.apache.thrift.TException - { - send_beginFileDownload(file); - return recv_beginFileDownload(); - } - - public void send_beginFileDownload(String file) throws org.apache.thrift.TException - { - beginFileDownload_args args = new beginFileDownload_args(); - args.set_file(file); - sendBase("beginFileDownload", args); - } - - public String recv_beginFileDownload() throws org.apache.thrift.TException - { - beginFileDownload_result result = new beginFileDownload_result(); - receiveBase(result, "beginFileDownload"); - if (result.is_set_success()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "beginFileDownload failed: unknown result"); - } - - public ByteBuffer downloadChunk(String id) throws org.apache.thrift.TException - { - send_downloadChunk(id); - return recv_downloadChunk(); - } - - public void send_downloadChunk(String id) throws org.apache.thrift.TException - { - downloadChunk_args args = new downloadChunk_args(); - args.set_id(id); - sendBase("downloadChunk", args); - } - - public ByteBuffer recv_downloadChunk() throws org.apache.thrift.TException - { - downloadChunk_result result = new downloadChunk_result(); - receiveBase(result, "downloadChunk"); - if (result.is_set_success()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "downloadChunk failed: unknown result"); - } - - public ClusterSummary getClusterInfo() throws org.apache.thrift.TException - { - send_getClusterInfo(); - return recv_getClusterInfo(); - } - - public void send_getClusterInfo() throws org.apache.thrift.TException - { - getClusterInfo_args args = new getClusterInfo_args(); - sendBase("getClusterInfo", args); - } - - public ClusterSummary recv_getClusterInfo() throws org.apache.thrift.TException - { - getClusterInfo_result result = new getClusterInfo_result(); - receiveBase(result, "getClusterInfo"); - if (result.is_set_success()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getClusterInfo failed: unknown result"); - } - - public TopologyInfo getTopologyInfo(String id) throws NotAliveException, org.apache.thrift.TException - { - send_getTopologyInfo(id); - return recv_getTopologyInfo(); - } - - public void send_getTopologyInfo(String id) throws org.apache.thrift.TException - { - getTopologyInfo_args args = new getTopologyInfo_args(); - args.set_id(id); - sendBase("getTopologyInfo", args); - } - - public TopologyInfo recv_getTopologyInfo() throws NotAliveException, org.apache.thrift.TException - { - getTopologyInfo_result result = new getTopologyInfo_result(); - receiveBase(result, "getTopologyInfo"); - if (result.is_set_success()) { - return result.success; - } - if (result.e != null) { - throw result.e; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getTopologyInfo failed: unknown result"); - } - - public SupervisorWorkers getSupervisorWorkers(String host) throws NotAliveException, org.apache.thrift.TException - { - send_getSupervisorWorkers(host); - return recv_getSupervisorWorkers(); - } - - public void send_getSupervisorWorkers(String host) throws org.apache.thrift.TException - { - getSupervisorWorkers_args args = new getSupervisorWorkers_args(); - args.set_host(host); - sendBase("getSupervisorWorkers", args); - } - - public SupervisorWorkers recv_getSupervisorWorkers() throws NotAliveException, org.apache.thrift.TException - { - getSupervisorWorkers_result result = new getSupervisorWorkers_result(); - receiveBase(result, "getSupervisorWorkers"); - if (result.is_set_success()) { - return result.success; - } - if (result.e != null) { - throw result.e; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSupervisorWorkers failed: unknown result"); - } - - public String getTopologyConf(String id) throws NotAliveException, org.apache.thrift.TException - { - send_getTopologyConf(id); - return recv_getTopologyConf(); - } - - public void send_getTopologyConf(String id) throws org.apache.thrift.TException - { - getTopologyConf_args args = new getTopologyConf_args(); - args.set_id(id); - sendBase("getTopologyConf", args); - } - - public String recv_getTopologyConf() throws NotAliveException, org.apache.thrift.TException - { - getTopologyConf_result result = new getTopologyConf_result(); - receiveBase(result, "getTopologyConf"); - if (result.is_set_success()) { - return result.success; - } - if (result.e != null) { - throw result.e; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getTopologyConf failed: unknown result"); - } - - public StormTopology getTopology(String id) throws NotAliveException, org.apache.thrift.TException - { - send_getTopology(id); - return recv_getTopology(); - } - - public void send_getTopology(String id) throws org.apache.thrift.TException - { - getTopology_args args = new getTopology_args(); - args.set_id(id); - sendBase("getTopology", args); - } - - public StormTopology recv_getTopology() throws NotAliveException, org.apache.thrift.TException - { - getTopology_result result = new getTopology_result(); - receiveBase(result, "getTopology"); - if (result.is_set_success()) { - return result.success; - } - if (result.e != null) { - throw result.e; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getTopology failed: unknown result"); - } - - } - public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { - public static class Factory implements org.apache.thrift.async.TAsyncClientFactory { - private org.apache.thrift.async.TAsyncClientManager clientManager; - private org.apache.thrift.protocol.TProtocolFactory protocolFactory; - public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) { - this.clientManager = clientManager; - this.protocolFactory = protocolFactory; - } - public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) { - return new AsyncClient(protocolFactory, clientManager, transport); - } - } - - public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) { - super(protocolFactory, clientManager, transport); - } - - public void submitTopology(String name, String uploadedJarLocation, String jsonConf, StormTopology topology, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - submitTopology_call method_call = new submitTopology_call(name, uploadedJarLocation, jsonConf, topology, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class submitTopology_call extends org.apache.thrift.async.TAsyncMethodCall { - private String name; - private String uploadedJarLocation; - private String jsonConf; - private StormTopology topology; - public submitTopology_call(String name, String uploadedJarLocation, String jsonConf, StormTopology topology, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.name = name; - this.uploadedJarLocation = uploadedJarLocation; - this.jsonConf = jsonConf; - this.topology = topology; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("submitTopology", org.apache.thrift.protocol.TMessageType.CALL, 0)); - submitTopology_args args = new submitTopology_args(); - args.set_name(name); - args.set_uploadedJarLocation(uploadedJarLocation); - args.set_jsonConf(jsonConf); - args.set_topology(topology); - args.write(prot); - prot.writeMessageEnd(); - } - - public void getResult() throws AlreadyAliveException, InvalidTopologyException, org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - (new Client(prot)).recv_submitTopology(); - } - } - - public void killTopology(String name, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - killTopology_call method_call = new killTopology_call(name, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class killTopology_call extends org.apache.thrift.async.TAsyncMethodCall { - private String name; - public killTopology_call(String name, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.name = name; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("killTopology", org.apache.thrift.protocol.TMessageType.CALL, 0)); - killTopology_args args = new killTopology_args(); - args.set_name(name); - args.write(prot); - prot.writeMessageEnd(); - } - - public void getResult() throws NotAliveException, org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - (new Client(prot)).recv_killTopology(); - } - } - - public void killTopologyWithOpts(String name, KillOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - killTopologyWithOpts_call method_call = new killTopologyWithOpts_call(name, options, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class killTopologyWithOpts_call extends org.apache.thrift.async.TAsyncMethodCall { - private String name; - private KillOptions options; - public killTopologyWithOpts_call(String name, KillOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.name = name; - this.options = options; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("killTopologyWithOpts", org.apache.thrift.protocol.TMessageType.CALL, 0)); - killTopologyWithOpts_args args = new killTopologyWithOpts_args(); - args.set_name(name); - args.set_options(options); - args.write(prot); - prot.writeMessageEnd(); - } - - public void getResult() throws NotAliveException, org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - (new Client(prot)).recv_killTopologyWithOpts(); - } - } - - public void activate(String name, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - activate_call method_call = new activate_call(name, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class activate_call extends org.apache.thrift.async.TAsyncMethodCall { - private String name; - public activate_call(String name, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.name = name; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("activate", org.apache.thrift.protocol.TMessageType.CALL, 0)); - activate_args args = new activate_args(); - args.set_name(name); - args.write(prot); - prot.writeMessageEnd(); - } - - public void getResult() throws NotAliveException, org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - (new Client(prot)).recv_activate(); - } - } - - public void deactivate(String name, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - deactivate_call method_call = new deactivate_call(name, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class deactivate_call extends org.apache.thrift.async.TAsyncMethodCall { - private String name; - public deactivate_call(String name, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.name = name; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deactivate", org.apache.thrift.protocol.TMessageType.CALL, 0)); - deactivate_args args = new deactivate_args(); - args.set_name(name); - args.write(prot); - prot.writeMessageEnd(); - } - - public void getResult() throws NotAliveException, org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - (new Client(prot)).recv_deactivate(); - } - } - - public void rebalance(String name, RebalanceOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - rebalance_call method_call = new rebalance_call(name, options, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class rebalance_call extends org.apache.thrift.async.TAsyncMethodCall { - private String name; - private RebalanceOptions options; - public rebalance_call(String name, RebalanceOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.name = name; - this.options = options; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("rebalance", org.apache.thrift.protocol.TMessageType.CALL, 0)); - rebalance_args args = new rebalance_args(); - args.set_name(name); - args.set_options(options); - args.write(prot); - prot.writeMessageEnd(); - } - - public void getResult() throws NotAliveException, org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - (new Client(prot)).recv_rebalance(); - } - } - - public void beginFileUpload(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - beginFileUpload_call method_call = new beginFileUpload_call(resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class beginFileUpload_call extends org.apache.thrift.async.TAsyncMethodCall { - public beginFileUpload_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("beginFileUpload", org.apache.thrift.protocol.TMessageType.CALL, 0)); - beginFileUpload_args args = new beginFileUpload_args(); - args.write(prot); - prot.writeMessageEnd(); - } - - public String getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_beginFileUpload(); - } - } - - public void uploadChunk(String location, ByteBuffer chunk, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - uploadChunk_call method_call = new uploadChunk_call(location, chunk, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class uploadChunk_call extends org.apache.thrift.async.TAsyncMethodCall { - private String location; - private ByteBuffer chunk; - public uploadChunk_call(String location, ByteBuffer chunk, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.location = location; - this.chunk = chunk; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("uploadChunk", org.apache.thrift.protocol.TMessageType.CALL, 0)); - uploadChunk_args args = new uploadChunk_args(); - args.set_location(location); - args.set_chunk(chunk); - args.write(prot); - prot.writeMessageEnd(); - } - - public void getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - (new Client(prot)).recv_uploadChunk(); - } - } - - public void finishFileUpload(String location, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - finishFileUpload_call method_call = new finishFileUpload_call(location, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class finishFileUpload_call extends org.apache.thrift.async.TAsyncMethodCall { - private String location; - public finishFileUpload_call(String location, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.location = location; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("finishFileUpload", org.apache.thrift.protocol.TMessageType.CALL, 0)); - finishFileUpload_args args = new finishFileUpload_args(); - args.set_location(location); - args.write(prot); - prot.writeMessageEnd(); - } - - public void getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - (new Client(prot)).recv_finishFileUpload(); - } - } - - public void beginFileDownload(String file, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - beginFileDownload_call method_call = new beginFileDownload_call(file, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class beginFileDownload_call extends org.apache.thrift.async.TAsyncMethodCall { - private String file; - public beginFileDownload_call(String file, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.file = file; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("beginFileDownload", org.apache.thrift.protocol.TMessageType.CALL, 0)); - beginFileDownload_args args = new beginFileDownload_args(); - args.set_file(file); - args.write(prot); - prot.writeMessageEnd(); - } - - public String getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_beginFileDownload(); - } - } - - public void downloadChunk(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - downloadChunk_call method_call = new downloadChunk_call(id, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class downloadChunk_call extends org.apache.thrift.async.TAsyncMethodCall { - private String id; - public downloadChunk_call(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.id = id; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("downloadChunk", org.apache.thrift.protocol.TMessageType.CALL, 0)); - downloadChunk_args args = new downloadChunk_args(); - args.set_id(id); - args.write(prot); - prot.writeMessageEnd(); - } - - public ByteBuffer getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_downloadChunk(); - } - } - - public void getClusterInfo(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - getClusterInfo_call method_call = new getClusterInfo_call(resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class getClusterInfo_call extends org.apache.thrift.async.TAsyncMethodCall { - public getClusterInfo_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getClusterInfo", org.apache.thrift.protocol.TMessageType.CALL, 0)); - getClusterInfo_args args = new getClusterInfo_args(); - args.write(prot); - prot.writeMessageEnd(); - } - - public ClusterSummary getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_getClusterInfo(); - } - } - - public void getTopologyInfo(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - getTopologyInfo_call method_call = new getTopologyInfo_call(id, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class getTopologyInfo_call extends org.apache.thrift.async.TAsyncMethodCall { - private String id; - public getTopologyInfo_call(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.id = id; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getTopologyInfo", org.apache.thrift.protocol.TMessageType.CALL, 0)); - getTopologyInfo_args args = new getTopologyInfo_args(); - args.set_id(id); - args.write(prot); - prot.writeMessageEnd(); - } - - public TopologyInfo getResult() throws NotAliveException, org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_getTopologyInfo(); - } - } - - public void getSupervisorWorkers(String host, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - getSupervisorWorkers_call method_call = new getSupervisorWorkers_call(host, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class getSupervisorWorkers_call extends org.apache.thrift.async.TAsyncMethodCall { - private String host; - public getSupervisorWorkers_call(String host, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.host = host; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getSupervisorWorkers", org.apache.thrift.protocol.TMessageType.CALL, 0)); - getSupervisorWorkers_args args = new getSupervisorWorkers_args(); - args.set_host(host); - args.write(prot); - prot.writeMessageEnd(); - } - - public SupervisorWorkers getResult() throws NotAliveException, org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_getSupervisorWorkers(); - } - } - - public void getTopologyConf(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - getTopologyConf_call method_call = new getTopologyConf_call(id, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class getTopologyConf_call extends org.apache.thrift.async.TAsyncMethodCall { - private String id; - public getTopologyConf_call(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.id = id; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getTopologyConf", org.apache.thrift.protocol.TMessageType.CALL, 0)); - getTopologyConf_args args = new getTopologyConf_args(); - args.set_id(id); - args.write(prot); - prot.writeMessageEnd(); - } - - public String getResult() throws NotAliveException, org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_getTopologyConf(); - } - } - - public void getTopology(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - getTopology_call method_call = new getTopology_call(id, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class getTopology_call extends org.apache.thrift.async.TAsyncMethodCall { - private String id; - public getTopology_call(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.id = id; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getTopology", org.apache.thrift.protocol.TMessageType.CALL, 0)); - getTopology_args args = new getTopology_args(); - args.set_id(id); - args.write(prot); - prot.writeMessageEnd(); - } - - public StormTopology getResult() throws NotAliveException, org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_getTopology(); - } - } - - } - - public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor { - private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName()); - public Processor(I iface) { - super(iface, getProcessMap(new HashMap>())); - } - - protected Processor(I iface, Map> processMap) { - super(iface, getProcessMap(processMap)); - } - - private static Map> getProcessMap(Map> processMap) { - processMap.put("submitTopology", new submitTopology()); - processMap.put("killTopology", new killTopology()); - processMap.put("killTopologyWithOpts", new killTopologyWithOpts()); - processMap.put("activate", new activate()); - processMap.put("deactivate", new deactivate()); - processMap.put("rebalance", new rebalance()); - processMap.put("beginFileUpload", new beginFileUpload()); - processMap.put("uploadChunk", new uploadChunk()); - processMap.put("finishFileUpload", new finishFileUpload()); - processMap.put("beginFileDownload", new beginFileDownload()); - processMap.put("downloadChunk", new downloadChunk()); - processMap.put("getClusterInfo", new getClusterInfo()); - processMap.put("getTopologyInfo", new getTopologyInfo()); - processMap.put("getSupervisorWorkers", new getSupervisorWorkers()); - processMap.put("getTopologyConf", new getTopologyConf()); - processMap.put("getTopology", new getTopology()); - return processMap; - } - - private static class submitTopology extends org.apache.thrift.ProcessFunction { - public submitTopology() { - super("submitTopology"); - } - - protected submitTopology_args getEmptyArgsInstance() { - return new submitTopology_args(); - } - - protected submitTopology_result getResult(I iface, submitTopology_args args) throws org.apache.thrift.TException { - submitTopology_result result = new submitTopology_result(); - try { - iface.submitTopology(args.name, args.uploadedJarLocation, args.jsonConf, args.topology); - } catch (AlreadyAliveException e) { - result.e = e; - } catch (InvalidTopologyException ite) { - result.ite = ite; - } - return result; - } - } - - private static class killTopology extends org.apache.thrift.ProcessFunction { - public killTopology() { - super("killTopology"); - } - - protected killTopology_args getEmptyArgsInstance() { - return new killTopology_args(); - } - - protected killTopology_result getResult(I iface, killTopology_args args) throws org.apache.thrift.TException { - killTopology_result result = new killTopology_result(); - try { - iface.killTopology(args.name); - } catch (NotAliveException e) { - result.e = e; - } - return result; - } - } - - private static class killTopologyWithOpts extends org.apache.thrift.ProcessFunction { - public killTopologyWithOpts() { - super("killTopologyWithOpts"); - } - - protected killTopologyWithOpts_args getEmptyArgsInstance() { - return new killTopologyWithOpts_args(); - } - - protected killTopologyWithOpts_result getResult(I iface, killTopologyWithOpts_args args) throws org.apache.thrift.TException { - killTopologyWithOpts_result result = new killTopologyWithOpts_result(); - try { - iface.killTopologyWithOpts(args.name, args.options); - } catch (NotAliveException e) { - result.e = e; - } - return result; - } - } - - private static class activate extends org.apache.thrift.ProcessFunction { - public activate() { - super("activate"); - } - - protected activate_args getEmptyArgsInstance() { - return new activate_args(); - } - - protected activate_result getResult(I iface, activate_args args) throws org.apache.thrift.TException { - activate_result result = new activate_result(); - try { - iface.activate(args.name); - } catch (NotAliveException e) { - result.e = e; - } - return result; - } - } - - private static class deactivate extends org.apache.thrift.ProcessFunction { - public deactivate() { - super("deactivate"); - } - - protected deactivate_args getEmptyArgsInstance() { - return new deactivate_args(); - } - - protected deactivate_result getResult(I iface, deactivate_args args) throws org.apache.thrift.TException { - deactivate_result result = new deactivate_result(); - try { - iface.deactivate(args.name); - } catch (NotAliveException e) { - result.e = e; - } - return result; - } - } - - private static class rebalance extends org.apache.thrift.ProcessFunction { - public rebalance() { - super("rebalance"); - } - - protected rebalance_args getEmptyArgsInstance() { - return new rebalance_args(); - } - - protected rebalance_result getResult(I iface, rebalance_args args) throws org.apache.thrift.TException { - rebalance_result result = new rebalance_result(); - try { - iface.rebalance(args.name, args.options); - } catch (NotAliveException e) { - result.e = e; - } - return result; - } - } - - private static class beginFileUpload extends org.apache.thrift.ProcessFunction { - public beginFileUpload() { - super("beginFileUpload"); - } - - protected beginFileUpload_args getEmptyArgsInstance() { - return new beginFileUpload_args(); - } - - protected beginFileUpload_result getResult(I iface, beginFileUpload_args args) throws org.apache.thrift.TException { - beginFileUpload_result result = new beginFileUpload_result(); - result.success = iface.beginFileUpload(); - return result; - } - } - - private static class uploadChunk extends org.apache.thrift.ProcessFunction { - public uploadChunk() { - super("uploadChunk"); - } - - protected uploadChunk_args getEmptyArgsInstance() { - return new uploadChunk_args(); - } - - protected uploadChunk_result getResult(I iface, uploadChunk_args args) throws org.apache.thrift.TException { - uploadChunk_result result = new uploadChunk_result(); - iface.uploadChunk(args.location, args.chunk); - return result; - } - } - - private static class finishFileUpload extends org.apache.thrift.ProcessFunction { - public finishFileUpload() { - super("finishFileUpload"); - } - - protected finishFileUpload_args getEmptyArgsInstance() { - return new finishFileUpload_args(); - } - - protected finishFileUpload_result getResult(I iface, finishFileUpload_args args) throws org.apache.thrift.TException { - finishFileUpload_result result = new finishFileUpload_result(); - iface.finishFileUpload(args.location); - return result; - } - } - - private static class beginFileDownload extends org.apache.thrift.ProcessFunction { - public beginFileDownload() { - super("beginFileDownload"); - } - - protected beginFileDownload_args getEmptyArgsInstance() { - return new beginFileDownload_args(); - } - - protected beginFileDownload_result getResult(I iface, beginFileDownload_args args) throws org.apache.thrift.TException { - beginFileDownload_result result = new beginFileDownload_result(); - result.success = iface.beginFileDownload(args.file); - return result; - } - } - - private static class downloadChunk extends org.apache.thrift.ProcessFunction { - public downloadChunk() { - super("downloadChunk"); - } - - protected downloadChunk_args getEmptyArgsInstance() { - return new downloadChunk_args(); - } - - protected downloadChunk_result getResult(I iface, downloadChunk_args args) throws org.apache.thrift.TException { - downloadChunk_result result = new downloadChunk_result(); - result.success = iface.downloadChunk(args.id); - return result; - } - } - - private static class getClusterInfo extends org.apache.thrift.ProcessFunction { - public getClusterInfo() { - super("getClusterInfo"); - } - - protected getClusterInfo_args getEmptyArgsInstance() { - return new getClusterInfo_args(); - } - - protected getClusterInfo_result getResult(I iface, getClusterInfo_args args) throws org.apache.thrift.TException { - getClusterInfo_result result = new getClusterInfo_result(); - result.success = iface.getClusterInfo(); - return result; - } - } - - private static class getTopologyInfo extends org.apache.thrift.ProcessFunction { - public getTopologyInfo() { - super("getTopologyInfo"); - } - - protected getTopologyInfo_args getEmptyArgsInstance() { - return new getTopologyInfo_args(); - } - - protected getTopologyInfo_result getResult(I iface, getTopologyInfo_args args) throws org.apache.thrift.TException { - getTopologyInfo_result result = new getTopologyInfo_result(); - try { - result.success = iface.getTopologyInfo(args.id); - } catch (NotAliveException e) { - result.e = e; - } - return result; - } - } - - private static class getSupervisorWorkers extends org.apache.thrift.ProcessFunction { - public getSupervisorWorkers() { - super("getSupervisorWorkers"); - } - - protected getSupervisorWorkers_args getEmptyArgsInstance() { - return new getSupervisorWorkers_args(); - } - - protected getSupervisorWorkers_result getResult(I iface, getSupervisorWorkers_args args) throws org.apache.thrift.TException { - getSupervisorWorkers_result result = new getSupervisorWorkers_result(); - try { - result.success = iface.getSupervisorWorkers(args.host); - } catch (NotAliveException e) { - result.e = e; - } - return result; - } - } - - private static class getTopologyConf extends org.apache.thrift.ProcessFunction { - public getTopologyConf() { - super("getTopologyConf"); - } - - protected getTopologyConf_args getEmptyArgsInstance() { - return new getTopologyConf_args(); - } - - protected getTopologyConf_result getResult(I iface, getTopologyConf_args args) throws org.apache.thrift.TException { - getTopologyConf_result result = new getTopologyConf_result(); - try { - result.success = iface.getTopologyConf(args.id); - } catch (NotAliveException e) { - result.e = e; - } - return result; - } - } - - private static class getTopology extends org.apache.thrift.ProcessFunction { - public getTopology() { - super("getTopology"); - } - - protected getTopology_args getEmptyArgsInstance() { - return new getTopology_args(); - } - - protected getTopology_result getResult(I iface, getTopology_args args) throws org.apache.thrift.TException { - getTopology_result result = new getTopology_result(); - try { - result.success = iface.getTopology(args.id); - } catch (NotAliveException e) { - result.e = e; - } - return result; - } - } - - } - - public static class submitTopology_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("submitTopology_args"); - - private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField UPLOADED_JAR_LOCATION_FIELD_DESC = new org.apache.thrift.protocol.TField("uploadedJarLocation", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField JSON_CONF_FIELD_DESC = new org.apache.thrift.protocol.TField("jsonConf", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final org.apache.thrift.protocol.TField TOPOLOGY_FIELD_DESC = new org.apache.thrift.protocol.TField("topology", org.apache.thrift.protocol.TType.STRUCT, (short)4); - - private String name; // required - private String uploadedJarLocation; // required - private String jsonConf; // required - private StormTopology topology; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - NAME((short)1, "name"), - UPLOADED_JAR_LOCATION((short)2, "uploadedJarLocation"), - JSON_CONF((short)3, "jsonConf"), - TOPOLOGY((short)4, "topology"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // NAME - return NAME; - case 2: // UPLOADED_JAR_LOCATION - return UPLOADED_JAR_LOCATION; - case 3: // JSON_CONF - return JSON_CONF; - case 4: // TOPOLOGY - return TOPOLOGY; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.UPLOADED_JAR_LOCATION, new org.apache.thrift.meta_data.FieldMetaData("uploadedJarLocation", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.JSON_CONF, new org.apache.thrift.meta_data.FieldMetaData("jsonConf", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.TOPOLOGY, new org.apache.thrift.meta_data.FieldMetaData("topology", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, StormTopology.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(submitTopology_args.class, metaDataMap); - } - - public submitTopology_args() { - } - - public submitTopology_args( - String name, - String uploadedJarLocation, - String jsonConf, - StormTopology topology) - { - this(); - this.name = name; - this.uploadedJarLocation = uploadedJarLocation; - this.jsonConf = jsonConf; - this.topology = topology; - } - - /** - * Performs a deep copy on other. - */ - public submitTopology_args(submitTopology_args other) { - if (other.is_set_name()) { - this.name = other.name; - } - if (other.is_set_uploadedJarLocation()) { - this.uploadedJarLocation = other.uploadedJarLocation; - } - if (other.is_set_jsonConf()) { - this.jsonConf = other.jsonConf; - } - if (other.is_set_topology()) { - this.topology = new StormTopology(other.topology); - } - } - - public submitTopology_args deepCopy() { - return new submitTopology_args(this); - } - - @Override - public void clear() { - this.name = null; - this.uploadedJarLocation = null; - this.jsonConf = null; - this.topology = null; - } - - public String get_name() { - return this.name; - } - - public void set_name(String name) { - this.name = name; - } - - public void unset_name() { - this.name = null; - } - - /** Returns true if field name is set (has been assigned a value) and false otherwise */ - public boolean is_set_name() { - return this.name != null; - } - - public void set_name_isSet(boolean value) { - if (!value) { - this.name = null; - } - } - - public String get_uploadedJarLocation() { - return this.uploadedJarLocation; - } - - public void set_uploadedJarLocation(String uploadedJarLocation) { - this.uploadedJarLocation = uploadedJarLocation; - } - - public void unset_uploadedJarLocation() { - this.uploadedJarLocation = null; - } - - /** Returns true if field uploadedJarLocation is set (has been assigned a value) and false otherwise */ - public boolean is_set_uploadedJarLocation() { - return this.uploadedJarLocation != null; - } - - public void set_uploadedJarLocation_isSet(boolean value) { - if (!value) { - this.uploadedJarLocation = null; - } - } - - public String get_jsonConf() { - return this.jsonConf; - } - - public void set_jsonConf(String jsonConf) { - this.jsonConf = jsonConf; - } - - public void unset_jsonConf() { - this.jsonConf = null; - } - - /** Returns true if field jsonConf is set (has been assigned a value) and false otherwise */ - public boolean is_set_jsonConf() { - return this.jsonConf != null; - } - - public void set_jsonConf_isSet(boolean value) { - if (!value) { - this.jsonConf = null; - } - } - - public StormTopology get_topology() { - return this.topology; - } - - public void set_topology(StormTopology topology) { - this.topology = topology; - } - - public void unset_topology() { - this.topology = null; - } - - /** Returns true if field topology is set (has been assigned a value) and false otherwise */ - public boolean is_set_topology() { - return this.topology != null; - } - - public void set_topology_isSet(boolean value) { - if (!value) { - this.topology = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case NAME: - if (value == null) { - unset_name(); - } else { - set_name((String)value); - } - break; - - case UPLOADED_JAR_LOCATION: - if (value == null) { - unset_uploadedJarLocation(); - } else { - set_uploadedJarLocation((String)value); - } - break; - - case JSON_CONF: - if (value == null) { - unset_jsonConf(); - } else { - set_jsonConf((String)value); - } - break; - - case TOPOLOGY: - if (value == null) { - unset_topology(); - } else { - set_topology((StormTopology)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case NAME: - return get_name(); - - case UPLOADED_JAR_LOCATION: - return get_uploadedJarLocation(); - - case JSON_CONF: - return get_jsonConf(); - - case TOPOLOGY: - return get_topology(); - - } - throw new 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(); - } - - switch (field) { - case NAME: - return is_set_name(); - case UPLOADED_JAR_LOCATION: - return is_set_uploadedJarLocation(); - case JSON_CONF: - return is_set_jsonConf(); - case TOPOLOGY: - return is_set_topology(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof submitTopology_args) - return this.equals((submitTopology_args)that); - return false; - } - - public boolean equals(submitTopology_args that) { - if (that == null) - return false; - - boolean this_present_name = true && this.is_set_name(); - boolean that_present_name = true && that.is_set_name(); - if (this_present_name || that_present_name) { - if (!(this_present_name && that_present_name)) - return false; - if (!this.name.equals(that.name)) - return false; - } - - boolean this_present_uploadedJarLocation = true && this.is_set_uploadedJarLocation(); - boolean that_present_uploadedJarLocation = true && that.is_set_uploadedJarLocation(); - if (this_present_uploadedJarLocation || that_present_uploadedJarLocation) { - if (!(this_present_uploadedJarLocation && that_present_uploadedJarLocation)) - return false; - if (!this.uploadedJarLocation.equals(that.uploadedJarLocation)) - return false; - } - - boolean this_present_jsonConf = true && this.is_set_jsonConf(); - boolean that_present_jsonConf = true && that.is_set_jsonConf(); - if (this_present_jsonConf || that_present_jsonConf) { - if (!(this_present_jsonConf && that_present_jsonConf)) - return false; - if (!this.jsonConf.equals(that.jsonConf)) - return false; - } - - boolean this_present_topology = true && this.is_set_topology(); - boolean that_present_topology = true && that.is_set_topology(); - if (this_present_topology || that_present_topology) { - if (!(this_present_topology && that_present_topology)) - return false; - if (!this.topology.equals(that.topology)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_name = true && (is_set_name()); - builder.append(present_name); - if (present_name) - builder.append(name); - - boolean present_uploadedJarLocation = true && (is_set_uploadedJarLocation()); - builder.append(present_uploadedJarLocation); - if (present_uploadedJarLocation) - builder.append(uploadedJarLocation); - - boolean present_jsonConf = true && (is_set_jsonConf()); - builder.append(present_jsonConf); - if (present_jsonConf) - builder.append(jsonConf); - - boolean present_topology = true && (is_set_topology()); - builder.append(present_topology); - if (present_topology) - builder.append(topology); - - return builder.toHashCode(); - } - - public int compareTo(submitTopology_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - submitTopology_args typedOther = (submitTopology_args)other; - - lastComparison = Boolean.valueOf(is_set_name()).compareTo(typedOther.is_set_name()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_name()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_uploadedJarLocation()).compareTo(typedOther.is_set_uploadedJarLocation()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_uploadedJarLocation()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uploadedJarLocation, typedOther.uploadedJarLocation); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_jsonConf()).compareTo(typedOther.is_set_jsonConf()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_jsonConf()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.jsonConf, typedOther.jsonConf); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_topology()).compareTo(typedOther.is_set_topology()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_topology()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.topology, typedOther.topology); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // NAME - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.name = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // UPLOADED_JAR_LOCATION - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.uploadedJarLocation = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // JSON_CONF - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.jsonConf = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // TOPOLOGY - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.topology = new StormTopology(); - this.topology.read(iprot); - } 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.name != null) { - oprot.writeFieldBegin(NAME_FIELD_DESC); - oprot.writeString(this.name); - oprot.writeFieldEnd(); - } - if (this.uploadedJarLocation != null) { - oprot.writeFieldBegin(UPLOADED_JAR_LOCATION_FIELD_DESC); - oprot.writeString(this.uploadedJarLocation); - oprot.writeFieldEnd(); - } - if (this.jsonConf != null) { - oprot.writeFieldBegin(JSON_CONF_FIELD_DESC); - oprot.writeString(this.jsonConf); - oprot.writeFieldEnd(); - } - if (this.topology != null) { - oprot.writeFieldBegin(TOPOLOGY_FIELD_DESC); - this.topology.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("submitTopology_args("); - boolean first = true; - - sb.append("name:"); - if (this.name == null) { - sb.append("null"); - } else { - sb.append(this.name); - } - first = false; - if (!first) sb.append(", "); - sb.append("uploadedJarLocation:"); - if (this.uploadedJarLocation == null) { - sb.append("null"); - } else { - sb.append(this.uploadedJarLocation); - } - first = false; - if (!first) sb.append(", "); - sb.append("jsonConf:"); - if (this.jsonConf == null) { - sb.append("null"); - } else { - sb.append(this.jsonConf); - } - first = false; - if (!first) sb.append(", "); - sb.append("topology:"); - if (this.topology == null) { - sb.append("null"); - } else { - sb.append(this.topology); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - } - - public static class submitTopology_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("submitTopology_result"); - - private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField ITE_FIELD_DESC = new org.apache.thrift.protocol.TField("ite", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private AlreadyAliveException e; // required - private InvalidTopologyException ite; // 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 { - E((short)1, "e"), - ITE((short)2, "ite"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // E - return E; - case 2: // ITE - return ITE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); - tmpMap.put(_Fields.ITE, new org.apache.thrift.meta_data.FieldMetaData("ite", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(submitTopology_result.class, metaDataMap); - } - - public submitTopology_result() { - } - - public submitTopology_result( - AlreadyAliveException e, - InvalidTopologyException ite) - { - this(); - this.e = e; - this.ite = ite; - } - - /** - * Performs a deep copy on other. - */ - public submitTopology_result(submitTopology_result other) { - if (other.is_set_e()) { - this.e = new AlreadyAliveException(other.e); - } - if (other.is_set_ite()) { - this.ite = new InvalidTopologyException(other.ite); - } - } - - public submitTopology_result deepCopy() { - return new submitTopology_result(this); - } - - @Override - public void clear() { - this.e = null; - this.ite = null; - } - - public AlreadyAliveException get_e() { - return this.e; - } - - public void set_e(AlreadyAliveException e) { - this.e = e; - } - - public void unset_e() { - this.e = null; - } - - /** Returns true if field e is set (has been assigned a value) and false otherwise */ - public boolean is_set_e() { - return this.e != null; - } - - public void set_e_isSet(boolean value) { - if (!value) { - this.e = null; - } - } - - public InvalidTopologyException get_ite() { - return this.ite; - } - - public void set_ite(InvalidTopologyException ite) { - this.ite = ite; - } - - public void unset_ite() { - this.ite = null; - } - - /** Returns true if field ite is set (has been assigned a value) and false otherwise */ - public boolean is_set_ite() { - return this.ite != null; - } - - public void set_ite_isSet(boolean value) { - if (!value) { - this.ite = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case E: - if (value == null) { - unset_e(); - } else { - set_e((AlreadyAliveException)value); - } - break; - - case ITE: - if (value == null) { - unset_ite(); - } else { - set_ite((InvalidTopologyException)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case E: - return get_e(); - - case ITE: - return get_ite(); - - } - throw new 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(); - } - - switch (field) { - case E: - return is_set_e(); - case ITE: - return is_set_ite(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof submitTopology_result) - return this.equals((submitTopology_result)that); - return false; - } - - public boolean equals(submitTopology_result that) { - if (that == null) - return false; - - boolean this_present_e = true && this.is_set_e(); - boolean that_present_e = true && that.is_set_e(); - if (this_present_e || that_present_e) { - if (!(this_present_e && that_present_e)) - return false; - if (!this.e.equals(that.e)) - return false; - } - - boolean this_present_ite = true && this.is_set_ite(); - boolean that_present_ite = true && that.is_set_ite(); - if (this_present_ite || that_present_ite) { - if (!(this_present_ite && that_present_ite)) - return false; - if (!this.ite.equals(that.ite)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_e = true && (is_set_e()); - builder.append(present_e); - if (present_e) - builder.append(e); - - boolean present_ite = true && (is_set_ite()); - builder.append(present_ite); - if (present_ite) - builder.append(ite); - - return builder.toHashCode(); - } - - public int compareTo(submitTopology_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - submitTopology_result typedOther = (submitTopology_result)other; - - lastComparison = Boolean.valueOf(is_set_e()).compareTo(typedOther.is_set_e()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_e()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_ite()).compareTo(typedOther.is_set_ite()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_ite()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ite, typedOther.ite); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // E - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.e = new AlreadyAliveException(); - this.e.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // ITE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ite = new InvalidTopologyException(); - this.ite.read(iprot); - } 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.is_set_e()) { - oprot.writeFieldBegin(E_FIELD_DESC); - this.e.write(oprot); - oprot.writeFieldEnd(); - } else if (this.is_set_ite()) { - oprot.writeFieldBegin(ITE_FIELD_DESC); - this.ite.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("submitTopology_result("); - boolean first = true; - - sb.append("e:"); - if (this.e == null) { - sb.append("null"); - } else { - sb.append(this.e); - } - first = false; - if (!first) sb.append(", "); - sb.append("ite:"); - if (this.ite == null) { - sb.append("null"); - } else { - sb.append(this.ite); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - } - - public static class killTopology_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("killTopology_args"); - - private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1); - - private String name; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - NAME((short)1, "name"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // NAME - return NAME; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(killTopology_args.class, metaDataMap); - } - - public killTopology_args() { - } - - public killTopology_args( - String name) - { - this(); - this.name = name; - } - - /** - * Performs a deep copy on other. - */ - public killTopology_args(killTopology_args other) { - if (other.is_set_name()) { - this.name = other.name; - } - } - - public killTopology_args deepCopy() { - return new killTopology_args(this); - } - - @Override - public void clear() { - this.name = null; - } - - public String get_name() { - return this.name; - } - - public void set_name(String name) { - this.name = name; - } - - public void unset_name() { - this.name = null; - } - - /** Returns true if field name is set (has been assigned a value) and false otherwise */ - public boolean is_set_name() { - return this.name != null; - } - - public void set_name_isSet(boolean value) { - if (!value) { - this.name = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case NAME: - if (value == null) { - unset_name(); - } else { - set_name((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case NAME: - return get_name(); - - } - throw new 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(); - } - - switch (field) { - case NAME: - return is_set_name(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof killTopology_args) - return this.equals((killTopology_args)that); - return false; - } - - public boolean equals(killTopology_args that) { - if (that == null) - return false; - - boolean this_present_name = true && this.is_set_name(); - boolean that_present_name = true && that.is_set_name(); - if (this_present_name || that_present_name) { - if (!(this_present_name && that_present_name)) - return false; - if (!this.name.equals(that.name)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_name = true && (is_set_name()); - builder.append(present_name); - if (present_name) - builder.append(name); - - return builder.toHashCode(); - } - - public int compareTo(killTopology_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - killTopology_args typedOther = (killTopology_args)other; - - lastComparison = Boolean.valueOf(is_set_name()).compareTo(typedOther.is_set_name()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_name()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // NAME - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.name = 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.name != null) { - oprot.writeFieldBegin(NAME_FIELD_DESC); - oprot.writeString(this.name); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("killTopology_args("); - boolean first = true; - - sb.append("name:"); - if (this.name == null) { - sb.append("null"); - } else { - sb.append(this.name); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - } - - public static class killTopology_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("killTopology_result"); - - private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private NotAliveException e; // 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 { - E((short)1, "e"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // E - return E; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(killTopology_result.class, metaDataMap); - } - - public killTopology_result() { - } - - public killTopology_result( - NotAliveException e) - { - this(); - this.e = e; - } - - /** - * Performs a deep copy on other. - */ - public killTopology_result(killTopology_result other) { - if (other.is_set_e()) { - this.e = new NotAliveException(other.e); - } - } - - public killTopology_result deepCopy() { - return new killTopology_result(this); - } - - @Override - public void clear() { - this.e = null; - } - - public NotAliveException get_e() { - return this.e; - } - - public void set_e(NotAliveException e) { - this.e = e; - } - - public void unset_e() { - this.e = null; - } - - /** Returns true if field e is set (has been assigned a value) and false otherwise */ - public boolean is_set_e() { - return this.e != null; - } - - public void set_e_isSet(boolean value) { - if (!value) { - this.e = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case E: - if (value == null) { - unset_e(); - } else { - set_e((NotAliveException)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case E: - return get_e(); - - } - throw new 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(); - } - - switch (field) { - case E: - return is_set_e(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof killTopology_result) - return this.equals((killTopology_result)that); - return false; - } - - public boolean equals(killTopology_result that) { - if (that == null) - return false; - - boolean this_present_e = true && this.is_set_e(); - boolean that_present_e = true && that.is_set_e(); - if (this_present_e || that_present_e) { - if (!(this_present_e && that_present_e)) - return false; - if (!this.e.equals(that.e)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_e = true && (is_set_e()); - builder.append(present_e); - if (present_e) - builder.append(e); - - return builder.toHashCode(); - } - - public int compareTo(killTopology_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - killTopology_result typedOther = (killTopology_result)other; - - lastComparison = Boolean.valueOf(is_set_e()).compareTo(typedOther.is_set_e()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_e()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // E - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.e = new NotAliveException(); - this.e.read(iprot); - } 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.is_set_e()) { - oprot.writeFieldBegin(E_FIELD_DESC); - this.e.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("killTopology_result("); - boolean first = true; - - sb.append("e:"); - if (this.e == null) { - sb.append("null"); - } else { - sb.append(this.e); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - } - - public static class killTopologyWithOpts_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("killTopologyWithOpts_args"); - - private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField OPTIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("options", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private String name; // required - private KillOptions options; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - NAME((short)1, "name"), - OPTIONS((short)2, "options"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // NAME - return NAME; - case 2: // OPTIONS - return OPTIONS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.OPTIONS, new org.apache.thrift.meta_data.FieldMetaData("options", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, KillOptions.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(killTopologyWithOpts_args.class, metaDataMap); - } - - public killTopologyWithOpts_args() { - } - - public killTopologyWithOpts_args( - String name, - KillOptions options) - { - this(); - this.name = name; - this.options = options; - } - - /** - * Performs a deep copy on other. - */ - public killTopologyWithOpts_args(killTopologyWithOpts_args other) { - if (other.is_set_name()) { - this.name = other.name; - } - if (other.is_set_options()) { - this.options = new KillOptions(other.options); - } - } - - public killTopologyWithOpts_args deepCopy() { - return new killTopologyWithOpts_args(this); - } - - @Override - public void clear() { - this.name = null; - this.options = null; - } - - public String get_name() { - return this.name; - } - - public void set_name(String name) { - this.name = name; - } - - public void unset_name() { - this.name = null; - } - - /** Returns true if field name is set (has been assigned a value) and false otherwise */ - public boolean is_set_name() { - return this.name != null; - } - - public void set_name_isSet(boolean value) { - if (!value) { - this.name = null; - } - } - - public KillOptions get_options() { - return this.options; - } - - public void set_options(KillOptions options) { - this.options = options; - } - - public void unset_options() { - this.options = null; - } - - /** Returns true if field options is set (has been assigned a value) and false otherwise */ - public boolean is_set_options() { - return this.options != null; - } - - public void set_options_isSet(boolean value) { - if (!value) { - this.options = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case NAME: - if (value == null) { - unset_name(); - } else { - set_name((String)value); - } - break; - - case OPTIONS: - if (value == null) { - unset_options(); - } else { - set_options((KillOptions)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case NAME: - return get_name(); - - case OPTIONS: - return get_options(); - - } - throw new 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(); - } - - switch (field) { - case NAME: - return is_set_name(); - case OPTIONS: - return is_set_options(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof killTopologyWithOpts_args) - return this.equals((killTopologyWithOpts_args)that); - return false; - } - - public boolean equals(killTopologyWithOpts_args that) { - if (that == null) - return false; - - boolean this_present_name = true && this.is_set_name(); - boolean that_present_name = true && that.is_set_name(); - if (this_present_name || that_present_name) { - if (!(this_present_name && that_present_name)) - return false; - if (!this.name.equals(that.name)) - return false; - } - - boolean this_present_options = true && this.is_set_options(); - boolean that_present_options = true && that.is_set_options(); - if (this_present_options || that_present_options) { - if (!(this_present_options && that_present_options)) - return false; - if (!this.options.equals(that.options)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_name = true && (is_set_name()); - builder.append(present_name); - if (present_name) - builder.append(name); - - boolean present_options = true && (is_set_options()); - builder.append(present_options); - if (present_options) - builder.append(options); - - return builder.toHashCode(); - } - - public int compareTo(killTopologyWithOpts_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - killTopologyWithOpts_args typedOther = (killTopologyWithOpts_args)other; - - lastComparison = Boolean.valueOf(is_set_name()).compareTo(typedOther.is_set_name()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_name()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_options()).compareTo(typedOther.is_set_options()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_options()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.options, typedOther.options); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // NAME - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.name = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // OPTIONS - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.options = new KillOptions(); - this.options.read(iprot); - } 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.name != null) { - oprot.writeFieldBegin(NAME_FIELD_DESC); - oprot.writeString(this.name); - oprot.writeFieldEnd(); - } - if (this.options != null) { - oprot.writeFieldBegin(OPTIONS_FIELD_DESC); - this.options.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("killTopologyWithOpts_args("); - boolean first = true; - - sb.append("name:"); - if (this.name == null) { - sb.append("null"); - } else { - sb.append(this.name); - } - first = false; - if (!first) sb.append(", "); - sb.append("options:"); - if (this.options == null) { - sb.append("null"); - } else { - sb.append(this.options); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - } - - public static class killTopologyWithOpts_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("killTopologyWithOpts_result"); - - private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private NotAliveException e; // 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 { - E((short)1, "e"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // E - return E; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(killTopologyWithOpts_result.class, metaDataMap); - } - - public killTopologyWithOpts_result() { - } - - public killTopologyWithOpts_result( - NotAliveException e) - { - this(); - this.e = e; - } - - /** - * Performs a deep copy on other. - */ - public killTopologyWithOpts_result(killTopologyWithOpts_result other) { - if (other.is_set_e()) { - this.e = new NotAliveException(other.e); - } - } - - public killTopologyWithOpts_result deepCopy() { - return new killTopologyWithOpts_result(this); - } - - @Override - public void clear() { - this.e = null; - } - - public NotAliveException get_e() { - return this.e; - } - - public void set_e(NotAliveException e) { - this.e = e; - } - - public void unset_e() { - this.e = null; - } - - /** Returns true if field e is set (has been assigned a value) and false otherwise */ - public boolean is_set_e() { - return this.e != null; - } - - public void set_e_isSet(boolean value) { - if (!value) { - this.e = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case E: - if (value == null) { - unset_e(); - } else { - set_e((NotAliveException)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case E: - return get_e(); - - } - throw new 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(); - } - - switch (field) { - case E: - return is_set_e(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof killTopologyWithOpts_result) - return this.equals((killTopologyWithOpts_result)that); - return false; - } - - public boolean equals(killTopologyWithOpts_result that) { - if (that == null) - return false; - - boolean this_present_e = true && this.is_set_e(); - boolean that_present_e = true && that.is_set_e(); - if (this_present_e || that_present_e) { - if (!(this_present_e && that_present_e)) - return false; - if (!this.e.equals(that.e)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_e = true && (is_set_e()); - builder.append(present_e); - if (present_e) - builder.append(e); - - return builder.toHashCode(); - } - - public int compareTo(killTopologyWithOpts_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - killTopologyWithOpts_result typedOther = (killTopologyWithOpts_result)other; - - lastComparison = Boolean.valueOf(is_set_e()).compareTo(typedOther.is_set_e()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_e()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // E - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.e = new NotAliveException(); - this.e.read(iprot); - } 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.is_set_e()) { - oprot.writeFieldBegin(E_FIELD_DESC); - this.e.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("killTopologyWithOpts_result("); - boolean first = true; - - sb.append("e:"); - if (this.e == null) { - sb.append("null"); - } else { - sb.append(this.e); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - } - - public static class activate_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("activate_args"); - - private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1); - - private String name; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - NAME((short)1, "name"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // NAME - return NAME; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(activate_args.class, metaDataMap); - } - - public activate_args() { - } - - public activate_args( - String name) - { - this(); - this.name = name; - } - - /** - * Performs a deep copy on other. - */ - public activate_args(activate_args other) { - if (other.is_set_name()) { - this.name = other.name; - } - } - - public activate_args deepCopy() { - return new activate_args(this); - } - - @Override - public void clear() { - this.name = null; - } - - public String get_name() { - return this.name; - } - - public void set_name(String name) { - this.name = name; - } - - public void unset_name() { - this.name = null; - } - - /** Returns true if field name is set (has been assigned a value) and false otherwise */ - public boolean is_set_name() { - return this.name != null; - } - - public void set_name_isSet(boolean value) { - if (!value) { - this.name = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case NAME: - if (value == null) { - unset_name(); - } else { - set_name((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case NAME: - return get_name(); - - } - throw new 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(); - } - - switch (field) { - case NAME: - return is_set_name(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof activate_args) - return this.equals((activate_args)that); - return false; - } - - public boolean equals(activate_args that) { - if (that == null) - return false; - - boolean this_present_name = true && this.is_set_name(); - boolean that_present_name = true && that.is_set_name(); - if (this_present_name || that_present_name) { - if (!(this_present_name && that_present_name)) - return false; - if (!this.name.equals(that.name)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_name = true && (is_set_name()); - builder.append(present_name); - if (present_name) - builder.append(name); - - return builder.toHashCode(); - } - - public int compareTo(activate_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - activate_args typedOther = (activate_args)other; - - lastComparison = Boolean.valueOf(is_set_name()).compareTo(typedOther.is_set_name()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_name()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // NAME - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.name = 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.name != null) { - oprot.writeFieldBegin(NAME_FIELD_DESC); - oprot.writeString(this.name); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("activate_args("); - boolean first = true; - - sb.append("name:"); - if (this.name == null) { - sb.append("null"); - } else { - sb.append(this.name); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - } - - public static class activate_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("activate_result"); - - private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private NotAliveException e; // 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 { - E((short)1, "e"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // E - return E; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(activate_result.class, metaDataMap); - } - - public activate_result() { - } - - public activate_result( - NotAliveException e) - { - this(); - this.e = e; - } - - /** - * Performs a deep copy on other. - */ - public activate_result(activate_result other) { - if (other.is_set_e()) { - this.e = new NotAliveException(other.e); - } - } - - public activate_result deepCopy() { - return new activate_result(this); - } - - @Override - public void clear() { - this.e = null; - } - - public NotAliveException get_e() { - return this.e; - } - - public void set_e(NotAliveException e) { - this.e = e; - } - - public void unset_e() { - this.e = null; - } - - /** Returns true if field e is set (has been assigned a value) and false otherwise */ - public boolean is_set_e() { - return this.e != null; - } - - public void set_e_isSet(boolean value) { - if (!value) { - this.e = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case E: - if (value == null) { - unset_e(); - } else { - set_e((NotAliveException)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case E: - return get_e(); - - } - throw new 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(); - } - - switch (field) { - case E: - return is_set_e(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof activate_result) - return this.equals((activate_result)that); - return false; - } - - public boolean equals(activate_result that) { - if (that == null) - return false; - - boolean this_present_e = true && this.is_set_e(); - boolean that_present_e = true && that.is_set_e(); - if (this_present_e || that_present_e) { - if (!(this_present_e && that_present_e)) - return false; - if (!this.e.equals(that.e)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_e = true && (is_set_e()); - builder.append(present_e); - if (present_e) - builder.append(e); - - return builder.toHashCode(); - } - - public int compareTo(activate_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - activate_result typedOther = (activate_result)other; - - lastComparison = Boolean.valueOf(is_set_e()).compareTo(typedOther.is_set_e()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_e()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // E - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.e = new NotAliveException(); - this.e.read(iprot); - } 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.is_set_e()) { - oprot.writeFieldBegin(E_FIELD_DESC); - this.e.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("activate_result("); - boolean first = true; - - sb.append("e:"); - if (this.e == null) { - sb.append("null"); - } else { - sb.append(this.e); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - } - - public static class deactivate_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deactivate_args"); - - private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1); - - private String name; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - NAME((short)1, "name"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // NAME - return NAME; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deactivate_args.class, metaDataMap); - } - - public deactivate_args() { - } - - public deactivate_args( - String name) - { - this(); - this.name = name; - } - - /** - * Performs a deep copy on other. - */ - public deactivate_args(deactivate_args other) { - if (other.is_set_name()) { - this.name = other.name; - } - } - - public deactivate_args deepCopy() { - return new deactivate_args(this); - } - - @Override - public void clear() { - this.name = null; - } - - public String get_name() { - return this.name; - } - - public void set_name(String name) { - this.name = name; - } - - public void unset_name() { - this.name = null; - } - - /** Returns true if field name is set (has been assigned a value) and false otherwise */ - public boolean is_set_name() { - return this.name != null; - } - - public void set_name_isSet(boolean value) { - if (!value) { - this.name = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case NAME: - if (value == null) { - unset_name(); - } else { - set_name((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case NAME: - return get_name(); - - } - throw new 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(); - } - - switch (field) { - case NAME: - return is_set_name(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof deactivate_args) - return this.equals((deactivate_args)that); - return false; - } - - public boolean equals(deactivate_args that) { - if (that == null) - return false; - - boolean this_present_name = true && this.is_set_name(); - boolean that_present_name = true && that.is_set_name(); - if (this_present_name || that_present_name) { - if (!(this_present_name && that_present_name)) - return false; - if (!this.name.equals(that.name)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_name = true && (is_set_name()); - builder.append(present_name); - if (present_name) - builder.append(name); - - return builder.toHashCode(); - } - - public int compareTo(deactivate_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - deactivate_args typedOther = (deactivate_args)other; - - lastComparison = Boolean.valueOf(is_set_name()).compareTo(typedOther.is_set_name()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_name()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // NAME - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.name = 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.name != null) { - oprot.writeFieldBegin(NAME_FIELD_DESC); - oprot.writeString(this.name); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("deactivate_args("); - boolean first = true; - - sb.append("name:"); - if (this.name == null) { - sb.append("null"); - } else { - sb.append(this.name); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - } - - public static class deactivate_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deactivate_result"); - - private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private NotAliveException e; // 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 { - E((short)1, "e"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // E - return E; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deactivate_result.class, metaDataMap); - } - - public deactivate_result() { - } - - public deactivate_result( - NotAliveException e) - { - this(); - this.e = e; - } - - /** - * Performs a deep copy on other. - */ - public deactivate_result(deactivate_result other) { - if (other.is_set_e()) { - this.e = new NotAliveException(other.e); - } - } - - public deactivate_result deepCopy() { - return new deactivate_result(this); - } - - @Override - public void clear() { - this.e = null; - } - - public NotAliveException get_e() { - return this.e; - } - - public void set_e(NotAliveException e) { - this.e = e; - } - - public void unset_e() { - this.e = null; - } - - /** Returns true if field e is set (has been assigned a value) and false otherwise */ - public boolean is_set_e() { - return this.e != null; - } - - public void set_e_isSet(boolean value) { - if (!value) { - this.e = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case E: - if (value == null) { - unset_e(); - } else { - set_e((NotAliveException)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case E: - return get_e(); - - } - throw new 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(); - } - - switch (field) { - case E: - return is_set_e(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof deactivate_result) - return this.equals((deactivate_result)that); - return false; - } - - public boolean equals(deactivate_result that) { - if (that == null) - return false; - - boolean this_present_e = true && this.is_set_e(); - boolean that_present_e = true && that.is_set_e(); - if (this_present_e || that_present_e) { - if (!(this_present_e && that_present_e)) - return false; - if (!this.e.equals(that.e)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_e = true && (is_set_e()); - builder.append(present_e); - if (present_e) - builder.append(e); - - return builder.toHashCode(); - } - - public int compareTo(deactivate_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - deactivate_result typedOther = (deactivate_result)other; - - lastComparison = Boolean.valueOf(is_set_e()).compareTo(typedOther.is_set_e()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_e()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // E - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.e = new NotAliveException(); - this.e.read(iprot); - } 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.is_set_e()) { - oprot.writeFieldBegin(E_FIELD_DESC); - this.e.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("deactivate_result("); - boolean first = true; - - sb.append("e:"); - if (this.e == null) { - sb.append("null"); - } else { - sb.append(this.e); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - } - - public static class rebalance_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("rebalance_args"); - - private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField OPTIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("options", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private String name; // required - private RebalanceOptions options; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - NAME((short)1, "name"), - OPTIONS((short)2, "options"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // NAME - return NAME; - case 2: // OPTIONS - return OPTIONS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.OPTIONS, new org.apache.thrift.meta_data.FieldMetaData("options", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RebalanceOptions.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(rebalance_args.class, metaDataMap); - } - - public rebalance_args() { - } - - public rebalance_args( - String name, - RebalanceOptions options) - { - this(); - this.name = name; - this.options = options; - } - - /** - * Performs a deep copy on other. - */ - public rebalance_args(rebalance_args other) { - if (other.is_set_name()) { - this.name = other.name; - } - if (other.is_set_options()) { - this.options = new RebalanceOptions(other.options); - } - } - - public rebalance_args deepCopy() { - return new rebalance_args(this); - } - - @Override - public void clear() { - this.name = null; - this.options = null; - } - - public String get_name() { - return this.name; - } - - public void set_name(String name) { - this.name = name; - } - - public void unset_name() { - this.name = null; - } - - /** Returns true if field name is set (has been assigned a value) and false otherwise */ - public boolean is_set_name() { - return this.name != null; - } - - public void set_name_isSet(boolean value) { - if (!value) { - this.name = null; - } - } - - public RebalanceOptions get_options() { - return this.options; - } - - public void set_options(RebalanceOptions options) { - this.options = options; - } - - public void unset_options() { - this.options = null; - } - - /** Returns true if field options is set (has been assigned a value) and false otherwise */ - public boolean is_set_options() { - return this.options != null; - } - - public void set_options_isSet(boolean value) { - if (!value) { - this.options = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case NAME: - if (value == null) { - unset_name(); - } else { - set_name((String)value); - } - break; - - case OPTIONS: - if (value == null) { - unset_options(); - } else { - set_options((RebalanceOptions)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case NAME: - return get_name(); - - case OPTIONS: - return get_options(); - - } - throw new 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(); - } - - switch (field) { - case NAME: - return is_set_name(); - case OPTIONS: - return is_set_options(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof rebalance_args) - return this.equals((rebalance_args)that); - return false; - } - - public boolean equals(rebalance_args that) { - if (that == null) - return false; - - boolean this_present_name = true && this.is_set_name(); - boolean that_present_name = true && that.is_set_name(); - if (this_present_name || that_present_name) { - if (!(this_present_name && that_present_name)) - return false; - if (!this.name.equals(that.name)) - return false; - } - - boolean this_present_options = true && this.is_set_options(); - boolean that_present_options = true && that.is_set_options(); - if (this_present_options || that_present_options) { - if (!(this_present_options && that_present_options)) - return false; - if (!this.options.equals(that.options)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_name = true && (is_set_name()); - builder.append(present_name); - if (present_name) - builder.append(name); - - boolean present_options = true && (is_set_options()); - builder.append(present_options); - if (present_options) - builder.append(options); - - return builder.toHashCode(); - } - - public int compareTo(rebalance_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - rebalance_args typedOther = (rebalance_args)other; - - lastComparison = Boolean.valueOf(is_set_name()).compareTo(typedOther.is_set_name()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_name()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_options()).compareTo(typedOther.is_set_options()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_options()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.options, typedOther.options); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // NAME - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.name = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // OPTIONS - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.options = new RebalanceOptions(); - this.options.read(iprot); - } 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.name != null) { - oprot.writeFieldBegin(NAME_FIELD_DESC); - oprot.writeString(this.name); - oprot.writeFieldEnd(); - } - if (this.options != null) { - oprot.writeFieldBegin(OPTIONS_FIELD_DESC); - this.options.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("rebalance_args("); - boolean first = true; - - sb.append("name:"); - if (this.name == null) { - sb.append("null"); - } else { - sb.append(this.name); - } - first = false; - if (!first) sb.append(", "); - sb.append("options:"); - if (this.options == null) { - sb.append("null"); - } else { - sb.append(this.options); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - } - - public static class rebalance_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("rebalance_result"); - - private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private NotAliveException e; // 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 { - E((short)1, "e"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // E - return E; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(rebalance_result.class, metaDataMap); - } - - public rebalance_result() { - } - - public rebalance_result( - NotAliveException e) - { - this(); - this.e = e; - } - - /** - * Performs a deep copy on other. - */ - public rebalance_result(rebalance_result other) { - if (other.is_set_e()) { - this.e = new NotAliveException(other.e); - } - } - - public rebalance_result deepCopy() { - return new rebalance_result(this); - } - - @Override - public void clear() { - this.e = null; - } - - public NotAliveException get_e() { - return this.e; - } - - public void set_e(NotAliveException e) { - this.e = e; - } - - public void unset_e() { - this.e = null; - } - - /** Returns true if field e is set (has been assigned a value) and false otherwise */ - public boolean is_set_e() { - return this.e != null; - } - - public void set_e_isSet(boolean value) { - if (!value) { - this.e = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case E: - if (value == null) { - unset_e(); - } else { - set_e((NotAliveException)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case E: - return get_e(); - - } - throw new 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(); - } - - switch (field) { - case E: - return is_set_e(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof rebalance_result) - return this.equals((rebalance_result)that); - return false; - } - - public boolean equals(rebalance_result that) { - if (that == null) - return false; - - boolean this_present_e = true && this.is_set_e(); - boolean that_present_e = true && that.is_set_e(); - if (this_present_e || that_present_e) { - if (!(this_present_e && that_present_e)) - return false; - if (!this.e.equals(that.e)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_e = true && (is_set_e()); - builder.append(present_e); - if (present_e) - builder.append(e); - - return builder.toHashCode(); - } - - public int compareTo(rebalance_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - rebalance_result typedOther = (rebalance_result)other; - - lastComparison = Boolean.valueOf(is_set_e()).compareTo(typedOther.is_set_e()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_e()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // E - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.e = new NotAliveException(); - this.e.read(iprot); - } 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.is_set_e()) { - oprot.writeFieldBegin(E_FIELD_DESC); - this.e.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("rebalance_result("); - boolean first = true; - - sb.append("e:"); - if (this.e == null) { - sb.append("null"); - } else { - sb.append(this.e); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - } - - public static class beginFileUpload_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("beginFileUpload_args"); - - - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -; - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - 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); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(beginFileUpload_args.class, metaDataMap); - } - - public beginFileUpload_args() { - } - - /** - * Performs a deep copy on other. - */ - public beginFileUpload_args(beginFileUpload_args other) { - } - - public beginFileUpload_args deepCopy() { - return new beginFileUpload_args(this); - } - - @Override - public void clear() { - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - } - throw new 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(); - } - - switch (field) { - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof beginFileUpload_args) - return this.equals((beginFileUpload_args)that); - return false; - } - - public boolean equals(beginFileUpload_args that) { - if (that == null) - return false; - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - return builder.toHashCode(); - } - - public int compareTo(beginFileUpload_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - beginFileUpload_args typedOther = (beginFileUpload_args)other; - - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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) { - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("beginFileUpload_args("); - boolean first = true; - - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - } - - public static class beginFileUpload_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("beginFileUpload_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); - - private String success; // 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 { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(beginFileUpload_result.class, metaDataMap); - } - - public beginFileUpload_result() { - } - - public beginFileUpload_result( - String success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public beginFileUpload_result(beginFileUpload_result other) { - if (other.is_set_success()) { - this.success = other.success; - } - } - - public beginFileUpload_result deepCopy() { - return new beginFileUpload_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public String get_success() { - return this.success; - } - - public void set_success(String success) { - this.success = success; - } - - public void unset_success() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean is_set_success() { - return this.success != null; - } - - public void set_success_isSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unset_success(); - } else { - set_success((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return get_success(); - - } - throw new 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(); - } - - switch (field) { - case SUCCESS: - return is_set_success(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof beginFileUpload_result) - return this.equals((beginFileUpload_result)that); - return false; - } - - public boolean equals(beginFileUpload_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.is_set_success(); - boolean that_present_success = true && that.is_set_success(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_success = true && (is_set_success()); - builder.append(present_success); - if (present_success) - builder.append(success); - - return builder.toHashCode(); - } - - public int compareTo(beginFileUpload_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - beginFileUpload_result typedOther = (beginFileUpload_result)other; - - lastComparison = Boolean.valueOf(is_set_success()).compareTo(typedOther.is_set_success()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_success()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.success = 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.is_set_success()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeString(this.success); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("beginFileUpload_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - } - - public static class uploadChunk_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("uploadChunk_args"); - - private static final org.apache.thrift.protocol.TField LOCATION_FIELD_DESC = new org.apache.thrift.protocol.TField("location", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField CHUNK_FIELD_DESC = new org.apache.thrift.protocol.TField("chunk", org.apache.thrift.protocol.TType.STRING, (short)2); - - private String location; // required - private ByteBuffer chunk; // 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 { - LOCATION((short)1, "location"), - CHUNK((short)2, "chunk"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // LOCATION - return LOCATION; - case 2: // CHUNK - return CHUNK; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.LOCATION, new org.apache.thrift.meta_data.FieldMetaData("location", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.CHUNK, new org.apache.thrift.meta_data.FieldMetaData("chunk", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(uploadChunk_args.class, metaDataMap); - } - - public uploadChunk_args() { - } - - public uploadChunk_args( - String location, - ByteBuffer chunk) - { - this(); - this.location = location; - this.chunk = chunk; - } - - /** - * Performs a deep copy on other. - */ - public uploadChunk_args(uploadChunk_args other) { - if (other.is_set_location()) { - this.location = other.location; - } - if (other.is_set_chunk()) { - this.chunk = org.apache.thrift.TBaseHelper.copyBinary(other.chunk); -; - } - } - - public uploadChunk_args deepCopy() { - return new uploadChunk_args(this); - } - - @Override - public void clear() { - this.location = null; - this.chunk = null; - } - - public String get_location() { - return this.location; - } - - public void set_location(String location) { - this.location = location; - } - - public void unset_location() { - this.location = null; - } - - /** Returns true if field location is set (has been assigned a value) and false otherwise */ - public boolean is_set_location() { - return this.location != null; - } - - public void set_location_isSet(boolean value) { - if (!value) { - this.location = null; - } - } - - public byte[] get_chunk() { - set_chunk(org.apache.thrift.TBaseHelper.rightSize(chunk)); - return chunk == null ? null : chunk.array(); - } - - public ByteBuffer buffer_for_chunk() { - return chunk; - } - - public void set_chunk(byte[] chunk) { - set_chunk(chunk == null ? (ByteBuffer)null : ByteBuffer.wrap(chunk)); - } - - public void set_chunk(ByteBuffer chunk) { - this.chunk = chunk; - } - - public void unset_chunk() { - this.chunk = null; - } - - /** Returns true if field chunk is set (has been assigned a value) and false otherwise */ - public boolean is_set_chunk() { - return this.chunk != null; - } - - public void set_chunk_isSet(boolean value) { - if (!value) { - this.chunk = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case LOCATION: - if (value == null) { - unset_location(); - } else { - set_location((String)value); - } - break; - - case CHUNK: - if (value == null) { - unset_chunk(); - } else { - set_chunk((ByteBuffer)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case LOCATION: - return get_location(); - - case CHUNK: - return get_chunk(); - - } - throw new 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(); - } - - switch (field) { - case LOCATION: - return is_set_location(); - case CHUNK: - return is_set_chunk(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof uploadChunk_args) - return this.equals((uploadChunk_args)that); - return false; - } - - public boolean equals(uploadChunk_args that) { - if (that == null) - return false; - - boolean this_present_location = true && this.is_set_location(); - boolean that_present_location = true && that.is_set_location(); - if (this_present_location || that_present_location) { - if (!(this_present_location && that_present_location)) - return false; - if (!this.location.equals(that.location)) - return false; - } - - boolean this_present_chunk = true && this.is_set_chunk(); - boolean that_present_chunk = true && that.is_set_chunk(); - if (this_present_chunk || that_present_chunk) { - if (!(this_present_chunk && that_present_chunk)) - return false; - if (!this.chunk.equals(that.chunk)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_location = true && (is_set_location()); - builder.append(present_location); - if (present_location) - builder.append(location); - - boolean present_chunk = true && (is_set_chunk()); - builder.append(present_chunk); - if (present_chunk) - builder.append(chunk); - - return builder.toHashCode(); - } - - public int compareTo(uploadChunk_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - uploadChunk_args typedOther = (uploadChunk_args)other; - - lastComparison = Boolean.valueOf(is_set_location()).compareTo(typedOther.is_set_location()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_location()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.location, typedOther.location); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_chunk()).compareTo(typedOther.is_set_chunk()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_chunk()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.chunk, typedOther.chunk); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // LOCATION - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.location = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // CHUNK - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.chunk = iprot.readBinary(); - } 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.location != null) { - oprot.writeFieldBegin(LOCATION_FIELD_DESC); - oprot.writeString(this.location); - oprot.writeFieldEnd(); - } - if (this.chunk != null) { - oprot.writeFieldBegin(CHUNK_FIELD_DESC); - oprot.writeBinary(this.chunk); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("uploadChunk_args("); - boolean first = true; - - sb.append("location:"); - if (this.location == null) { - sb.append("null"); - } else { - sb.append(this.location); - } - first = false; - if (!first) sb.append(", "); - sb.append("chunk:"); - if (this.chunk == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.chunk, sb); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - } - - public static class uploadChunk_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("uploadChunk_result"); - - - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -; - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - 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); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(uploadChunk_result.class, metaDataMap); - } - - public uploadChunk_result() { - } - - /** - * Performs a deep copy on other. - */ - public uploadChunk_result(uploadChunk_result other) { - } - - public uploadChunk_result deepCopy() { - return new uploadChunk_result(this); - } - - @Override - public void clear() { - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - } - throw new 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(); - } - - switch (field) { - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof uploadChunk_result) - return this.equals((uploadChunk_result)that); - return false; - } - - public boolean equals(uploadChunk_result that) { - if (that == null) - return false; - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - return builder.toHashCode(); - } - - public int compareTo(uploadChunk_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - uploadChunk_result typedOther = (uploadChunk_result)other; - - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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) { - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("uploadChunk_result("); - boolean first = true; - - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - } - - public static class finishFileUpload_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("finishFileUpload_args"); - - private static final org.apache.thrift.protocol.TField LOCATION_FIELD_DESC = new org.apache.thrift.protocol.TField("location", org.apache.thrift.protocol.TType.STRING, (short)1); - - private String location; // 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 { - LOCATION((short)1, "location"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // LOCATION - return LOCATION; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.LOCATION, new org.apache.thrift.meta_data.FieldMetaData("location", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(finishFileUpload_args.class, metaDataMap); - } - - public finishFileUpload_args() { - } - - public finishFileUpload_args( - String location) - { - this(); - this.location = location; - } - - /** - * Performs a deep copy on other. - */ - public finishFileUpload_args(finishFileUpload_args other) { - if (other.is_set_location()) { - this.location = other.location; - } - } - - public finishFileUpload_args deepCopy() { - return new finishFileUpload_args(this); - } - - @Override - public void clear() { - this.location = null; - } - - public String get_location() { - return this.location; - } - - public void set_location(String location) { - this.location = location; - } - - public void unset_location() { - this.location = null; - } - - /** Returns true if field location is set (has been assigned a value) and false otherwise */ - public boolean is_set_location() { - return this.location != null; - } - - public void set_location_isSet(boolean value) { - if (!value) { - this.location = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case LOCATION: - if (value == null) { - unset_location(); - } else { - set_location((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case LOCATION: - return get_location(); - - } - throw new 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(); - } - - switch (field) { - case LOCATION: - return is_set_location(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof finishFileUpload_args) - return this.equals((finishFileUpload_args)that); - return false; - } - - public boolean equals(finishFileUpload_args that) { - if (that == null) - return false; - - boolean this_present_location = true && this.is_set_location(); - boolean that_present_location = true && that.is_set_location(); - if (this_present_location || that_present_location) { - if (!(this_present_location && that_present_location)) - return false; - if (!this.location.equals(that.location)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_location = true && (is_set_location()); - builder.append(present_location); - if (present_location) - builder.append(location); - - return builder.toHashCode(); - } - - public int compareTo(finishFileUpload_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - finishFileUpload_args typedOther = (finishFileUpload_args)other; - - lastComparison = Boolean.valueOf(is_set_location()).compareTo(typedOther.is_set_location()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_location()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.location, typedOther.location); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // LOCATION - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.location = 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.location != null) { - oprot.writeFieldBegin(LOCATION_FIELD_DESC); - oprot.writeString(this.location); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("finishFileUpload_args("); - boolean first = true; - - sb.append("location:"); - if (this.location == null) { - sb.append("null"); - } else { - sb.append(this.location); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - } - - public static class finishFileUpload_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("finishFileUpload_result"); - - - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -; - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - 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); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(finishFileUpload_result.class, metaDataMap); - } - - public finishFileUpload_result() { - } - - /** - * Performs a deep copy on other. - */ - public finishFileUpload_result(finishFileUpload_result other) { - } - - public finishFileUpload_result deepCopy() { - return new finishFileUpload_result(this); - } - - @Override - public void clear() { - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - } - throw new 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(); - } - - switch (field) { - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof finishFileUpload_result) - return this.equals((finishFileUpload_result)that); - return false; - } - - public boolean equals(finishFileUpload_result that) { - if (that == null) - return false; - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - return builder.toHashCode(); - } - - public int compareTo(finishFileUpload_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - finishFileUpload_result typedOther = (finishFileUpload_result)other; - - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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) { - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("finishFileUpload_result("); - boolean first = true; - - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - } - - public static class beginFileDownload_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("beginFileDownload_args"); - - private static final org.apache.thrift.protocol.TField FILE_FIELD_DESC = new org.apache.thrift.protocol.TField("file", org.apache.thrift.protocol.TType.STRING, (short)1); - - private String file; // 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 { - FILE((short)1, "file"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // FILE - return FILE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.FILE, new org.apache.thrift.meta_data.FieldMetaData("file", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(beginFileDownload_args.class, metaDataMap); - } - - public beginFileDownload_args() { - } - - public beginFileDownload_args( - String file) - { - this(); - this.file = file; - } - - /** - * Performs a deep copy on other. - */ - public beginFileDownload_args(beginFileDownload_args other) { - if (other.is_set_file()) { - this.file = other.file; - } - } - - public beginFileDownload_args deepCopy() { - return new beginFileDownload_args(this); - } - - @Override - public void clear() { - this.file = null; - } - - public String get_file() { - return this.file; - } - - public void set_file(String file) { - this.file = file; - } - - public void unset_file() { - this.file = null; - } - - /** Returns true if field file is set (has been assigned a value) and false otherwise */ - public boolean is_set_file() { - return this.file != null; - } - - public void set_file_isSet(boolean value) { - if (!value) { - this.file = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case FILE: - if (value == null) { - unset_file(); - } else { - set_file((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case FILE: - return get_file(); - - } - throw new 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(); - } - - switch (field) { - case FILE: - return is_set_file(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof beginFileDownload_args) - return this.equals((beginFileDownload_args)that); - return false; - } - - public boolean equals(beginFileDownload_args that) { - if (that == null) - return false; - - boolean this_present_file = true && this.is_set_file(); - boolean that_present_file = true && that.is_set_file(); - if (this_present_file || that_present_file) { - if (!(this_present_file && that_present_file)) - return false; - if (!this.file.equals(that.file)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_file = true && (is_set_file()); - builder.append(present_file); - if (present_file) - builder.append(file); - - return builder.toHashCode(); - } - - public int compareTo(beginFileDownload_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - beginFileDownload_args typedOther = (beginFileDownload_args)other; - - lastComparison = Boolean.valueOf(is_set_file()).compareTo(typedOther.is_set_file()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_file()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.file, typedOther.file); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // FILE - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.file = 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.file != null) { - oprot.writeFieldBegin(FILE_FIELD_DESC); - oprot.writeString(this.file); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("beginFileDownload_args("); - boolean first = true; - - sb.append("file:"); - if (this.file == null) { - sb.append("null"); - } else { - sb.append(this.file); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - } - - public static class beginFileDownload_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("beginFileDownload_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); - - private String success; // 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 { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(beginFileDownload_result.class, metaDataMap); - } - - public beginFileDownload_result() { - } - - public beginFileDownload_result( - String success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public beginFileDownload_result(beginFileDownload_result other) { - if (other.is_set_success()) { - this.success = other.success; - } - } - - public beginFileDownload_result deepCopy() { - return new beginFileDownload_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public String get_success() { - return this.success; - } - - public void set_success(String success) { - this.success = success; - } - - public void unset_success() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean is_set_success() { - return this.success != null; - } - - public void set_success_isSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unset_success(); - } else { - set_success((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return get_success(); - - } - throw new 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(); - } - - switch (field) { - case SUCCESS: - return is_set_success(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof beginFileDownload_result) - return this.equals((beginFileDownload_result)that); - return false; - } - - public boolean equals(beginFileDownload_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.is_set_success(); - boolean that_present_success = true && that.is_set_success(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_success = true && (is_set_success()); - builder.append(present_success); - if (present_success) - builder.append(success); - - return builder.toHashCode(); - } - - public int compareTo(beginFileDownload_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - beginFileDownload_result typedOther = (beginFileDownload_result)other; - - lastComparison = Boolean.valueOf(is_set_success()).compareTo(typedOther.is_set_success()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_success()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.success = 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.is_set_success()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeString(this.success); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("beginFileDownload_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - } - - public static class downloadChunk_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("downloadChunk_args"); - - private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1); - - private String 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 { - ID((short)1, "id"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // ID - return ID; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(downloadChunk_args.class, metaDataMap); - } - - public downloadChunk_args() { - } - - public downloadChunk_args( - String id) - { - this(); - this.id = id; - } - - /** - * Performs a deep copy on other. - */ - public downloadChunk_args(downloadChunk_args other) { - if (other.is_set_id()) { - this.id = other.id; - } - } - - public downloadChunk_args deepCopy() { - return new downloadChunk_args(this); - } - - @Override - public void clear() { - this.id = null; - } - - public String get_id() { - return this.id; - } - - public void set_id(String id) { - this.id = id; - } - - public void unset_id() { - this.id = null; - } - - /** Returns true if field id is set (has been assigned a value) and false otherwise */ - public boolean is_set_id() { - return this.id != null; - } - - public void set_id_isSet(boolean value) { - if (!value) { - this.id = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case ID: - if (value == null) { - unset_id(); - } else { - set_id((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case ID: - return get_id(); - - } - throw new 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(); - } - - switch (field) { - case ID: - return is_set_id(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof downloadChunk_args) - return this.equals((downloadChunk_args)that); - return false; - } - - public boolean equals(downloadChunk_args that) { - if (that == null) - return false; - - boolean this_present_id = true && this.is_set_id(); - boolean that_present_id = true && that.is_set_id(); - if (this_present_id || that_present_id) { - if (!(this_present_id && that_present_id)) - return false; - if (!this.id.equals(that.id)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_id = true && (is_set_id()); - builder.append(present_id); - if (present_id) - builder.append(id); - - return builder.toHashCode(); - } - - public int compareTo(downloadChunk_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - downloadChunk_args typedOther = (downloadChunk_args)other; - - lastComparison = Boolean.valueOf(is_set_id()).compareTo(typedOther.is_set_id()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_id()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // ID - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.id = 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.id != null) { - oprot.writeFieldBegin(ID_FIELD_DESC); - oprot.writeString(this.id); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("downloadChunk_args("); - boolean first = true; - - sb.append("id:"); - if (this.id == null) { - sb.append("null"); - } else { - sb.append(this.id); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - } - - public static class downloadChunk_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("downloadChunk_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); - - private ByteBuffer success; // 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 { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(downloadChunk_result.class, metaDataMap); - } - - public downloadChunk_result() { - } - - public downloadChunk_result( - ByteBuffer success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public downloadChunk_result(downloadChunk_result other) { - if (other.is_set_success()) { - this.success = org.apache.thrift.TBaseHelper.copyBinary(other.success); -; - } - } - - public downloadChunk_result deepCopy() { - return new downloadChunk_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public byte[] get_success() { - set_success(org.apache.thrift.TBaseHelper.rightSize(success)); - return success == null ? null : success.array(); - } - - public ByteBuffer buffer_for_success() { - return success; - } - - public void set_success(byte[] success) { - set_success(success == null ? (ByteBuffer)null : ByteBuffer.wrap(success)); - } - - public void set_success(ByteBuffer success) { - this.success = success; - } - - public void unset_success() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean is_set_success() { - return this.success != null; - } - - public void set_success_isSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unset_success(); - } else { - set_success((ByteBuffer)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return get_success(); - - } - throw new 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(); - } - - switch (field) { - case SUCCESS: - return is_set_success(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof downloadChunk_result) - return this.equals((downloadChunk_result)that); - return false; - } - - public boolean equals(downloadChunk_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.is_set_success(); - boolean that_present_success = true && that.is_set_success(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_success = true && (is_set_success()); - builder.append(present_success); - if (present_success) - builder.append(success); - - return builder.toHashCode(); - } - - public int compareTo(downloadChunk_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - downloadChunk_result typedOther = (downloadChunk_result)other; - - lastComparison = Boolean.valueOf(is_set_success()).compareTo(typedOther.is_set_success()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_success()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.success = iprot.readBinary(); - } 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.is_set_success()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeBinary(this.success); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("downloadChunk_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.success, sb); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - } - - public static class getClusterInfo_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getClusterInfo_args"); - - - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -; - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - 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); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getClusterInfo_args.class, metaDataMap); - } - - public getClusterInfo_args() { - } - - /** - * Performs a deep copy on other. - */ - public getClusterInfo_args(getClusterInfo_args other) { - } - - public getClusterInfo_args deepCopy() { - return new getClusterInfo_args(this); - } - - @Override - public void clear() { - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - } - throw new 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(); - } - - switch (field) { - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getClusterInfo_args) - return this.equals((getClusterInfo_args)that); - return false; - } - - public boolean equals(getClusterInfo_args that) { - if (that == null) - return false; - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - return builder.toHashCode(); - } - - public int compareTo(getClusterInfo_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - getClusterInfo_args typedOther = (getClusterInfo_args)other; - - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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) { - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getClusterInfo_args("); - boolean first = true; - - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - } - - public static class getClusterInfo_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getClusterInfo_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private ClusterSummary success; // 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 { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ClusterSummary.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getClusterInfo_result.class, metaDataMap); - } - - public getClusterInfo_result() { - } - - public getClusterInfo_result( - ClusterSummary success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public getClusterInfo_result(getClusterInfo_result other) { - if (other.is_set_success()) { - this.success = new ClusterSummary(other.success); - } - } - - public getClusterInfo_result deepCopy() { - return new getClusterInfo_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public ClusterSummary get_success() { - return this.success; - } - - public void set_success(ClusterSummary success) { - this.success = success; - } - - public void unset_success() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean is_set_success() { - return this.success != null; - } - - public void set_success_isSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unset_success(); - } else { - set_success((ClusterSummary)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return get_success(); - - } - throw new 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(); - } - - switch (field) { - case SUCCESS: - return is_set_success(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getClusterInfo_result) - return this.equals((getClusterInfo_result)that); - return false; - } - - public boolean equals(getClusterInfo_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.is_set_success(); - boolean that_present_success = true && that.is_set_success(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_success = true && (is_set_success()); - builder.append(present_success); - if (present_success) - builder.append(success); - - return builder.toHashCode(); - } - - public int compareTo(getClusterInfo_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - getClusterInfo_result typedOther = (getClusterInfo_result)other; - - lastComparison = Boolean.valueOf(is_set_success()).compareTo(typedOther.is_set_success()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_success()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.success = new ClusterSummary(); - this.success.read(iprot); - } 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.is_set_success()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - this.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getClusterInfo_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - } - - public static class getTopologyInfo_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getTopologyInfo_args"); - - private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1); - - private String 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 { - ID((short)1, "id"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // ID - return ID; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getTopologyInfo_args.class, metaDataMap); - } - - public getTopologyInfo_args() { - } - - public getTopologyInfo_args( - String id) - { - this(); - this.id = id; - } - - /** - * Performs a deep copy on other. - */ - public getTopologyInfo_args(getTopologyInfo_args other) { - if (other.is_set_id()) { - this.id = other.id; - } - } - - public getTopologyInfo_args deepCopy() { - return new getTopologyInfo_args(this); - } - - @Override - public void clear() { - this.id = null; - } - - public String get_id() { - return this.id; - } - - public void set_id(String id) { - this.id = id; - } - - public void unset_id() { - this.id = null; - } - - /** Returns true if field id is set (has been assigned a value) and false otherwise */ - public boolean is_set_id() { - return this.id != null; - } - - public void set_id_isSet(boolean value) { - if (!value) { - this.id = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case ID: - if (value == null) { - unset_id(); - } else { - set_id((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case ID: - return get_id(); - - } - throw new 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(); - } - - switch (field) { - case ID: - return is_set_id(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getTopologyInfo_args) - return this.equals((getTopologyInfo_args)that); - return false; - } - - public boolean equals(getTopologyInfo_args that) { - if (that == null) - return false; - - boolean this_present_id = true && this.is_set_id(); - boolean that_present_id = true && that.is_set_id(); - if (this_present_id || that_present_id) { - if (!(this_present_id && that_present_id)) - return false; - if (!this.id.equals(that.id)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_id = true && (is_set_id()); - builder.append(present_id); - if (present_id) - builder.append(id); - - return builder.toHashCode(); - } - - public int compareTo(getTopologyInfo_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - getTopologyInfo_args typedOther = (getTopologyInfo_args)other; - - lastComparison = Boolean.valueOf(is_set_id()).compareTo(typedOther.is_set_id()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_id()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // ID - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.id = 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.id != null) { - oprot.writeFieldBegin(ID_FIELD_DESC); - oprot.writeString(this.id); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getTopologyInfo_args("); - boolean first = true; - - sb.append("id:"); - if (this.id == null) { - sb.append("null"); - } else { - sb.append(this.id); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - } - - public static class getTopologyInfo_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getTopologyInfo_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private TopologyInfo success; // required - private NotAliveException e; // 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 { - SUCCESS((short)0, "success"), - E((short)1, "e"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - case 1: // E - return E; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TopologyInfo.class))); - tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getTopologyInfo_result.class, metaDataMap); - } - - public getTopologyInfo_result() { - } - - public getTopologyInfo_result( - TopologyInfo success, - NotAliveException e) - { - this(); - this.success = success; - this.e = e; - } - - /** - * Performs a deep copy on other. - */ - public getTopologyInfo_result(getTopologyInfo_result other) { - if (other.is_set_success()) { - this.success = new TopologyInfo(other.success); - } - if (other.is_set_e()) { - this.e = new NotAliveException(other.e); - } - } - - public getTopologyInfo_result deepCopy() { - return new getTopologyInfo_result(this); - } - - @Override - public void clear() { - this.success = null; - this.e = null; - } - - public TopologyInfo get_success() { - return this.success; - } - - public void set_success(TopologyInfo success) { - this.success = success; - } - - public void unset_success() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean is_set_success() { - return this.success != null; - } - - public void set_success_isSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public NotAliveException get_e() { - return this.e; - } - - public void set_e(NotAliveException e) { - this.e = e; - } - - public void unset_e() { - this.e = null; - } - - /** Returns true if field e is set (has been assigned a value) and false otherwise */ - public boolean is_set_e() { - return this.e != null; - } - - public void set_e_isSet(boolean value) { - if (!value) { - this.e = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unset_success(); - } else { - set_success((TopologyInfo)value); - } - break; - - case E: - if (value == null) { - unset_e(); - } else { - set_e((NotAliveException)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return get_success(); - - case E: - return get_e(); - - } - throw new 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(); - } - - switch (field) { - case SUCCESS: - return is_set_success(); - case E: - return is_set_e(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getTopologyInfo_result) - return this.equals((getTopologyInfo_result)that); - return false; - } - - public boolean equals(getTopologyInfo_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.is_set_success(); - boolean that_present_success = true && that.is_set_success(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - boolean this_present_e = true && this.is_set_e(); - boolean that_present_e = true && that.is_set_e(); - if (this_present_e || that_present_e) { - if (!(this_present_e && that_present_e)) - return false; - if (!this.e.equals(that.e)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_success = true && (is_set_success()); - builder.append(present_success); - if (present_success) - builder.append(success); - - boolean present_e = true && (is_set_e()); - builder.append(present_e); - if (present_e) - builder.append(e); - - return builder.toHashCode(); - } - - public int compareTo(getTopologyInfo_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - getTopologyInfo_result typedOther = (getTopologyInfo_result)other; - - lastComparison = Boolean.valueOf(is_set_success()).compareTo(typedOther.is_set_success()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_success()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_e()).compareTo(typedOther.is_set_e()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_e()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.success = new TopologyInfo(); - this.success.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // E - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.e = new NotAliveException(); - this.e.read(iprot); - } 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.is_set_success()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - this.success.write(oprot); - oprot.writeFieldEnd(); - } else if (this.is_set_e()) { - oprot.writeFieldBegin(E_FIELD_DESC); - this.e.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getTopologyInfo_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - if (!first) sb.append(", "); - sb.append("e:"); - if (this.e == null) { - sb.append("null"); - } else { - sb.append(this.e); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - } - - public static class getSupervisorWorkers_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSupervisorWorkers_args"); - - private static final org.apache.thrift.protocol.TField HOST_FIELD_DESC = new org.apache.thrift.protocol.TField("host", org.apache.thrift.protocol.TType.STRING, (short)1); - - private String host; // 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 { - HOST((short)1, "host"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // HOST - return HOST; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.HOST, new org.apache.thrift.meta_data.FieldMetaData("host", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSupervisorWorkers_args.class, metaDataMap); - } - - public getSupervisorWorkers_args() { - } - - public getSupervisorWorkers_args( - String host) - { - this(); - this.host = host; - } - - /** - * Performs a deep copy on other. - */ - public getSupervisorWorkers_args(getSupervisorWorkers_args other) { - if (other.is_set_host()) { - this.host = other.host; - } - } - - public getSupervisorWorkers_args deepCopy() { - return new getSupervisorWorkers_args(this); - } - - @Override - public void clear() { - this.host = null; - } - - public String get_host() { - return this.host; - } - - public void set_host(String host) { - this.host = host; - } - - public void unset_host() { - this.host = null; - } - - /** Returns true if field host is set (has been assigned a value) and false otherwise */ - public boolean is_set_host() { - return this.host != null; - } - - public void set_host_isSet(boolean value) { - if (!value) { - this.host = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case HOST: - if (value == null) { - unset_host(); - } else { - set_host((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case HOST: - return get_host(); - - } - throw new 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(); - } - - switch (field) { - case HOST: - return is_set_host(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getSupervisorWorkers_args) - return this.equals((getSupervisorWorkers_args)that); - return false; - } - - public boolean equals(getSupervisorWorkers_args that) { - if (that == null) - return false; - - boolean this_present_host = true && this.is_set_host(); - boolean that_present_host = true && that.is_set_host(); - if (this_present_host || that_present_host) { - if (!(this_present_host && that_present_host)) - return false; - if (!this.host.equals(that.host)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_host = true && (is_set_host()); - builder.append(present_host); - if (present_host) - builder.append(host); - - return builder.toHashCode(); - } - - public int compareTo(getSupervisorWorkers_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - getSupervisorWorkers_args typedOther = (getSupervisorWorkers_args)other; - - lastComparison = Boolean.valueOf(is_set_host()).compareTo(typedOther.is_set_host()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_host()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.host, typedOther.host); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // HOST - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.host = 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.host != null) { - oprot.writeFieldBegin(HOST_FIELD_DESC); - oprot.writeString(this.host); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getSupervisorWorkers_args("); - boolean first = true; - - sb.append("host:"); - if (this.host == null) { - sb.append("null"); - } else { - sb.append(this.host); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - } - - public static class getSupervisorWorkers_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSupervisorWorkers_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private SupervisorWorkers success; // required - private NotAliveException e; // 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 { - SUCCESS((short)0, "success"), - E((short)1, "e"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - case 1: // E - return E; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SupervisorWorkers.class))); - tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSupervisorWorkers_result.class, metaDataMap); - } - - public getSupervisorWorkers_result() { - } - - public getSupervisorWorkers_result( - SupervisorWorkers success, - NotAliveException e) - { - this(); - this.success = success; - this.e = e; - } - - /** - * Performs a deep copy on other. - */ - public getSupervisorWorkers_result(getSupervisorWorkers_result other) { - if (other.is_set_success()) { - this.success = new SupervisorWorkers(other.success); - } - if (other.is_set_e()) { - this.e = new NotAliveException(other.e); - } - } - - public getSupervisorWorkers_result deepCopy() { - return new getSupervisorWorkers_result(this); - } - - @Override - public void clear() { - this.success = null; - this.e = null; - } - - public SupervisorWorkers get_success() { - return this.success; - } - - public void set_success(SupervisorWorkers success) { - this.success = success; - } - - public void unset_success() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean is_set_success() { - return this.success != null; - } - - public void set_success_isSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public NotAliveException get_e() { - return this.e; - } - - public void set_e(NotAliveException e) { - this.e = e; - } - - public void unset_e() { - this.e = null; - } - - /** Returns true if field e is set (has been assigned a value) and false otherwise */ - public boolean is_set_e() { - return this.e != null; - } - - public void set_e_isSet(boolean value) { - if (!value) { - this.e = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unset_success(); - } else { - set_success((SupervisorWorkers)value); - } - break; - - case E: - if (value == null) { - unset_e(); - } else { - set_e((NotAliveException)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return get_success(); - - case E: - return get_e(); - - } - throw new 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(); - } - - switch (field) { - case SUCCESS: - return is_set_success(); - case E: - return is_set_e(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getSupervisorWorkers_result) - return this.equals((getSupervisorWorkers_result)that); - return false; - } - - public boolean equals(getSupervisorWorkers_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.is_set_success(); - boolean that_present_success = true && that.is_set_success(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - boolean this_present_e = true && this.is_set_e(); - boolean that_present_e = true && that.is_set_e(); - if (this_present_e || that_present_e) { - if (!(this_present_e && that_present_e)) - return false; - if (!this.e.equals(that.e)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_success = true && (is_set_success()); - builder.append(present_success); - if (present_success) - builder.append(success); - - boolean present_e = true && (is_set_e()); - builder.append(present_e); - if (present_e) - builder.append(e); - - return builder.toHashCode(); - } - - public int compareTo(getSupervisorWorkers_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - getSupervisorWorkers_result typedOther = (getSupervisorWorkers_result)other; - - lastComparison = Boolean.valueOf(is_set_success()).compareTo(typedOther.is_set_success()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_success()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_e()).compareTo(typedOther.is_set_e()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_e()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.success = new SupervisorWorkers(); - this.success.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // E - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.e = new NotAliveException(); - this.e.read(iprot); - } 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.is_set_success()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - this.success.write(oprot); - oprot.writeFieldEnd(); - } else if (this.is_set_e()) { - oprot.writeFieldBegin(E_FIELD_DESC); - this.e.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getSupervisorWorkers_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - if (!first) sb.append(", "); - sb.append("e:"); - if (this.e == null) { - sb.append("null"); - } else { - sb.append(this.e); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - } - - public static class getTopologyConf_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getTopologyConf_args"); - - private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1); - - private String 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 { - ID((short)1, "id"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // ID - return ID; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getTopologyConf_args.class, metaDataMap); - } - - public getTopologyConf_args() { - } - - public getTopologyConf_args( - String id) - { - this(); - this.id = id; - } - - /** - * Performs a deep copy on other. - */ - public getTopologyConf_args(getTopologyConf_args other) { - if (other.is_set_id()) { - this.id = other.id; - } - } - - public getTopologyConf_args deepCopy() { - return new getTopologyConf_args(this); - } - - @Override - public void clear() { - this.id = null; - } - - public String get_id() { - return this.id; - } - - public void set_id(String id) { - this.id = id; - } - - public void unset_id() { - this.id = null; - } - - /** Returns true if field id is set (has been assigned a value) and false otherwise */ - public boolean is_set_id() { - return this.id != null; - } - - public void set_id_isSet(boolean value) { - if (!value) { - this.id = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case ID: - if (value == null) { - unset_id(); - } else { - set_id((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case ID: - return get_id(); - - } - throw new 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(); - } - - switch (field) { - case ID: - return is_set_id(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getTopologyConf_args) - return this.equals((getTopologyConf_args)that); - return false; - } - - public boolean equals(getTopologyConf_args that) { - if (that == null) - return false; - - boolean this_present_id = true && this.is_set_id(); - boolean that_present_id = true && that.is_set_id(); - if (this_present_id || that_present_id) { - if (!(this_present_id && that_present_id)) - return false; - if (!this.id.equals(that.id)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_id = true && (is_set_id()); - builder.append(present_id); - if (present_id) - builder.append(id); - - return builder.toHashCode(); - } - - public int compareTo(getTopologyConf_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - getTopologyConf_args typedOther = (getTopologyConf_args)other; - - lastComparison = Boolean.valueOf(is_set_id()).compareTo(typedOther.is_set_id()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_id()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // ID - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.id = 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.id != null) { - oprot.writeFieldBegin(ID_FIELD_DESC); - oprot.writeString(this.id); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getTopologyConf_args("); - boolean first = true; - - sb.append("id:"); - if (this.id == null) { - sb.append("null"); - } else { - sb.append(this.id); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - } - - public static class getTopologyConf_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getTopologyConf_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); - private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private String success; // required - private NotAliveException e; // 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 { - SUCCESS((short)0, "success"), - E((short)1, "e"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - case 1: // E - return E; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getTopologyConf_result.class, metaDataMap); - } - - public getTopologyConf_result() { - } - - public getTopologyConf_result( - String success, - NotAliveException e) - { - this(); - this.success = success; - this.e = e; - } - - /** - * Performs a deep copy on other. - */ - public getTopologyConf_result(getTopologyConf_result other) { - if (other.is_set_success()) { - this.success = other.success; - } - if (other.is_set_e()) { - this.e = new NotAliveException(other.e); - } - } - - public getTopologyConf_result deepCopy() { - return new getTopologyConf_result(this); - } - - @Override - public void clear() { - this.success = null; - this.e = null; - } - - public String get_success() { - return this.success; - } - - public void set_success(String success) { - this.success = success; - } - - public void unset_success() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean is_set_success() { - return this.success != null; - } - - public void set_success_isSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public NotAliveException get_e() { - return this.e; - } - - public void set_e(NotAliveException e) { - this.e = e; - } - - public void unset_e() { - this.e = null; - } - - /** Returns true if field e is set (has been assigned a value) and false otherwise */ - public boolean is_set_e() { - return this.e != null; - } - - public void set_e_isSet(boolean value) { - if (!value) { - this.e = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unset_success(); - } else { - set_success((String)value); - } - break; - - case E: - if (value == null) { - unset_e(); - } else { - set_e((NotAliveException)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return get_success(); - - case E: - return get_e(); - - } - throw new 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(); - } - - switch (field) { - case SUCCESS: - return is_set_success(); - case E: - return is_set_e(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getTopologyConf_result) - return this.equals((getTopologyConf_result)that); - return false; - } - - public boolean equals(getTopologyConf_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.is_set_success(); - boolean that_present_success = true && that.is_set_success(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - boolean this_present_e = true && this.is_set_e(); - boolean that_present_e = true && that.is_set_e(); - if (this_present_e || that_present_e) { - if (!(this_present_e && that_present_e)) - return false; - if (!this.e.equals(that.e)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_success = true && (is_set_success()); - builder.append(present_success); - if (present_success) - builder.append(success); - - boolean present_e = true && (is_set_e()); - builder.append(present_e); - if (present_e) - builder.append(e); - - return builder.toHashCode(); - } - - public int compareTo(getTopologyConf_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - getTopologyConf_result typedOther = (getTopologyConf_result)other; - - lastComparison = Boolean.valueOf(is_set_success()).compareTo(typedOther.is_set_success()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_success()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_e()).compareTo(typedOther.is_set_e()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_e()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.success = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // E - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.e = new NotAliveException(); - this.e.read(iprot); - } 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.is_set_success()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeString(this.success); - oprot.writeFieldEnd(); - } else if (this.is_set_e()) { - oprot.writeFieldBegin(E_FIELD_DESC); - this.e.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getTopologyConf_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - if (!first) sb.append(", "); - sb.append("e:"); - if (this.e == null) { - sb.append("null"); - } else { - sb.append(this.e); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - } - - public static class getTopology_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getTopology_args"); - - private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1); - - private String 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 { - ID((short)1, "id"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // ID - return ID; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getTopology_args.class, metaDataMap); - } - - public getTopology_args() { - } - - public getTopology_args( - String id) - { - this(); - this.id = id; - } - - /** - * Performs a deep copy on other. - */ - public getTopology_args(getTopology_args other) { - if (other.is_set_id()) { - this.id = other.id; - } - } - - public getTopology_args deepCopy() { - return new getTopology_args(this); - } - - @Override - public void clear() { - this.id = null; - } - - public String get_id() { - return this.id; - } - - public void set_id(String id) { - this.id = id; - } - - public void unset_id() { - this.id = null; - } - - /** Returns true if field id is set (has been assigned a value) and false otherwise */ - public boolean is_set_id() { - return this.id != null; - } - - public void set_id_isSet(boolean value) { - if (!value) { - this.id = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case ID: - if (value == null) { - unset_id(); - } else { - set_id((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case ID: - return get_id(); - - } - throw new 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(); - } - - switch (field) { - case ID: - return is_set_id(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getTopology_args) - return this.equals((getTopology_args)that); - return false; - } - - public boolean equals(getTopology_args that) { - if (that == null) - return false; - - boolean this_present_id = true && this.is_set_id(); - boolean that_present_id = true && that.is_set_id(); - if (this_present_id || that_present_id) { - if (!(this_present_id && that_present_id)) - return false; - if (!this.id.equals(that.id)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_id = true && (is_set_id()); - builder.append(present_id); - if (present_id) - builder.append(id); - - return builder.toHashCode(); - } - - public int compareTo(getTopology_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - getTopology_args typedOther = (getTopology_args)other; - - lastComparison = Boolean.valueOf(is_set_id()).compareTo(typedOther.is_set_id()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_id()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // ID - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.id = 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.id != null) { - oprot.writeFieldBegin(ID_FIELD_DESC); - oprot.writeString(this.id); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getTopology_args("); - boolean first = true; - - sb.append("id:"); - if (this.id == null) { - sb.append("null"); - } else { - sb.append(this.id); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - } - - public static class getTopology_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getTopology_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private StormTopology success; // required - private NotAliveException e; // 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 { - SUCCESS((short)0, "success"), - E((short)1, "e"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - case 1: // E - return E; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, StormTopology.class))); - tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getTopology_result.class, metaDataMap); - } - - public getTopology_result() { - } - - public getTopology_result( - StormTopology success, - NotAliveException e) - { - this(); - this.success = success; - this.e = e; - } - - /** - * Performs a deep copy on other. - */ - public getTopology_result(getTopology_result other) { - if (other.is_set_success()) { - this.success = new StormTopology(other.success); - } - if (other.is_set_e()) { - this.e = new NotAliveException(other.e); - } - } - - public getTopology_result deepCopy() { - return new getTopology_result(this); - } - - @Override - public void clear() { - this.success = null; - this.e = null; - } - - public StormTopology get_success() { - return this.success; - } - - public void set_success(StormTopology success) { - this.success = success; - } - - public void unset_success() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean is_set_success() { - return this.success != null; - } - - public void set_success_isSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public NotAliveException get_e() { - return this.e; - } - - public void set_e(NotAliveException e) { - this.e = e; - } - - public void unset_e() { - this.e = null; - } - - /** Returns true if field e is set (has been assigned a value) and false otherwise */ - public boolean is_set_e() { - return this.e != null; - } - - public void set_e_isSet(boolean value) { - if (!value) { - this.e = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unset_success(); - } else { - set_success((StormTopology)value); - } - break; - - case E: - if (value == null) { - unset_e(); - } else { - set_e((NotAliveException)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return get_success(); - - case E: - return get_e(); - - } - throw new 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(); - } - - switch (field) { - case SUCCESS: - return is_set_success(); - case E: - return is_set_e(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getTopology_result) - return this.equals((getTopology_result)that); - return false; - } - - public boolean equals(getTopology_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.is_set_success(); - boolean that_present_success = true && that.is_set_success(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - boolean this_present_e = true && this.is_set_e(); - boolean that_present_e = true && that.is_set_e(); - if (this_present_e || that_present_e) { - if (!(this_present_e && that_present_e)) - return false; - if (!this.e.equals(that.e)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_success = true && (is_set_success()); - builder.append(present_success); - if (present_success) - builder.append(success); - - boolean present_e = true && (is_set_e()); - builder.append(present_e); - if (present_e) - builder.append(e); - - return builder.toHashCode(); - } - - public int compareTo(getTopology_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - getTopology_result typedOther = (getTopology_result)other; - - lastComparison = Boolean.valueOf(is_set_success()).compareTo(typedOther.is_set_success()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_success()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_e()).compareTo(typedOther.is_set_e()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_e()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.success = new StormTopology(); - this.success.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // E - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.e = new NotAliveException(); - this.e.read(iprot); - } 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.is_set_success()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - this.success.write(oprot); - oprot.writeFieldEnd(); - } else if (this.is_set_e()) { - oprot.writeFieldBegin(E_FIELD_DESC); - this.e.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getTopology_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - if (!first) sb.append(", "); - sb.append("e:"); - if (this.e == null) { - sb.append("null"); - } else { - sb.append(this.e); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - - } - -} +/** + * Autogenerated by Thrift Compiler (0.8.0) + * + * 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 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class Nimbus { + + public interface Iface { + + public void submitTopology(String name, String uploadedJarLocation, String jsonConf, StormTopology topology) throws AlreadyAliveException, InvalidTopologyException, org.apache.thrift.TException; + + public void killTopology(String name) throws NotAliveException, org.apache.thrift.TException; + + public void killTopologyWithOpts(String name, KillOptions options) throws NotAliveException, org.apache.thrift.TException; + + public void activate(String name) throws NotAliveException, org.apache.thrift.TException; + + public void deactivate(String name) throws NotAliveException, org.apache.thrift.TException; + + public void rebalance(String name, RebalanceOptions options) throws NotAliveException, org.apache.thrift.TException; + + public String beginFileUpload() throws org.apache.thrift.TException; + + public void uploadChunk(String location, ByteBuffer chunk) throws org.apache.thrift.TException; + + public void finishFileUpload(String location) throws org.apache.thrift.TException; + + public String beginFileDownload(String file) throws org.apache.thrift.TException; + + public ByteBuffer downloadChunk(String id) throws org.apache.thrift.TException; + + public ClusterSummary getClusterInfo() throws org.apache.thrift.TException; + + public TopologyInfo getTopologyInfo(String id) throws NotAliveException, org.apache.thrift.TException; + + public SupervisorWorkers getSupervisorWorkers(String host) throws NotAliveException, org.apache.thrift.TException; + + public String getTopologyConf(String id) throws NotAliveException, org.apache.thrift.TException; + + public StormTopology getTopology(String id) throws NotAliveException, org.apache.thrift.TException; + + } + + public interface AsyncIface { + + public void submitTopology(String name, String uploadedJarLocation, String jsonConf, StormTopology topology, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void killTopology(String name, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void killTopologyWithOpts(String name, KillOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void activate(String name, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void deactivate(String name, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void rebalance(String name, RebalanceOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void beginFileUpload(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void uploadChunk(String location, ByteBuffer chunk, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void finishFileUpload(String location, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void beginFileDownload(String file, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void downloadChunk(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getClusterInfo(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getTopologyInfo(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getSupervisorWorkers(String host, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getTopologyConf(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getTopology(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + } + + public static class Client extends org.apache.thrift.TServiceClient implements Iface { + public static class Factory implements org.apache.thrift.TServiceClientFactory { + public Factory() {} + public Client getClient(org.apache.thrift.protocol.TProtocol prot) { + return new Client(prot); + } + public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { + return new Client(iprot, oprot); + } + } + + public Client(org.apache.thrift.protocol.TProtocol prot) + { + super(prot, prot); + } + + public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { + super(iprot, oprot); + } + + public void submitTopology(String name, String uploadedJarLocation, String jsonConf, StormTopology topology) throws AlreadyAliveException, InvalidTopologyException, org.apache.thrift.TException + { + send_submitTopology(name, uploadedJarLocation, jsonConf, topology); + recv_submitTopology(); + } + + public void send_submitTopology(String name, String uploadedJarLocation, String jsonConf, StormTopology topology) throws org.apache.thrift.TException + { + submitTopology_args args = new submitTopology_args(); + args.set_name(name); + args.set_uploadedJarLocation(uploadedJarLocation); + args.set_jsonConf(jsonConf); + args.set_topology(topology); + sendBase("submitTopology", args); + } + + public void recv_submitTopology() throws AlreadyAliveException, InvalidTopologyException, org.apache.thrift.TException + { + submitTopology_result result = new submitTopology_result(); + receiveBase(result, "submitTopology"); + if (result.e != null) { + throw result.e; + } + if (result.ite != null) { + throw result.ite; + } + return; + } + + public void killTopology(String name) throws NotAliveException, org.apache.thrift.TException + { + send_killTopology(name); + recv_killTopology(); + } + + public void send_killTopology(String name) throws org.apache.thrift.TException + { + killTopology_args args = new killTopology_args(); + args.set_name(name); + sendBase("killTopology", args); + } + + public void recv_killTopology() throws NotAliveException, org.apache.thrift.TException + { + killTopology_result result = new killTopology_result(); + receiveBase(result, "killTopology"); + if (result.e != null) { + throw result.e; + } + return; + } + + public void killTopologyWithOpts(String name, KillOptions options) throws NotAliveException, org.apache.thrift.TException + { + send_killTopologyWithOpts(name, options); + recv_killTopologyWithOpts(); + } + + public void send_killTopologyWithOpts(String name, KillOptions options) throws org.apache.thrift.TException + { + killTopologyWithOpts_args args = new killTopologyWithOpts_args(); + args.set_name(name); + args.set_options(options); + sendBase("killTopologyWithOpts", args); + } + + public void recv_killTopologyWithOpts() throws NotAliveException, org.apache.thrift.TException + { + killTopologyWithOpts_result result = new killTopologyWithOpts_result(); + receiveBase(result, "killTopologyWithOpts"); + if (result.e != null) { + throw result.e; + } + return; + } + + public void activate(String name) throws NotAliveException, org.apache.thrift.TException + { + send_activate(name); + recv_activate(); + } + + public void send_activate(String name) throws org.apache.thrift.TException + { + activate_args args = new activate_args(); + args.set_name(name); + sendBase("activate", args); + } + + public void recv_activate() throws NotAliveException, org.apache.thrift.TException + { + activate_result result = new activate_result(); + receiveBase(result, "activate"); + if (result.e != null) { + throw result.e; + } + return; + } + + public void deactivate(String name) throws NotAliveException, org.apache.thrift.TException + { + send_deactivate(name); + recv_deactivate(); + } + + public void send_deactivate(String name) throws org.apache.thrift.TException + { + deactivate_args args = new deactivate_args(); + args.set_name(name); + sendBase("deactivate", args); + } + + public void recv_deactivate() throws NotAliveException, org.apache.thrift.TException + { + deactivate_result result = new deactivate_result(); + receiveBase(result, "deactivate"); + if (result.e != null) { + throw result.e; + } + return; + } + + public void rebalance(String name, RebalanceOptions options) throws NotAliveException, org.apache.thrift.TException + { + send_rebalance(name, options); + recv_rebalance(); + } + + public void send_rebalance(String name, RebalanceOptions options) throws org.apache.thrift.TException + { + rebalance_args args = new rebalance_args(); + args.set_name(name); + args.set_options(options); + sendBase("rebalance", args); + } + + public void recv_rebalance() throws NotAliveException, org.apache.thrift.TException + { + rebalance_result result = new rebalance_result(); + receiveBase(result, "rebalance"); + if (result.e != null) { + throw result.e; + } + return; + } + + public String beginFileUpload() throws org.apache.thrift.TException + { + send_beginFileUpload(); + return recv_beginFileUpload(); + } + + public void send_beginFileUpload() throws org.apache.thrift.TException + { + beginFileUpload_args args = new beginFileUpload_args(); + sendBase("beginFileUpload", args); + } + + public String recv_beginFileUpload() throws org.apache.thrift.TException + { + beginFileUpload_result result = new beginFileUpload_result(); + receiveBase(result, "beginFileUpload"); + if (result.is_set_success()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "beginFileUpload failed: unknown result"); + } + + public void uploadChunk(String location, ByteBuffer chunk) throws org.apache.thrift.TException + { + send_uploadChunk(location, chunk); + recv_uploadChunk(); + } + + public void send_uploadChunk(String location, ByteBuffer chunk) throws org.apache.thrift.TException + { + uploadChunk_args args = new uploadChunk_args(); + args.set_location(location); + args.set_chunk(chunk); + sendBase("uploadChunk", args); + } + + public void recv_uploadChunk() throws org.apache.thrift.TException + { + uploadChunk_result result = new uploadChunk_result(); + receiveBase(result, "uploadChunk"); + return; + } + + public void finishFileUpload(String location) throws org.apache.thrift.TException + { + send_finishFileUpload(location); + recv_finishFileUpload(); + } + + public void send_finishFileUpload(String location) throws org.apache.thrift.TException + { + finishFileUpload_args args = new finishFileUpload_args(); + args.set_location(location); + sendBase("finishFileUpload", args); + } + + public void recv_finishFileUpload() throws org.apache.thrift.TException + { + finishFileUpload_result result = new finishFileUpload_result(); + receiveBase(result, "finishFileUpload"); + return; + } + + public String beginFileDownload(String file) throws org.apache.thrift.TException + { + send_beginFileDownload(file); + return recv_beginFileDownload(); + } + + public void send_beginFileDownload(String file) throws org.apache.thrift.TException + { + beginFileDownload_args args = new beginFileDownload_args(); + args.set_file(file); + sendBase("beginFileDownload", args); + } + + public String recv_beginFileDownload() throws org.apache.thrift.TException + { + beginFileDownload_result result = new beginFileDownload_result(); + receiveBase(result, "beginFileDownload"); + if (result.is_set_success()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "beginFileDownload failed: unknown result"); + } + + public ByteBuffer downloadChunk(String id) throws org.apache.thrift.TException + { + send_downloadChunk(id); + return recv_downloadChunk(); + } + + public void send_downloadChunk(String id) throws org.apache.thrift.TException + { + downloadChunk_args args = new downloadChunk_args(); + args.set_id(id); + sendBase("downloadChunk", args); + } + + public ByteBuffer recv_downloadChunk() throws org.apache.thrift.TException + { + downloadChunk_result result = new downloadChunk_result(); + receiveBase(result, "downloadChunk"); + if (result.is_set_success()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "downloadChunk failed: unknown result"); + } + + public ClusterSummary getClusterInfo() throws org.apache.thrift.TException + { + send_getClusterInfo(); + return recv_getClusterInfo(); + } + + public void send_getClusterInfo() throws org.apache.thrift.TException + { + getClusterInfo_args args = new getClusterInfo_args(); + sendBase("getClusterInfo", args); + } + + public ClusterSummary recv_getClusterInfo() throws org.apache.thrift.TException + { + getClusterInfo_result result = new getClusterInfo_result(); + receiveBase(result, "getClusterInfo"); + if (result.is_set_success()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getClusterInfo failed: unknown result"); + } + + public TopologyInfo getTopologyInfo(String id) throws NotAliveException, org.apache.thrift.TException + { + send_getTopologyInfo(id); + return recv_getTopologyInfo(); + } + + public void send_getTopologyInfo(String id) throws org.apache.thrift.TException + { + getTopologyInfo_args args = new getTopologyInfo_args(); + args.set_id(id); + sendBase("getTopologyInfo", args); + } + + public TopologyInfo recv_getTopologyInfo() throws NotAliveException, org.apache.thrift.TException + { + getTopologyInfo_result result = new getTopologyInfo_result(); + receiveBase(result, "getTopologyInfo"); + if (result.is_set_success()) { + return result.success; + } + if (result.e != null) { + throw result.e; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getTopologyInfo failed: unknown result"); + } + + public SupervisorWorkers getSupervisorWorkers(String host) throws NotAliveException, org.apache.thrift.TException + { + send_getSupervisorWorkers(host); + return recv_getSupervisorWorkers(); + } + + public void send_getSupervisorWorkers(String host) throws org.apache.thrift.TException + { + getSupervisorWorkers_args args = new getSupervisorWorkers_args(); + args.set_host(host); + sendBase("getSupervisorWorkers", args); + } + + public SupervisorWorkers recv_getSupervisorWorkers() throws NotAliveException, org.apache.thrift.TException + { + getSupervisorWorkers_result result = new getSupervisorWorkers_result(); + receiveBase(result, "getSupervisorWorkers"); + if (result.is_set_success()) { + return result.success; + } + if (result.e != null) { + throw result.e; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSupervisorWorkers failed: unknown result"); + } + + public String getTopologyConf(String id) throws NotAliveException, org.apache.thrift.TException + { + send_getTopologyConf(id); + return recv_getTopologyConf(); + } + + public void send_getTopologyConf(String id) throws org.apache.thrift.TException + { + getTopologyConf_args args = new getTopologyConf_args(); + args.set_id(id); + sendBase("getTopologyConf", args); + } + + public String recv_getTopologyConf() throws NotAliveException, org.apache.thrift.TException + { + getTopologyConf_result result = new getTopologyConf_result(); + receiveBase(result, "getTopologyConf"); + if (result.is_set_success()) { + return result.success; + } + if (result.e != null) { + throw result.e; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getTopologyConf failed: unknown result"); + } + + public StormTopology getTopology(String id) throws NotAliveException, org.apache.thrift.TException + { + send_getTopology(id); + return recv_getTopology(); + } + + public void send_getTopology(String id) throws org.apache.thrift.TException + { + getTopology_args args = new getTopology_args(); + args.set_id(id); + sendBase("getTopology", args); + } + + public StormTopology recv_getTopology() throws NotAliveException, org.apache.thrift.TException + { + getTopology_result result = new getTopology_result(); + receiveBase(result, "getTopology"); + if (result.is_set_success()) { + return result.success; + } + if (result.e != null) { + throw result.e; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getTopology failed: unknown result"); + } + + } + public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { + public static class Factory implements org.apache.thrift.async.TAsyncClientFactory { + private org.apache.thrift.async.TAsyncClientManager clientManager; + private org.apache.thrift.protocol.TProtocolFactory protocolFactory; + public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) { + this.clientManager = clientManager; + this.protocolFactory = protocolFactory; + } + public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) { + return new AsyncClient(protocolFactory, clientManager, transport); + } + } + + public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) { + super(protocolFactory, clientManager, transport); + } + + public void submitTopology(String name, String uploadedJarLocation, String jsonConf, StormTopology topology, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + submitTopology_call method_call = new submitTopology_call(name, uploadedJarLocation, jsonConf, topology, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class submitTopology_call extends org.apache.thrift.async.TAsyncMethodCall { + private String name; + private String uploadedJarLocation; + private String jsonConf; + private StormTopology topology; + public submitTopology_call(String name, String uploadedJarLocation, String jsonConf, StormTopology topology, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.name = name; + this.uploadedJarLocation = uploadedJarLocation; + this.jsonConf = jsonConf; + this.topology = topology; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("submitTopology", org.apache.thrift.protocol.TMessageType.CALL, 0)); + submitTopology_args args = new submitTopology_args(); + args.set_name(name); + args.set_uploadedJarLocation(uploadedJarLocation); + args.set_jsonConf(jsonConf); + args.set_topology(topology); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws AlreadyAliveException, InvalidTopologyException, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_submitTopology(); + } + } + + public void killTopology(String name, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + killTopology_call method_call = new killTopology_call(name, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class killTopology_call extends org.apache.thrift.async.TAsyncMethodCall { + private String name; + public killTopology_call(String name, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.name = name; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("killTopology", org.apache.thrift.protocol.TMessageType.CALL, 0)); + killTopology_args args = new killTopology_args(); + args.set_name(name); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws NotAliveException, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_killTopology(); + } + } + + public void killTopologyWithOpts(String name, KillOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + killTopologyWithOpts_call method_call = new killTopologyWithOpts_call(name, options, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class killTopologyWithOpts_call extends org.apache.thrift.async.TAsyncMethodCall { + private String name; + private KillOptions options; + public killTopologyWithOpts_call(String name, KillOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.name = name; + this.options = options; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("killTopologyWithOpts", org.apache.thrift.protocol.TMessageType.CALL, 0)); + killTopologyWithOpts_args args = new killTopologyWithOpts_args(); + args.set_name(name); + args.set_options(options); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws NotAliveException, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_killTopologyWithOpts(); + } + } + + public void activate(String name, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + activate_call method_call = new activate_call(name, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class activate_call extends org.apache.thrift.async.TAsyncMethodCall { + private String name; + public activate_call(String name, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.name = name; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("activate", org.apache.thrift.protocol.TMessageType.CALL, 0)); + activate_args args = new activate_args(); + args.set_name(name); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws NotAliveException, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_activate(); + } + } + + public void deactivate(String name, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + deactivate_call method_call = new deactivate_call(name, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class deactivate_call extends org.apache.thrift.async.TAsyncMethodCall { + private String name; + public deactivate_call(String name, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.name = name; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deactivate", org.apache.thrift.protocol.TMessageType.CALL, 0)); + deactivate_args args = new deactivate_args(); + args.set_name(name); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws NotAliveException, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_deactivate(); + } + } + + public void rebalance(String name, RebalanceOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + rebalance_call method_call = new rebalance_call(name, options, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class rebalance_call extends org.apache.thrift.async.TAsyncMethodCall { + private String name; + private RebalanceOptions options; + public rebalance_call(String name, RebalanceOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.name = name; + this.options = options; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("rebalance", org.apache.thrift.protocol.TMessageType.CALL, 0)); + rebalance_args args = new rebalance_args(); + args.set_name(name); + args.set_options(options); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws NotAliveException, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_rebalance(); + } + } + + public void beginFileUpload(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + beginFileUpload_call method_call = new beginFileUpload_call(resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class beginFileUpload_call extends org.apache.thrift.async.TAsyncMethodCall { + public beginFileUpload_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("beginFileUpload", org.apache.thrift.protocol.TMessageType.CALL, 0)); + beginFileUpload_args args = new beginFileUpload_args(); + args.write(prot); + prot.writeMessageEnd(); + } + + public String getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_beginFileUpload(); + } + } + + public void uploadChunk(String location, ByteBuffer chunk, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + uploadChunk_call method_call = new uploadChunk_call(location, chunk, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class uploadChunk_call extends org.apache.thrift.async.TAsyncMethodCall { + private String location; + private ByteBuffer chunk; + public uploadChunk_call(String location, ByteBuffer chunk, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.location = location; + this.chunk = chunk; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("uploadChunk", org.apache.thrift.protocol.TMessageType.CALL, 0)); + uploadChunk_args args = new uploadChunk_args(); + args.set_location(location); + args.set_chunk(chunk); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_uploadChunk(); + } + } + + public void finishFileUpload(String location, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + finishFileUpload_call method_call = new finishFileUpload_call(location, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class finishFileUpload_call extends org.apache.thrift.async.TAsyncMethodCall { + private String location; + public finishFileUpload_call(String location, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.location = location; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("finishFileUpload", org.apache.thrift.protocol.TMessageType.CALL, 0)); + finishFileUpload_args args = new finishFileUpload_args(); + args.set_location(location); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_finishFileUpload(); + } + } + + public void beginFileDownload(String file, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + beginFileDownload_call method_call = new beginFileDownload_call(file, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class beginFileDownload_call extends org.apache.thrift.async.TAsyncMethodCall { + private String file; + public beginFileDownload_call(String file, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.file = file; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("beginFileDownload", org.apache.thrift.protocol.TMessageType.CALL, 0)); + beginFileDownload_args args = new beginFileDownload_args(); + args.set_file(file); + args.write(prot); + prot.writeMessageEnd(); + } + + public String getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_beginFileDownload(); + } + } + + public void downloadChunk(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + downloadChunk_call method_call = new downloadChunk_call(id, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class downloadChunk_call extends org.apache.thrift.async.TAsyncMethodCall { + private String id; + public downloadChunk_call(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.id = id; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("downloadChunk", org.apache.thrift.protocol.TMessageType.CALL, 0)); + downloadChunk_args args = new downloadChunk_args(); + args.set_id(id); + args.write(prot); + prot.writeMessageEnd(); + } + + public ByteBuffer getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_downloadChunk(); + } + } + + public void getClusterInfo(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getClusterInfo_call method_call = new getClusterInfo_call(resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getClusterInfo_call extends org.apache.thrift.async.TAsyncMethodCall { + public getClusterInfo_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getClusterInfo", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getClusterInfo_args args = new getClusterInfo_args(); + args.write(prot); + prot.writeMessageEnd(); + } + + public ClusterSummary getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getClusterInfo(); + } + } + + public void getTopologyInfo(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getTopologyInfo_call method_call = new getTopologyInfo_call(id, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getTopologyInfo_call extends org.apache.thrift.async.TAsyncMethodCall { + private String id; + public getTopologyInfo_call(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.id = id; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getTopologyInfo", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getTopologyInfo_args args = new getTopologyInfo_args(); + args.set_id(id); + args.write(prot); + prot.writeMessageEnd(); + } + + public TopologyInfo getResult() throws NotAliveException, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getTopologyInfo(); + } + } + + public void getSupervisorWorkers(String host, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getSupervisorWorkers_call method_call = new getSupervisorWorkers_call(host, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getSupervisorWorkers_call extends org.apache.thrift.async.TAsyncMethodCall { + private String host; + public getSupervisorWorkers_call(String host, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.host = host; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getSupervisorWorkers", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getSupervisorWorkers_args args = new getSupervisorWorkers_args(); + args.set_host(host); + args.write(prot); + prot.writeMessageEnd(); + } + + public SupervisorWorkers getResult() throws NotAliveException, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getSupervisorWorkers(); + } + } + + public void getTopologyConf(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getTopologyConf_call method_call = new getTopologyConf_call(id, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getTopologyConf_call extends org.apache.thrift.async.TAsyncMethodCall { + private String id; + public getTopologyConf_call(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.id = id; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getTopologyConf", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getTopologyConf_args args = new getTopologyConf_args(); + args.set_id(id); + args.write(prot); + prot.writeMessageEnd(); + } + + public String getResult() throws NotAliveException, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getTopologyConf(); + } + } + + public void getTopology(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getTopology_call method_call = new getTopology_call(id, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getTopology_call extends org.apache.thrift.async.TAsyncMethodCall { + private String id; + public getTopology_call(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.id = id; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getTopology", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getTopology_args args = new getTopology_args(); + args.set_id(id); + args.write(prot); + prot.writeMessageEnd(); + } + + public StormTopology getResult() throws NotAliveException, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getTopology(); + } + } + + } + + public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor { + private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName()); + public Processor(I iface) { + super(iface, getProcessMap(new HashMap>())); + } + + protected Processor(I iface, Map> processMap) { + super(iface, getProcessMap(processMap)); + } + + private static Map> getProcessMap(Map> processMap) { + processMap.put("submitTopology", new submitTopology()); + processMap.put("killTopology", new killTopology()); + processMap.put("killTopologyWithOpts", new killTopologyWithOpts()); + processMap.put("activate", new activate()); + processMap.put("deactivate", new deactivate()); + processMap.put("rebalance", new rebalance()); + processMap.put("beginFileUpload", new beginFileUpload()); + processMap.put("uploadChunk", new uploadChunk()); + processMap.put("finishFileUpload", new finishFileUpload()); + processMap.put("beginFileDownload", new beginFileDownload()); + processMap.put("downloadChunk", new downloadChunk()); + processMap.put("getClusterInfo", new getClusterInfo()); + processMap.put("getTopologyInfo", new getTopologyInfo()); + processMap.put("getSupervisorWorkers", new getSupervisorWorkers()); + processMap.put("getTopologyConf", new getTopologyConf()); + processMap.put("getTopology", new getTopology()); + return processMap; + } + + private static class submitTopology extends org.apache.thrift.ProcessFunction { + public submitTopology() { + super("submitTopology"); + } + + protected submitTopology_args getEmptyArgsInstance() { + return new submitTopology_args(); + } + + protected submitTopology_result getResult(I iface, submitTopology_args args) throws org.apache.thrift.TException { + submitTopology_result result = new submitTopology_result(); + try { + iface.submitTopology(args.name, args.uploadedJarLocation, args.jsonConf, args.topology); + } catch (AlreadyAliveException e) { + result.e = e; + } catch (InvalidTopologyException ite) { + result.ite = ite; + } + return result; + } + } + + private static class killTopology extends org.apache.thrift.ProcessFunction { + public killTopology() { + super("killTopology"); + } + + protected killTopology_args getEmptyArgsInstance() { + return new killTopology_args(); + } + + protected killTopology_result getResult(I iface, killTopology_args args) throws org.apache.thrift.TException { + killTopology_result result = new killTopology_result(); + try { + iface.killTopology(args.name); + } catch (NotAliveException e) { + result.e = e; + } + return result; + } + } + + private static class killTopologyWithOpts extends org.apache.thrift.ProcessFunction { + public killTopologyWithOpts() { + super("killTopologyWithOpts"); + } + + protected killTopologyWithOpts_args getEmptyArgsInstance() { + return new killTopologyWithOpts_args(); + } + + protected killTopologyWithOpts_result getResult(I iface, killTopologyWithOpts_args args) throws org.apache.thrift.TException { + killTopologyWithOpts_result result = new killTopologyWithOpts_result(); + try { + iface.killTopologyWithOpts(args.name, args.options); + } catch (NotAliveException e) { + result.e = e; + } + return result; + } + } + + private static class activate extends org.apache.thrift.ProcessFunction { + public activate() { + super("activate"); + } + + protected activate_args getEmptyArgsInstance() { + return new activate_args(); + } + + protected activate_result getResult(I iface, activate_args args) throws org.apache.thrift.TException { + activate_result result = new activate_result(); + try { + iface.activate(args.name); + } catch (NotAliveException e) { + result.e = e; + } + return result; + } + } + + private static class deactivate extends org.apache.thrift.ProcessFunction { + public deactivate() { + super("deactivate"); + } + + protected deactivate_args getEmptyArgsInstance() { + return new deactivate_args(); + } + + protected deactivate_result getResult(I iface, deactivate_args args) throws org.apache.thrift.TException { + deactivate_result result = new deactivate_result(); + try { + iface.deactivate(args.name); + } catch (NotAliveException e) { + result.e = e; + } + return result; + } + } + + private static class rebalance extends org.apache.thrift.ProcessFunction { + public rebalance() { + super("rebalance"); + } + + protected rebalance_args getEmptyArgsInstance() { + return new rebalance_args(); + } + + protected rebalance_result getResult(I iface, rebalance_args args) throws org.apache.thrift.TException { + rebalance_result result = new rebalance_result(); + try { + iface.rebalance(args.name, args.options); + } catch (NotAliveException e) { + result.e = e; + } + return result; + } + } + + private static class beginFileUpload extends org.apache.thrift.ProcessFunction { + public beginFileUpload() { + super("beginFileUpload"); + } + + protected beginFileUpload_args getEmptyArgsInstance() { + return new beginFileUpload_args(); + } + + protected beginFileUpload_result getResult(I iface, beginFileUpload_args args) throws org.apache.thrift.TException { + beginFileUpload_result result = new beginFileUpload_result(); + result.success = iface.beginFileUpload(); + return result; + } + } + + private static class uploadChunk extends org.apache.thrift.ProcessFunction { + public uploadChunk() { + super("uploadChunk"); + } + + protected uploadChunk_args getEmptyArgsInstance() { + return new uploadChunk_args(); + } + + protected uploadChunk_result getResult(I iface, uploadChunk_args args) throws org.apache.thrift.TException { + uploadChunk_result result = new uploadChunk_result(); + iface.uploadChunk(args.location, args.chunk); + return result; + } + } + + private static class finishFileUpload extends org.apache.thrift.ProcessFunction { + public finishFileUpload() { + super("finishFileUpload"); + } + + protected finishFileUpload_args getEmptyArgsInstance() { + return new finishFileUpload_args(); + } + + protected finishFileUpload_result getResult(I iface, finishFileUpload_args args) throws org.apache.thrift.TException { + finishFileUpload_result result = new finishFileUpload_result(); + iface.finishFileUpload(args.location); + return result; + } + } + + private static class beginFileDownload extends org.apache.thrift.ProcessFunction { + public beginFileDownload() { + super("beginFileDownload"); + } + + protected beginFileDownload_args getEmptyArgsInstance() { + return new beginFileDownload_args(); + } + + protected beginFileDownload_result getResult(I iface, beginFileDownload_args args) throws org.apache.thrift.TException { + beginFileDownload_result result = new beginFileDownload_result(); + result.success = iface.beginFileDownload(args.file); + return result; + } + } + + private static class downloadChunk extends org.apache.thrift.ProcessFunction { + public downloadChunk() { + super("downloadChunk"); + } + + protected downloadChunk_args getEmptyArgsInstance() { + return new downloadChunk_args(); + } + + protected downloadChunk_result getResult(I iface, downloadChunk_args args) throws org.apache.thrift.TException { + downloadChunk_result result = new downloadChunk_result(); + result.success = iface.downloadChunk(args.id); + return result; + } + } + + private static class getClusterInfo extends org.apache.thrift.ProcessFunction { + public getClusterInfo() { + super("getClusterInfo"); + } + + protected getClusterInfo_args getEmptyArgsInstance() { + return new getClusterInfo_args(); + } + + protected getClusterInfo_result getResult(I iface, getClusterInfo_args args) throws org.apache.thrift.TException { + getClusterInfo_result result = new getClusterInfo_result(); + result.success = iface.getClusterInfo(); + return result; + } + } + + private static class getTopologyInfo extends org.apache.thrift.ProcessFunction { + public getTopologyInfo() { + super("getTopologyInfo"); + } + + protected getTopologyInfo_args getEmptyArgsInstance() { + return new getTopologyInfo_args(); + } + + protected getTopologyInfo_result getResult(I iface, getTopologyInfo_args args) throws org.apache.thrift.TException { + getTopologyInfo_result result = new getTopologyInfo_result(); + try { + result.success = iface.getTopologyInfo(args.id); + } catch (NotAliveException e) { + result.e = e; + } + return result; + } + } + + private static class getSupervisorWorkers extends org.apache.thrift.ProcessFunction { + public getSupervisorWorkers() { + super("getSupervisorWorkers"); + } + + protected getSupervisorWorkers_args getEmptyArgsInstance() { + return new getSupervisorWorkers_args(); + } + + protected getSupervisorWorkers_result getResult(I iface, getSupervisorWorkers_args args) throws org.apache.thrift.TException { + getSupervisorWorkers_result result = new getSupervisorWorkers_result(); + try { + result.success = iface.getSupervisorWorkers(args.host); + } catch (NotAliveException e) { + result.e = e; + } + return result; + } + } + + private static class getTopologyConf extends org.apache.thrift.ProcessFunction { + public getTopologyConf() { + super("getTopologyConf"); + } + + protected getTopologyConf_args getEmptyArgsInstance() { + return new getTopologyConf_args(); + } + + protected getTopologyConf_result getResult(I iface, getTopologyConf_args args) throws org.apache.thrift.TException { + getTopologyConf_result result = new getTopologyConf_result(); + try { + result.success = iface.getTopologyConf(args.id); + } catch (NotAliveException e) { + result.e = e; + } + return result; + } + } + + private static class getTopology extends org.apache.thrift.ProcessFunction { + public getTopology() { + super("getTopology"); + } + + protected getTopology_args getEmptyArgsInstance() { + return new getTopology_args(); + } + + protected getTopology_result getResult(I iface, getTopology_args args) throws org.apache.thrift.TException { + getTopology_result result = new getTopology_result(); + try { + result.success = iface.getTopology(args.id); + } catch (NotAliveException e) { + result.e = e; + } + return result; + } + } + + } + + public static class submitTopology_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("submitTopology_args"); + + private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField UPLOADED_JAR_LOCATION_FIELD_DESC = new org.apache.thrift.protocol.TField("uploadedJarLocation", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField JSON_CONF_FIELD_DESC = new org.apache.thrift.protocol.TField("jsonConf", org.apache.thrift.protocol.TType.STRING, (short)3); + private static final org.apache.thrift.protocol.TField TOPOLOGY_FIELD_DESC = new org.apache.thrift.protocol.TField("topology", org.apache.thrift.protocol.TType.STRUCT, (short)4); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new submitTopology_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new submitTopology_argsTupleSchemeFactory()); + } + + private String name; // required + private String uploadedJarLocation; // required + private String jsonConf; // required + private StormTopology topology; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + NAME((short)1, "name"), + UPLOADED_JAR_LOCATION((short)2, "uploadedJarLocation"), + JSON_CONF((short)3, "jsonConf"), + TOPOLOGY((short)4, "topology"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // NAME + return NAME; + case 2: // UPLOADED_JAR_LOCATION + return UPLOADED_JAR_LOCATION; + case 3: // JSON_CONF + return JSON_CONF; + case 4: // TOPOLOGY + return TOPOLOGY; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.UPLOADED_JAR_LOCATION, new org.apache.thrift.meta_data.FieldMetaData("uploadedJarLocation", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.JSON_CONF, new org.apache.thrift.meta_data.FieldMetaData("jsonConf", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.TOPOLOGY, new org.apache.thrift.meta_data.FieldMetaData("topology", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, StormTopology.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(submitTopology_args.class, metaDataMap); + } + + public submitTopology_args() { + } + + public submitTopology_args( + String name, + String uploadedJarLocation, + String jsonConf, + StormTopology topology) + { + this(); + this.name = name; + this.uploadedJarLocation = uploadedJarLocation; + this.jsonConf = jsonConf; + this.topology = topology; + } + + /** + * Performs a deep copy on other. + */ + public submitTopology_args(submitTopology_args other) { + if (other.is_set_name()) { + this.name = other.name; + } + if (other.is_set_uploadedJarLocation()) { + this.uploadedJarLocation = other.uploadedJarLocation; + } + if (other.is_set_jsonConf()) { + this.jsonConf = other.jsonConf; + } + if (other.is_set_topology()) { + this.topology = new StormTopology(other.topology); + } + } + + public submitTopology_args deepCopy() { + return new submitTopology_args(this); + } + + @Override + public void clear() { + this.name = null; + this.uploadedJarLocation = null; + this.jsonConf = null; + this.topology = null; + } + + public String get_name() { + return this.name; + } + + public void set_name(String name) { + this.name = name; + } + + public void unset_name() { + this.name = null; + } + + /** Returns true if field name is set (has been assigned a value) and false otherwise */ + public boolean is_set_name() { + return this.name != null; + } + + public void set_name_isSet(boolean value) { + if (!value) { + this.name = null; + } + } + + public String get_uploadedJarLocation() { + return this.uploadedJarLocation; + } + + public void set_uploadedJarLocation(String uploadedJarLocation) { + this.uploadedJarLocation = uploadedJarLocation; + } + + public void unset_uploadedJarLocation() { + this.uploadedJarLocation = null; + } + + /** Returns true if field uploadedJarLocation is set (has been assigned a value) and false otherwise */ + public boolean is_set_uploadedJarLocation() { + return this.uploadedJarLocation != null; + } + + public void set_uploadedJarLocation_isSet(boolean value) { + if (!value) { + this.uploadedJarLocation = null; + } + } + + public String get_jsonConf() { + return this.jsonConf; + } + + public void set_jsonConf(String jsonConf) { + this.jsonConf = jsonConf; + } + + public void unset_jsonConf() { + this.jsonConf = null; + } + + /** Returns true if field jsonConf is set (has been assigned a value) and false otherwise */ + public boolean is_set_jsonConf() { + return this.jsonConf != null; + } + + public void set_jsonConf_isSet(boolean value) { + if (!value) { + this.jsonConf = null; + } + } + + public StormTopology get_topology() { + return this.topology; + } + + public void set_topology(StormTopology topology) { + this.topology = topology; + } + + public void unset_topology() { + this.topology = null; + } + + /** Returns true if field topology is set (has been assigned a value) and false otherwise */ + public boolean is_set_topology() { + return this.topology != null; + } + + public void set_topology_isSet(boolean value) { + if (!value) { + this.topology = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case NAME: + if (value == null) { + unset_name(); + } else { + set_name((String)value); + } + break; + + case UPLOADED_JAR_LOCATION: + if (value == null) { + unset_uploadedJarLocation(); + } else { + set_uploadedJarLocation((String)value); + } + break; + + case JSON_CONF: + if (value == null) { + unset_jsonConf(); + } else { + set_jsonConf((String)value); + } + break; + + case TOPOLOGY: + if (value == null) { + unset_topology(); + } else { + set_topology((StormTopology)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case NAME: + return get_name(); + + case UPLOADED_JAR_LOCATION: + return get_uploadedJarLocation(); + + case JSON_CONF: + return get_jsonConf(); + + case TOPOLOGY: + return get_topology(); + + } + throw new 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(); + } + + switch (field) { + case NAME: + return is_set_name(); + case UPLOADED_JAR_LOCATION: + return is_set_uploadedJarLocation(); + case JSON_CONF: + return is_set_jsonConf(); + case TOPOLOGY: + return is_set_topology(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof submitTopology_args) + return this.equals((submitTopology_args)that); + return false; + } + + public boolean equals(submitTopology_args that) { + if (that == null) + return false; + + boolean this_present_name = true && this.is_set_name(); + boolean that_present_name = true && that.is_set_name(); + if (this_present_name || that_present_name) { + if (!(this_present_name && that_present_name)) + return false; + if (!this.name.equals(that.name)) + return false; + } + + boolean this_present_uploadedJarLocation = true && this.is_set_uploadedJarLocation(); + boolean that_present_uploadedJarLocation = true && that.is_set_uploadedJarLocation(); + if (this_present_uploadedJarLocation || that_present_uploadedJarLocation) { + if (!(this_present_uploadedJarLocation && that_present_uploadedJarLocation)) + return false; + if (!this.uploadedJarLocation.equals(that.uploadedJarLocation)) + return false; + } + + boolean this_present_jsonConf = true && this.is_set_jsonConf(); + boolean that_present_jsonConf = true && that.is_set_jsonConf(); + if (this_present_jsonConf || that_present_jsonConf) { + if (!(this_present_jsonConf && that_present_jsonConf)) + return false; + if (!this.jsonConf.equals(that.jsonConf)) + return false; + } + + boolean this_present_topology = true && this.is_set_topology(); + boolean that_present_topology = true && that.is_set_topology(); + if (this_present_topology || that_present_topology) { + if (!(this_present_topology && that_present_topology)) + return false; + if (!this.topology.equals(that.topology)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_name = true && (is_set_name()); + builder.append(present_name); + if (present_name) + builder.append(name); + + boolean present_uploadedJarLocation = true && (is_set_uploadedJarLocation()); + builder.append(present_uploadedJarLocation); + if (present_uploadedJarLocation) + builder.append(uploadedJarLocation); + + boolean present_jsonConf = true && (is_set_jsonConf()); + builder.append(present_jsonConf); + if (present_jsonConf) + builder.append(jsonConf); + + boolean present_topology = true && (is_set_topology()); + builder.append(present_topology); + if (present_topology) + builder.append(topology); + + return builder.toHashCode(); + } + + public int compareTo(submitTopology_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + submitTopology_args typedOther = (submitTopology_args)other; + + lastComparison = Boolean.valueOf(is_set_name()).compareTo(typedOther.is_set_name()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_name()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_uploadedJarLocation()).compareTo(typedOther.is_set_uploadedJarLocation()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_uploadedJarLocation()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uploadedJarLocation, typedOther.uploadedJarLocation); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_jsonConf()).compareTo(typedOther.is_set_jsonConf()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_jsonConf()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.jsonConf, typedOther.jsonConf); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_topology()).compareTo(typedOther.is_set_topology()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_topology()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.topology, typedOther.topology); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("submitTopology_args("); + boolean first = true; + + sb.append("name:"); + if (this.name == null) { + sb.append("null"); + } else { + sb.append(this.name); + } + first = false; + if (!first) sb.append(", "); + sb.append("uploadedJarLocation:"); + if (this.uploadedJarLocation == null) { + sb.append("null"); + } else { + sb.append(this.uploadedJarLocation); + } + first = false; + if (!first) sb.append(", "); + sb.append("jsonConf:"); + if (this.jsonConf == null) { + sb.append("null"); + } else { + sb.append(this.jsonConf); + } + first = false; + if (!first) sb.append(", "); + sb.append("topology:"); + if (this.topology == null) { + sb.append("null"); + } else { + sb.append(this.topology); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 submitTopology_argsStandardSchemeFactory implements SchemeFactory { + public submitTopology_argsStandardScheme getScheme() { + return new submitTopology_argsStandardScheme(); + } + } + + private static class submitTopology_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, submitTopology_args 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: // NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.name = iprot.readString(); + struct.set_name_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // UPLOADED_JAR_LOCATION + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.uploadedJarLocation = iprot.readString(); + struct.set_uploadedJarLocation_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // JSON_CONF + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.jsonConf = iprot.readString(); + struct.set_jsonConf_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // TOPOLOGY + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.topology = new StormTopology(); + struct.topology.read(iprot); + struct.set_topology_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, submitTopology_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.name != null) { + oprot.writeFieldBegin(NAME_FIELD_DESC); + oprot.writeString(struct.name); + oprot.writeFieldEnd(); + } + if (struct.uploadedJarLocation != null) { + oprot.writeFieldBegin(UPLOADED_JAR_LOCATION_FIELD_DESC); + oprot.writeString(struct.uploadedJarLocation); + oprot.writeFieldEnd(); + } + if (struct.jsonConf != null) { + oprot.writeFieldBegin(JSON_CONF_FIELD_DESC); + oprot.writeString(struct.jsonConf); + oprot.writeFieldEnd(); + } + if (struct.topology != null) { + oprot.writeFieldBegin(TOPOLOGY_FIELD_DESC); + struct.topology.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class submitTopology_argsTupleSchemeFactory implements SchemeFactory { + public submitTopology_argsTupleScheme getScheme() { + return new submitTopology_argsTupleScheme(); + } + } + + private static class submitTopology_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, submitTopology_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.is_set_name()) { + optionals.set(0); + } + if (struct.is_set_uploadedJarLocation()) { + optionals.set(1); + } + if (struct.is_set_jsonConf()) { + optionals.set(2); + } + if (struct.is_set_topology()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.is_set_name()) { + oprot.writeString(struct.name); + } + if (struct.is_set_uploadedJarLocation()) { + oprot.writeString(struct.uploadedJarLocation); + } + if (struct.is_set_jsonConf()) { + oprot.writeString(struct.jsonConf); + } + if (struct.is_set_topology()) { + struct.topology.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, submitTopology_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + struct.name = iprot.readString(); + struct.set_name_isSet(true); + } + if (incoming.get(1)) { + struct.uploadedJarLocation = iprot.readString(); + struct.set_uploadedJarLocation_isSet(true); + } + if (incoming.get(2)) { + struct.jsonConf = iprot.readString(); + struct.set_jsonConf_isSet(true); + } + if (incoming.get(3)) { + struct.topology = new StormTopology(); + struct.topology.read(iprot); + struct.set_topology_isSet(true); + } + } + } + + } + + public static class submitTopology_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("submitTopology_result"); + + private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField ITE_FIELD_DESC = new org.apache.thrift.protocol.TField("ite", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new submitTopology_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new submitTopology_resultTupleSchemeFactory()); + } + + private AlreadyAliveException e; // required + private InvalidTopologyException ite; // 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 { + E((short)1, "e"), + ITE((short)2, "ite"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // E + return E; + case 2: // ITE + return ITE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + tmpMap.put(_Fields.ITE, new org.apache.thrift.meta_data.FieldMetaData("ite", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(submitTopology_result.class, metaDataMap); + } + + public submitTopology_result() { + } + + public submitTopology_result( + AlreadyAliveException e, + InvalidTopologyException ite) + { + this(); + this.e = e; + this.ite = ite; + } + + /** + * Performs a deep copy on other. + */ + public submitTopology_result(submitTopology_result other) { + if (other.is_set_e()) { + this.e = new AlreadyAliveException(other.e); + } + if (other.is_set_ite()) { + this.ite = new InvalidTopologyException(other.ite); + } + } + + public submitTopology_result deepCopy() { + return new submitTopology_result(this); + } + + @Override + public void clear() { + this.e = null; + this.ite = null; + } + + public AlreadyAliveException get_e() { + return this.e; + } + + public void set_e(AlreadyAliveException e) { + this.e = e; + } + + public void unset_e() { + this.e = null; + } + + /** Returns true if field e is set (has been assigned a value) and false otherwise */ + public boolean is_set_e() { + return this.e != null; + } + + public void set_e_isSet(boolean value) { + if (!value) { + this.e = null; + } + } + + public InvalidTopologyException get_ite() { + return this.ite; + } + + public void set_ite(InvalidTopologyException ite) { + this.ite = ite; + } + + public void unset_ite() { + this.ite = null; + } + + /** Returns true if field ite is set (has been assigned a value) and false otherwise */ + public boolean is_set_ite() { + return this.ite != null; + } + + public void set_ite_isSet(boolean value) { + if (!value) { + this.ite = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case E: + if (value == null) { + unset_e(); + } else { + set_e((AlreadyAliveException)value); + } + break; + + case ITE: + if (value == null) { + unset_ite(); + } else { + set_ite((InvalidTopologyException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case E: + return get_e(); + + case ITE: + return get_ite(); + + } + throw new 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(); + } + + switch (field) { + case E: + return is_set_e(); + case ITE: + return is_set_ite(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof submitTopology_result) + return this.equals((submitTopology_result)that); + return false; + } + + public boolean equals(submitTopology_result that) { + if (that == null) + return false; + + boolean this_present_e = true && this.is_set_e(); + boolean that_present_e = true && that.is_set_e(); + if (this_present_e || that_present_e) { + if (!(this_present_e && that_present_e)) + return false; + if (!this.e.equals(that.e)) + return false; + } + + boolean this_present_ite = true && this.is_set_ite(); + boolean that_present_ite = true && that.is_set_ite(); + if (this_present_ite || that_present_ite) { + if (!(this_present_ite && that_present_ite)) + return false; + if (!this.ite.equals(that.ite)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_e = true && (is_set_e()); + builder.append(present_e); + if (present_e) + builder.append(e); + + boolean present_ite = true && (is_set_ite()); + builder.append(present_ite); + if (present_ite) + builder.append(ite); + + return builder.toHashCode(); + } + + public int compareTo(submitTopology_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + submitTopology_result typedOther = (submitTopology_result)other; + + lastComparison = Boolean.valueOf(is_set_e()).compareTo(typedOther.is_set_e()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_e()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_ite()).compareTo(typedOther.is_set_ite()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_ite()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ite, typedOther.ite); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("submitTopology_result("); + boolean first = true; + + sb.append("e:"); + if (this.e == null) { + sb.append("null"); + } else { + sb.append(this.e); + } + first = false; + if (!first) sb.append(", "); + sb.append("ite:"); + if (this.ite == null) { + sb.append("null"); + } else { + sb.append(this.ite); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 submitTopology_resultStandardSchemeFactory implements SchemeFactory { + public submitTopology_resultStandardScheme getScheme() { + return new submitTopology_resultStandardScheme(); + } + } + + private static class submitTopology_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, submitTopology_result 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: // E + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.e = new AlreadyAliveException(); + struct.e.read(iprot); + struct.set_e_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ITE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ite = new InvalidTopologyException(); + struct.ite.read(iprot); + struct.set_ite_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, submitTopology_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.e != null) { + oprot.writeFieldBegin(E_FIELD_DESC); + struct.e.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ite != null) { + oprot.writeFieldBegin(ITE_FIELD_DESC); + struct.ite.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class submitTopology_resultTupleSchemeFactory implements SchemeFactory { + public submitTopology_resultTupleScheme getScheme() { + return new submitTopology_resultTupleScheme(); + } + } + + private static class submitTopology_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, submitTopology_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.is_set_e()) { + optionals.set(0); + } + if (struct.is_set_ite()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.is_set_e()) { + struct.e.write(oprot); + } + if (struct.is_set_ite()) { + struct.ite.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, submitTopology_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.e = new AlreadyAliveException(); + struct.e.read(iprot); + struct.set_e_isSet(true); + } + if (incoming.get(1)) { + struct.ite = new InvalidTopologyException(); + struct.ite.read(iprot); + struct.set_ite_isSet(true); + } + } + } + + } + + public static class killTopology_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("killTopology_args"); + + private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new killTopology_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new killTopology_argsTupleSchemeFactory()); + } + + private String name; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + NAME((short)1, "name"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // NAME + return NAME; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(killTopology_args.class, metaDataMap); + } + + public killTopology_args() { + } + + public killTopology_args( + String name) + { + this(); + this.name = name; + } + + /** + * Performs a deep copy on other. + */ + public killTopology_args(killTopology_args other) { + if (other.is_set_name()) { + this.name = other.name; + } + } + + public killTopology_args deepCopy() { + return new killTopology_args(this); + } + + @Override + public void clear() { + this.name = null; + } + + public String get_name() { + return this.name; + } + + public void set_name(String name) { + this.name = name; + } + + public void unset_name() { + this.name = null; + } + + /** Returns true if field name is set (has been assigned a value) and false otherwise */ + public boolean is_set_name() { + return this.name != null; + } + + public void set_name_isSet(boolean value) { + if (!value) { + this.name = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case NAME: + if (value == null) { + unset_name(); + } else { + set_name((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case NAME: + return get_name(); + + } + throw new 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(); + } + + switch (field) { + case NAME: + return is_set_name(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof killTopology_args) + return this.equals((killTopology_args)that); + return false; + } + + public boolean equals(killTopology_args that) { + if (that == null) + return false; + + boolean this_present_name = true && this.is_set_name(); + boolean that_present_name = true && that.is_set_name(); + if (this_present_name || that_present_name) { + if (!(this_present_name && that_present_name)) + return false; + if (!this.name.equals(that.name)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_name = true && (is_set_name()); + builder.append(present_name); + if (present_name) + builder.append(name); + + return builder.toHashCode(); + } + + public int compareTo(killTopology_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + killTopology_args typedOther = (killTopology_args)other; + + lastComparison = Boolean.valueOf(is_set_name()).compareTo(typedOther.is_set_name()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_name()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("killTopology_args("); + boolean first = true; + + sb.append("name:"); + if (this.name == null) { + sb.append("null"); + } else { + sb.append(this.name); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 killTopology_argsStandardSchemeFactory implements SchemeFactory { + public killTopology_argsStandardScheme getScheme() { + return new killTopology_argsStandardScheme(); + } + } + + private static class killTopology_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, killTopology_args 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: // NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.name = iprot.readString(); + struct.set_name_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, killTopology_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.name != null) { + oprot.writeFieldBegin(NAME_FIELD_DESC); + oprot.writeString(struct.name); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class killTopology_argsTupleSchemeFactory implements SchemeFactory { + public killTopology_argsTupleScheme getScheme() { + return new killTopology_argsTupleScheme(); + } + } + + private static class killTopology_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, killTopology_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.is_set_name()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.is_set_name()) { + oprot.writeString(struct.name); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, killTopology_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.name = iprot.readString(); + struct.set_name_isSet(true); + } + } + } + + } + + public static class killTopology_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("killTopology_result"); + + private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new killTopology_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new killTopology_resultTupleSchemeFactory()); + } + + private NotAliveException e; // 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 { + E((short)1, "e"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // E + return E; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(killTopology_result.class, metaDataMap); + } + + public killTopology_result() { + } + + public killTopology_result( + NotAliveException e) + { + this(); + this.e = e; + } + + /** + * Performs a deep copy on other. + */ + public killTopology_result(killTopology_result other) { + if (other.is_set_e()) { + this.e = new NotAliveException(other.e); + } + } + + public killTopology_result deepCopy() { + return new killTopology_result(this); + } + + @Override + public void clear() { + this.e = null; + } + + public NotAliveException get_e() { + return this.e; + } + + public void set_e(NotAliveException e) { + this.e = e; + } + + public void unset_e() { + this.e = null; + } + + /** Returns true if field e is set (has been assigned a value) and false otherwise */ + public boolean is_set_e() { + return this.e != null; + } + + public void set_e_isSet(boolean value) { + if (!value) { + this.e = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case E: + if (value == null) { + unset_e(); + } else { + set_e((NotAliveException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case E: + return get_e(); + + } + throw new 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(); + } + + switch (field) { + case E: + return is_set_e(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof killTopology_result) + return this.equals((killTopology_result)that); + return false; + } + + public boolean equals(killTopology_result that) { + if (that == null) + return false; + + boolean this_present_e = true && this.is_set_e(); + boolean that_present_e = true && that.is_set_e(); + if (this_present_e || that_present_e) { + if (!(this_present_e && that_present_e)) + return false; + if (!this.e.equals(that.e)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_e = true && (is_set_e()); + builder.append(present_e); + if (present_e) + builder.append(e); + + return builder.toHashCode(); + } + + public int compareTo(killTopology_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + killTopology_result typedOther = (killTopology_result)other; + + lastComparison = Boolean.valueOf(is_set_e()).compareTo(typedOther.is_set_e()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_e()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("killTopology_result("); + boolean first = true; + + sb.append("e:"); + if (this.e == null) { + sb.append("null"); + } else { + sb.append(this.e); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 killTopology_resultStandardSchemeFactory implements SchemeFactory { + public killTopology_resultStandardScheme getScheme() { + return new killTopology_resultStandardScheme(); + } + } + + private static class killTopology_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, killTopology_result 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: // E + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.e = new NotAliveException(); + struct.e.read(iprot); + struct.set_e_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, killTopology_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.e != null) { + oprot.writeFieldBegin(E_FIELD_DESC); + struct.e.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class killTopology_resultTupleSchemeFactory implements SchemeFactory { + public killTopology_resultTupleScheme getScheme() { + return new killTopology_resultTupleScheme(); + } + } + + private static class killTopology_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, killTopology_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.is_set_e()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.is_set_e()) { + struct.e.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, killTopology_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.e = new NotAliveException(); + struct.e.read(iprot); + struct.set_e_isSet(true); + } + } + } + + } + + public static class killTopologyWithOpts_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("killTopologyWithOpts_args"); + + private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField OPTIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("options", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new killTopologyWithOpts_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new killTopologyWithOpts_argsTupleSchemeFactory()); + } + + private String name; // required + private KillOptions options; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + NAME((short)1, "name"), + OPTIONS((short)2, "options"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // NAME + return NAME; + case 2: // OPTIONS + return OPTIONS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.OPTIONS, new org.apache.thrift.meta_data.FieldMetaData("options", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, KillOptions.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(killTopologyWithOpts_args.class, metaDataMap); + } + + public killTopologyWithOpts_args() { + } + + public killTopologyWithOpts_args( + String name, + KillOptions options) + { + this(); + this.name = name; + this.options = options; + } + + /** + * Performs a deep copy on other. + */ + public killTopologyWithOpts_args(killTopologyWithOpts_args other) { + if (other.is_set_name()) { + this.name = other.name; + } + if (other.is_set_options()) { + this.options = new KillOptions(other.options); + } + } + + public killTopologyWithOpts_args deepCopy() { + return new killTopologyWithOpts_args(this); + } + + @Override + public void clear() { + this.name = null; + this.options = null; + } + + public String get_name() { + return this.name; + } + + public void set_name(String name) { + this.name = name; + } + + public void unset_name() { + this.name = null; + } + + /** Returns true if field name is set (has been assigned a value) and false otherwise */ + public boolean is_set_name() { + return this.name != null; + } + + public void set_name_isSet(boolean value) { + if (!value) { + this.name = null; + } + } + + public KillOptions get_options() { + return this.options; + } + + public void set_options(KillOptions options) { + this.options = options; + } + + public void unset_options() { + this.options = null; + } + + /** Returns true if field options is set (has been assigned a value) and false otherwise */ + public boolean is_set_options() { + return this.options != null; + } + + public void set_options_isSet(boolean value) { + if (!value) { + this.options = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case NAME: + if (value == null) { + unset_name(); + } else { + set_name((String)value); + } + break; + + case OPTIONS: + if (value == null) { + unset_options(); + } else { + set_options((KillOptions)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case NAME: + return get_name(); + + case OPTIONS: + return get_options(); + + } + throw new 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(); + } + + switch (field) { + case NAME: + return is_set_name(); + case OPTIONS: + return is_set_options(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof killTopologyWithOpts_args) + return this.equals((killTopologyWithOpts_args)that); + return false; + } + + public boolean equals(killTopologyWithOpts_args that) { + if (that == null) + return false; + + boolean this_present_name = true && this.is_set_name(); + boolean that_present_name = true && that.is_set_name(); + if (this_present_name || that_present_name) { + if (!(this_present_name && that_present_name)) + return false; + if (!this.name.equals(that.name)) + return false; + } + + boolean this_present_options = true && this.is_set_options(); + boolean that_present_options = true && that.is_set_options(); + if (this_present_options || that_present_options) { + if (!(this_present_options && that_present_options)) + return false; + if (!this.options.equals(that.options)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_name = true && (is_set_name()); + builder.append(present_name); + if (present_name) + builder.append(name); + + boolean present_options = true && (is_set_options()); + builder.append(present_options); + if (present_options) + builder.append(options); + + return builder.toHashCode(); + } + + public int compareTo(killTopologyWithOpts_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + killTopologyWithOpts_args typedOther = (killTopologyWithOpts_args)other; + + lastComparison = Boolean.valueOf(is_set_name()).compareTo(typedOther.is_set_name()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_name()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_options()).compareTo(typedOther.is_set_options()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_options()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.options, typedOther.options); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("killTopologyWithOpts_args("); + boolean first = true; + + sb.append("name:"); + if (this.name == null) { + sb.append("null"); + } else { + sb.append(this.name); + } + first = false; + if (!first) sb.append(", "); + sb.append("options:"); + if (this.options == null) { + sb.append("null"); + } else { + sb.append(this.options); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 killTopologyWithOpts_argsStandardSchemeFactory implements SchemeFactory { + public killTopologyWithOpts_argsStandardScheme getScheme() { + return new killTopologyWithOpts_argsStandardScheme(); + } + } + + private static class killTopologyWithOpts_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, killTopologyWithOpts_args 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: // NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.name = iprot.readString(); + struct.set_name_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // OPTIONS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.options = new KillOptions(); + struct.options.read(iprot); + struct.set_options_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, killTopologyWithOpts_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.name != null) { + oprot.writeFieldBegin(NAME_FIELD_DESC); + oprot.writeString(struct.name); + oprot.writeFieldEnd(); + } + if (struct.options != null) { + oprot.writeFieldBegin(OPTIONS_FIELD_DESC); + struct.options.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class killTopologyWithOpts_argsTupleSchemeFactory implements SchemeFactory { + public killTopologyWithOpts_argsTupleScheme getScheme() { + return new killTopologyWithOpts_argsTupleScheme(); + } + } + + private static class killTopologyWithOpts_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, killTopologyWithOpts_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.is_set_name()) { + optionals.set(0); + } + if (struct.is_set_options()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.is_set_name()) { + oprot.writeString(struct.name); + } + if (struct.is_set_options()) { + struct.options.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, killTopologyWithOpts_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.name = iprot.readString(); + struct.set_name_isSet(true); + } + if (incoming.get(1)) { + struct.options = new KillOptions(); + struct.options.read(iprot); + struct.set_options_isSet(true); + } + } + } + + } + + public static class killTopologyWithOpts_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("killTopologyWithOpts_result"); + + private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new killTopologyWithOpts_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new killTopologyWithOpts_resultTupleSchemeFactory()); + } + + private NotAliveException e; // 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 { + E((short)1, "e"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // E + return E; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(killTopologyWithOpts_result.class, metaDataMap); + } + + public killTopologyWithOpts_result() { + } + + public killTopologyWithOpts_result( + NotAliveException e) + { + this(); + this.e = e; + } + + /** + * Performs a deep copy on other. + */ + public killTopologyWithOpts_result(killTopologyWithOpts_result other) { + if (other.is_set_e()) { + this.e = new NotAliveException(other.e); + } + } + + public killTopologyWithOpts_result deepCopy() { + return new killTopologyWithOpts_result(this); + } + + @Override + public void clear() { + this.e = null; + } + + public NotAliveException get_e() { + return this.e; + } + + public void set_e(NotAliveException e) { + this.e = e; + } + + public void unset_e() { + this.e = null; + } + + /** Returns true if field e is set (has been assigned a value) and false otherwise */ + public boolean is_set_e() { + return this.e != null; + } + + public void set_e_isSet(boolean value) { + if (!value) { + this.e = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case E: + if (value == null) { + unset_e(); + } else { + set_e((NotAliveException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case E: + return get_e(); + + } + throw new 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(); + } + + switch (field) { + case E: + return is_set_e(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof killTopologyWithOpts_result) + return this.equals((killTopologyWithOpts_result)that); + return false; + } + + public boolean equals(killTopologyWithOpts_result that) { + if (that == null) + return false; + + boolean this_present_e = true && this.is_set_e(); + boolean that_present_e = true && that.is_set_e(); + if (this_present_e || that_present_e) { + if (!(this_present_e && that_present_e)) + return false; + if (!this.e.equals(that.e)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_e = true && (is_set_e()); + builder.append(present_e); + if (present_e) + builder.append(e); + + return builder.toHashCode(); + } + + public int compareTo(killTopologyWithOpts_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + killTopologyWithOpts_result typedOther = (killTopologyWithOpts_result)other; + + lastComparison = Boolean.valueOf(is_set_e()).compareTo(typedOther.is_set_e()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_e()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("killTopologyWithOpts_result("); + boolean first = true; + + sb.append("e:"); + if (this.e == null) { + sb.append("null"); + } else { + sb.append(this.e); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 killTopologyWithOpts_resultStandardSchemeFactory implements SchemeFactory { + public killTopologyWithOpts_resultStandardScheme getScheme() { + return new killTopologyWithOpts_resultStandardScheme(); + } + } + + private static class killTopologyWithOpts_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, killTopologyWithOpts_result 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: // E + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.e = new NotAliveException(); + struct.e.read(iprot); + struct.set_e_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, killTopologyWithOpts_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.e != null) { + oprot.writeFieldBegin(E_FIELD_DESC); + struct.e.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class killTopologyWithOpts_resultTupleSchemeFactory implements SchemeFactory { + public killTopologyWithOpts_resultTupleScheme getScheme() { + return new killTopologyWithOpts_resultTupleScheme(); + } + } + + private static class killTopologyWithOpts_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, killTopologyWithOpts_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.is_set_e()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.is_set_e()) { + struct.e.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, killTopologyWithOpts_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.e = new NotAliveException(); + struct.e.read(iprot); + struct.set_e_isSet(true); + } + } + } + + } + + public static class activate_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("activate_args"); + + private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new activate_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new activate_argsTupleSchemeFactory()); + } + + private String name; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + NAME((short)1, "name"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // NAME + return NAME; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(activate_args.class, metaDataMap); + } + + public activate_args() { + } + + public activate_args( + String name) + { + this(); + this.name = name; + } + + /** + * Performs a deep copy on other. + */ + public activate_args(activate_args other) { + if (other.is_set_name()) { + this.name = other.name; + } + } + + public activate_args deepCopy() { + return new activate_args(this); + } + + @Override + public void clear() { + this.name = null; + } + + public String get_name() { + return this.name; + } + + public void set_name(String name) { + this.name = name; + } + + public void unset_name() { + this.name = null; + } + + /** Returns true if field name is set (has been assigned a value) and false otherwise */ + public boolean is_set_name() { + return this.name != null; + } + + public void set_name_isSet(boolean value) { + if (!value) { + this.name = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case NAME: + if (value == null) { + unset_name(); + } else { + set_name((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case NAME: + return get_name(); + + } + throw new 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(); + } + + switch (field) { + case NAME: + return is_set_name(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof activate_args) + return this.equals((activate_args)that); + return false; + } + + public boolean equals(activate_args that) { + if (that == null) + return false; + + boolean this_present_name = true && this.is_set_name(); + boolean that_present_name = true && that.is_set_name(); + if (this_present_name || that_present_name) { + if (!(this_present_name && that_present_name)) + return false; + if (!this.name.equals(that.name)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_name = true && (is_set_name()); + builder.append(present_name); + if (present_name) + builder.append(name); + + return builder.toHashCode(); + } + + public int compareTo(activate_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + activate_args typedOther = (activate_args)other; + + lastComparison = Boolean.valueOf(is_set_name()).compareTo(typedOther.is_set_name()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_name()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("activate_args("); + boolean first = true; + + sb.append("name:"); + if (this.name == null) { + sb.append("null"); + } else { + sb.append(this.name); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 activate_argsStandardSchemeFactory implements SchemeFactory { + public activate_argsStandardScheme getScheme() { + return new activate_argsStandardScheme(); + } + } + + private static class activate_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, activate_args 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: // NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.name = iprot.readString(); + struct.set_name_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, activate_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.name != null) { + oprot.writeFieldBegin(NAME_FIELD_DESC); + oprot.writeString(struct.name); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class activate_argsTupleSchemeFactory implements SchemeFactory { + public activate_argsTupleScheme getScheme() { + return new activate_argsTupleScheme(); + } + } + + private static class activate_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, activate_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.is_set_name()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.is_set_name()) { + oprot.writeString(struct.name); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, activate_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.name = iprot.readString(); + struct.set_name_isSet(true); + } + } + } + + } + + public static class activate_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("activate_result"); + + private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new activate_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new activate_resultTupleSchemeFactory()); + } + + private NotAliveException e; // 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 { + E((short)1, "e"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // E + return E; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(activate_result.class, metaDataMap); + } + + public activate_result() { + } + + public activate_result( + NotAliveException e) + { + this(); + this.e = e; + } + + /** + * Performs a deep copy on other. + */ + public activate_result(activate_result other) { + if (other.is_set_e()) { + this.e = new NotAliveException(other.e); + } + } + + public activate_result deepCopy() { + return new activate_result(this); + } + + @Override + public void clear() { + this.e = null; + } + + public NotAliveException get_e() { + return this.e; + } + + public void set_e(NotAliveException e) { + this.e = e; + } + + public void unset_e() { + this.e = null; + } + + /** Returns true if field e is set (has been assigned a value) and false otherwise */ + public boolean is_set_e() { + return this.e != null; + } + + public void set_e_isSet(boolean value) { + if (!value) { + this.e = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case E: + if (value == null) { + unset_e(); + } else { + set_e((NotAliveException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case E: + return get_e(); + + } + throw new 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(); + } + + switch (field) { + case E: + return is_set_e(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof activate_result) + return this.equals((activate_result)that); + return false; + } + + public boolean equals(activate_result that) { + if (that == null) + return false; + + boolean this_present_e = true && this.is_set_e(); + boolean that_present_e = true && that.is_set_e(); + if (this_present_e || that_present_e) { + if (!(this_present_e && that_present_e)) + return false; + if (!this.e.equals(that.e)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_e = true && (is_set_e()); + builder.append(present_e); + if (present_e) + builder.append(e); + + return builder.toHashCode(); + } + + public int compareTo(activate_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + activate_result typedOther = (activate_result)other; + + lastComparison = Boolean.valueOf(is_set_e()).compareTo(typedOther.is_set_e()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_e()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("activate_result("); + boolean first = true; + + sb.append("e:"); + if (this.e == null) { + sb.append("null"); + } else { + sb.append(this.e); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 activate_resultStandardSchemeFactory implements SchemeFactory { + public activate_resultStandardScheme getScheme() { + return new activate_resultStandardScheme(); + } + } + + private static class activate_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, activate_result 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: // E + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.e = new NotAliveException(); + struct.e.read(iprot); + struct.set_e_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, activate_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.e != null) { + oprot.writeFieldBegin(E_FIELD_DESC); + struct.e.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class activate_resultTupleSchemeFactory implements SchemeFactory { + public activate_resultTupleScheme getScheme() { + return new activate_resultTupleScheme(); + } + } + + private static class activate_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, activate_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.is_set_e()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.is_set_e()) { + struct.e.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, activate_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.e = new NotAliveException(); + struct.e.read(iprot); + struct.set_e_isSet(true); + } + } + } + + } + + public static class deactivate_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deactivate_args"); + + private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new deactivate_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new deactivate_argsTupleSchemeFactory()); + } + + private String name; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + NAME((short)1, "name"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // NAME + return NAME; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deactivate_args.class, metaDataMap); + } + + public deactivate_args() { + } + + public deactivate_args( + String name) + { + this(); + this.name = name; + } + + /** + * Performs a deep copy on other. + */ + public deactivate_args(deactivate_args other) { + if (other.is_set_name()) { + this.name = other.name; + } + } + + public deactivate_args deepCopy() { + return new deactivate_args(this); + } + + @Override + public void clear() { + this.name = null; + } + + public String get_name() { + return this.name; + } + + public void set_name(String name) { + this.name = name; + } + + public void unset_name() { + this.name = null; + } + + /** Returns true if field name is set (has been assigned a value) and false otherwise */ + public boolean is_set_name() { + return this.name != null; + } + + public void set_name_isSet(boolean value) { + if (!value) { + this.name = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case NAME: + if (value == null) { + unset_name(); + } else { + set_name((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case NAME: + return get_name(); + + } + throw new 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(); + } + + switch (field) { + case NAME: + return is_set_name(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof deactivate_args) + return this.equals((deactivate_args)that); + return false; + } + + public boolean equals(deactivate_args that) { + if (that == null) + return false; + + boolean this_present_name = true && this.is_set_name(); + boolean that_present_name = true && that.is_set_name(); + if (this_present_name || that_present_name) { + if (!(this_present_name && that_present_name)) + return false; + if (!this.name.equals(that.name)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_name = true && (is_set_name()); + builder.append(present_name); + if (present_name) + builder.append(name); + + return builder.toHashCode(); + } + + public int compareTo(deactivate_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + deactivate_args typedOther = (deactivate_args)other; + + lastComparison = Boolean.valueOf(is_set_name()).compareTo(typedOther.is_set_name()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_name()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("deactivate_args("); + boolean first = true; + + sb.append("name:"); + if (this.name == null) { + sb.append("null"); + } else { + sb.append(this.name); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 deactivate_argsStandardSchemeFactory implements SchemeFactory { + public deactivate_argsStandardScheme getScheme() { + return new deactivate_argsStandardScheme(); + } + } + + private static class deactivate_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, deactivate_args 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: // NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.name = iprot.readString(); + struct.set_name_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, deactivate_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.name != null) { + oprot.writeFieldBegin(NAME_FIELD_DESC); + oprot.writeString(struct.name); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class deactivate_argsTupleSchemeFactory implements SchemeFactory { + public deactivate_argsTupleScheme getScheme() { + return new deactivate_argsTupleScheme(); + } + } + + private static class deactivate_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, deactivate_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.is_set_name()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.is_set_name()) { + oprot.writeString(struct.name); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, deactivate_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.name = iprot.readString(); + struct.set_name_isSet(true); + } + } + } + + } + + public static class deactivate_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deactivate_result"); + + private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new deactivate_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new deactivate_resultTupleSchemeFactory()); + } + + private NotAliveException e; // 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 { + E((short)1, "e"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // E + return E; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deactivate_result.class, metaDataMap); + } + + public deactivate_result() { + } + + public deactivate_result( + NotAliveException e) + { + this(); + this.e = e; + } + + /** + * Performs a deep copy on other. + */ + public deactivate_result(deactivate_result other) { + if (other.is_set_e()) { + this.e = new NotAliveException(other.e); + } + } + + public deactivate_result deepCopy() { + return new deactivate_result(this); + } + + @Override + public void clear() { + this.e = null; + } + + public NotAliveException get_e() { + return this.e; + } + + public void set_e(NotAliveException e) { + this.e = e; + } + + public void unset_e() { + this.e = null; + } + + /** Returns true if field e is set (has been assigned a value) and false otherwise */ + public boolean is_set_e() { + return this.e != null; + } + + public void set_e_isSet(boolean value) { + if (!value) { + this.e = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case E: + if (value == null) { + unset_e(); + } else { + set_e((NotAliveException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case E: + return get_e(); + + } + throw new 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(); + } + + switch (field) { + case E: + return is_set_e(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof deactivate_result) + return this.equals((deactivate_result)that); + return false; + } + + public boolean equals(deactivate_result that) { + if (that == null) + return false; + + boolean this_present_e = true && this.is_set_e(); + boolean that_present_e = true && that.is_set_e(); + if (this_present_e || that_present_e) { + if (!(this_present_e && that_present_e)) + return false; + if (!this.e.equals(that.e)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_e = true && (is_set_e()); + builder.append(present_e); + if (present_e) + builder.append(e); + + return builder.toHashCode(); + } + + public int compareTo(deactivate_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + deactivate_result typedOther = (deactivate_result)other; + + lastComparison = Boolean.valueOf(is_set_e()).compareTo(typedOther.is_set_e()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_e()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("deactivate_result("); + boolean first = true; + + sb.append("e:"); + if (this.e == null) { + sb.append("null"); + } else { + sb.append(this.e); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 deactivate_resultStandardSchemeFactory implements SchemeFactory { + public deactivate_resultStandardScheme getScheme() { + return new deactivate_resultStandardScheme(); + } + } + + private static class deactivate_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, deactivate_result 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: // E + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.e = new NotAliveException(); + struct.e.read(iprot); + struct.set_e_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, deactivate_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.e != null) { + oprot.writeFieldBegin(E_FIELD_DESC); + struct.e.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class deactivate_resultTupleSchemeFactory implements SchemeFactory { + public deactivate_resultTupleScheme getScheme() { + return new deactivate_resultTupleScheme(); + } + } + + private static class deactivate_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, deactivate_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.is_set_e()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.is_set_e()) { + struct.e.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, deactivate_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.e = new NotAliveException(); + struct.e.read(iprot); + struct.set_e_isSet(true); + } + } + } + + } + + public static class rebalance_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("rebalance_args"); + + private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField OPTIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("options", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new rebalance_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new rebalance_argsTupleSchemeFactory()); + } + + private String name; // required + private RebalanceOptions options; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + NAME((short)1, "name"), + OPTIONS((short)2, "options"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // NAME + return NAME; + case 2: // OPTIONS + return OPTIONS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.OPTIONS, new org.apache.thrift.meta_data.FieldMetaData("options", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RebalanceOptions.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(rebalance_args.class, metaDataMap); + } + + public rebalance_args() { + } + + public rebalance_args( + String name, + RebalanceOptions options) + { + this(); + this.name = name; + this.options = options; + } + + /** + * Performs a deep copy on other. + */ + public rebalance_args(rebalance_args other) { + if (other.is_set_name()) { + this.name = other.name; + } + if (other.is_set_options()) { + this.options = new RebalanceOptions(other.options); + } + } + + public rebalance_args deepCopy() { + return new rebalance_args(this); + } + + @Override + public void clear() { + this.name = null; + this.options = null; + } + + public String get_name() { + return this.name; + } + + public void set_name(String name) { + this.name = name; + } + + public void unset_name() { + this.name = null; + } + + /** Returns true if field name is set (has been assigned a value) and false otherwise */ + public boolean is_set_name() { + return this.name != null; + } + + public void set_name_isSet(boolean value) { + if (!value) { + this.name = null; + } + } + + public RebalanceOptions get_options() { + return this.options; + } + + public void set_options(RebalanceOptions options) { + this.options = options; + } + + public void unset_options() { + this.options = null; + } + + /** Returns true if field options is set (has been assigned a value) and false otherwise */ + public boolean is_set_options() { + return this.options != null; + } + + public void set_options_isSet(boolean value) { + if (!value) { + this.options = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case NAME: + if (value == null) { + unset_name(); + } else { + set_name((String)value); + } + break; + + case OPTIONS: + if (value == null) { + unset_options(); + } else { + set_options((RebalanceOptions)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case NAME: + return get_name(); + + case OPTIONS: + return get_options(); + + } + throw new 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(); + } + + switch (field) { + case NAME: + return is_set_name(); + case OPTIONS: + return is_set_options(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof rebalance_args) + return this.equals((rebalance_args)that); + return false; + } + + public boolean equals(rebalance_args that) { + if (that == null) + return false; + + boolean this_present_name = true && this.is_set_name(); + boolean that_present_name = true && that.is_set_name(); + if (this_present_name || that_present_name) { + if (!(this_present_name && that_present_name)) + return false; + if (!this.name.equals(that.name)) + return false; + } + + boolean this_present_options = true && this.is_set_options(); + boolean that_present_options = true && that.is_set_options(); + if (this_present_options || that_present_options) { + if (!(this_present_options && that_present_options)) + return false; + if (!this.options.equals(that.options)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_name = true && (is_set_name()); + builder.append(present_name); + if (present_name) + builder.append(name); + + boolean present_options = true && (is_set_options()); + builder.append(present_options); + if (present_options) + builder.append(options); + + return builder.toHashCode(); + } + + public int compareTo(rebalance_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + rebalance_args typedOther = (rebalance_args)other; + + lastComparison = Boolean.valueOf(is_set_name()).compareTo(typedOther.is_set_name()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_name()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_options()).compareTo(typedOther.is_set_options()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_options()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.options, typedOther.options); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("rebalance_args("); + boolean first = true; + + sb.append("name:"); + if (this.name == null) { + sb.append("null"); + } else { + sb.append(this.name); + } + first = false; + if (!first) sb.append(", "); + sb.append("options:"); + if (this.options == null) { + sb.append("null"); + } else { + sb.append(this.options); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 rebalance_argsStandardSchemeFactory implements SchemeFactory { + public rebalance_argsStandardScheme getScheme() { + return new rebalance_argsStandardScheme(); + } + } + + private static class rebalance_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, rebalance_args 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: // NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.name = iprot.readString(); + struct.set_name_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // OPTIONS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.options = new RebalanceOptions(); + struct.options.read(iprot); + struct.set_options_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, rebalance_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.name != null) { + oprot.writeFieldBegin(NAME_FIELD_DESC); + oprot.writeString(struct.name); + oprot.writeFieldEnd(); + } + if (struct.options != null) { + oprot.writeFieldBegin(OPTIONS_FIELD_DESC); + struct.options.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class rebalance_argsTupleSchemeFactory implements SchemeFactory { + public rebalance_argsTupleScheme getScheme() { + return new rebalance_argsTupleScheme(); + } + } + + private static class rebalance_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, rebalance_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.is_set_name()) { + optionals.set(0); + } + if (struct.is_set_options()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.is_set_name()) { + oprot.writeString(struct.name); + } + if (struct.is_set_options()) { + struct.options.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, rebalance_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.name = iprot.readString(); + struct.set_name_isSet(true); + } + if (incoming.get(1)) { + struct.options = new RebalanceOptions(); + struct.options.read(iprot); + struct.set_options_isSet(true); + } + } + } + + } + + public static class rebalance_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("rebalance_result"); + + private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new rebalance_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new rebalance_resultTupleSchemeFactory()); + } + + private NotAliveException e; // 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 { + E((short)1, "e"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // E + return E; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(rebalance_result.class, metaDataMap); + } + + public rebalance_result() { + } + + public rebalance_result( + NotAliveException e) + { + this(); + this.e = e; + } + + /** + * Performs a deep copy on other. + */ + public rebalance_result(rebalance_result other) { + if (other.is_set_e()) { + this.e = new NotAliveException(other.e); + } + } + + public rebalance_result deepCopy() { + return new rebalance_result(this); + } + + @Override + public void clear() { + this.e = null; + } + + public NotAliveException get_e() { + return this.e; + } + + public void set_e(NotAliveException e) { + this.e = e; + } + + public void unset_e() { + this.e = null; + } + + /** Returns true if field e is set (has been assigned a value) and false otherwise */ + public boolean is_set_e() { + return this.e != null; + } + + public void set_e_isSet(boolean value) { + if (!value) { + this.e = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case E: + if (value == null) { + unset_e(); + } else { + set_e((NotAliveException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case E: + return get_e(); + + } + throw new 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(); + } + + switch (field) { + case E: + return is_set_e(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof rebalance_result) + return this.equals((rebalance_result)that); + return false; + } + + public boolean equals(rebalance_result that) { + if (that == null) + return false; + + boolean this_present_e = true && this.is_set_e(); + boolean that_present_e = true && that.is_set_e(); + if (this_present_e || that_present_e) { + if (!(this_present_e && that_present_e)) + return false; + if (!this.e.equals(that.e)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_e = true && (is_set_e()); + builder.append(present_e); + if (present_e) + builder.append(e); + + return builder.toHashCode(); + } + + public int compareTo(rebalance_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + rebalance_result typedOther = (rebalance_result)other; + + lastComparison = Boolean.valueOf(is_set_e()).compareTo(typedOther.is_set_e()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_e()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("rebalance_result("); + boolean first = true; + + sb.append("e:"); + if (this.e == null) { + sb.append("null"); + } else { + sb.append(this.e); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 rebalance_resultStandardSchemeFactory implements SchemeFactory { + public rebalance_resultStandardScheme getScheme() { + return new rebalance_resultStandardScheme(); + } + } + + private static class rebalance_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, rebalance_result 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: // E + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.e = new NotAliveException(); + struct.e.read(iprot); + struct.set_e_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, rebalance_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.e != null) { + oprot.writeFieldBegin(E_FIELD_DESC); + struct.e.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class rebalance_resultTupleSchemeFactory implements SchemeFactory { + public rebalance_resultTupleScheme getScheme() { + return new rebalance_resultTupleScheme(); + } + } + + private static class rebalance_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, rebalance_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.is_set_e()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.is_set_e()) { + struct.e.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, rebalance_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.e = new NotAliveException(); + struct.e.read(iprot); + struct.set_e_isSet(true); + } + } + } + + } + + public static class beginFileUpload_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("beginFileUpload_args"); + + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new beginFileUpload_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new beginFileUpload_argsTupleSchemeFactory()); + } + + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { +; + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + 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); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(beginFileUpload_args.class, metaDataMap); + } + + public beginFileUpload_args() { + } + + /** + * Performs a deep copy on other. + */ + public beginFileUpload_args(beginFileUpload_args other) { + } + + public beginFileUpload_args deepCopy() { + return new beginFileUpload_args(this); + } + + @Override + public void clear() { + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + } + throw new 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(); + } + + switch (field) { + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof beginFileUpload_args) + return this.equals((beginFileUpload_args)that); + return false; + } + + public boolean equals(beginFileUpload_args that) { + if (that == null) + return false; + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + return builder.toHashCode(); + } + + public int compareTo(beginFileUpload_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + beginFileUpload_args typedOther = (beginFileUpload_args)other; + + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("beginFileUpload_args("); + boolean first = true; + + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 beginFileUpload_argsStandardSchemeFactory implements SchemeFactory { + public beginFileUpload_argsStandardScheme getScheme() { + return new beginFileUpload_argsStandardScheme(); + } + } + + private static class beginFileUpload_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, beginFileUpload_args 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) { + 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, beginFileUpload_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class beginFileUpload_argsTupleSchemeFactory implements SchemeFactory { + public beginFileUpload_argsTupleScheme getScheme() { + return new beginFileUpload_argsTupleScheme(); + } + } + + private static class beginFileUpload_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, beginFileUpload_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, beginFileUpload_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + + } + + public static class beginFileUpload_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("beginFileUpload_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new beginFileUpload_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new beginFileUpload_resultTupleSchemeFactory()); + } + + private String success; // 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 { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(beginFileUpload_result.class, metaDataMap); + } + + public beginFileUpload_result() { + } + + public beginFileUpload_result( + String success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public beginFileUpload_result(beginFileUpload_result other) { + if (other.is_set_success()) { + this.success = other.success; + } + } + + public beginFileUpload_result deepCopy() { + return new beginFileUpload_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public String get_success() { + return this.success; + } + + public void set_success(String success) { + this.success = success; + } + + public void unset_success() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean is_set_success() { + return this.success != null; + } + + public void set_success_isSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unset_success(); + } else { + set_success((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return get_success(); + + } + throw new 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(); + } + + switch (field) { + case SUCCESS: + return is_set_success(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof beginFileUpload_result) + return this.equals((beginFileUpload_result)that); + return false; + } + + public boolean equals(beginFileUpload_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.is_set_success(); + boolean that_present_success = true && that.is_set_success(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_success = true && (is_set_success()); + builder.append(present_success); + if (present_success) + builder.append(success); + + return builder.toHashCode(); + } + + public int compareTo(beginFileUpload_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + beginFileUpload_result typedOther = (beginFileUpload_result)other; + + lastComparison = Boolean.valueOf(is_set_success()).compareTo(typedOther.is_set_success()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_success()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("beginFileUpload_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 beginFileUpload_resultStandardSchemeFactory implements SchemeFactory { + public beginFileUpload_resultStandardScheme getScheme() { + return new beginFileUpload_resultStandardScheme(); + } + } + + private static class beginFileUpload_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, beginFileUpload_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.success = iprot.readString(); + struct.set_success_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, beginFileUpload_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeString(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class beginFileUpload_resultTupleSchemeFactory implements SchemeFactory { + public beginFileUpload_resultTupleScheme getScheme() { + return new beginFileUpload_resultTupleScheme(); + } + } + + private static class beginFileUpload_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, beginFileUpload_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.is_set_success()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.is_set_success()) { + oprot.writeString(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, beginFileUpload_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readString(); + struct.set_success_isSet(true); + } + } + } + + } + + public static class uploadChunk_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("uploadChunk_args"); + + private static final org.apache.thrift.protocol.TField LOCATION_FIELD_DESC = new org.apache.thrift.protocol.TField("location", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField CHUNK_FIELD_DESC = new org.apache.thrift.protocol.TField("chunk", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new uploadChunk_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new uploadChunk_argsTupleSchemeFactory()); + } + + private String location; // required + private ByteBuffer chunk; // 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 { + LOCATION((short)1, "location"), + CHUNK((short)2, "chunk"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // LOCATION + return LOCATION; + case 2: // CHUNK + return CHUNK; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.LOCATION, new org.apache.thrift.meta_data.FieldMetaData("location", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.CHUNK, new org.apache.thrift.meta_data.FieldMetaData("chunk", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(uploadChunk_args.class, metaDataMap); + } + + public uploadChunk_args() { + } + + public uploadChunk_args( + String location, + ByteBuffer chunk) + { + this(); + this.location = location; + this.chunk = chunk; + } + + /** + * Performs a deep copy on other. + */ + public uploadChunk_args(uploadChunk_args other) { + if (other.is_set_location()) { + this.location = other.location; + } + if (other.is_set_chunk()) { + this.chunk = org.apache.thrift.TBaseHelper.copyBinary(other.chunk); +; + } + } + + public uploadChunk_args deepCopy() { + return new uploadChunk_args(this); + } + + @Override + public void clear() { + this.location = null; + this.chunk = null; + } + + public String get_location() { + return this.location; + } + + public void set_location(String location) { + this.location = location; + } + + public void unset_location() { + this.location = null; + } + + /** Returns true if field location is set (has been assigned a value) and false otherwise */ + public boolean is_set_location() { + return this.location != null; + } + + public void set_location_isSet(boolean value) { + if (!value) { + this.location = null; + } + } + + public byte[] get_chunk() { + set_chunk(org.apache.thrift.TBaseHelper.rightSize(chunk)); + return chunk == null ? null : chunk.array(); + } + + public ByteBuffer buffer_for_chunk() { + return chunk; + } + + public void set_chunk(byte[] chunk) { + set_chunk(chunk == null ? (ByteBuffer)null : ByteBuffer.wrap(chunk)); + } + + public void set_chunk(ByteBuffer chunk) { + this.chunk = chunk; + } + + public void unset_chunk() { + this.chunk = null; + } + + /** Returns true if field chunk is set (has been assigned a value) and false otherwise */ + public boolean is_set_chunk() { + return this.chunk != null; + } + + public void set_chunk_isSet(boolean value) { + if (!value) { + this.chunk = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case LOCATION: + if (value == null) { + unset_location(); + } else { + set_location((String)value); + } + break; + + case CHUNK: + if (value == null) { + unset_chunk(); + } else { + set_chunk((ByteBuffer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case LOCATION: + return get_location(); + + case CHUNK: + return get_chunk(); + + } + throw new 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(); + } + + switch (field) { + case LOCATION: + return is_set_location(); + case CHUNK: + return is_set_chunk(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof uploadChunk_args) + return this.equals((uploadChunk_args)that); + return false; + } + + public boolean equals(uploadChunk_args that) { + if (that == null) + return false; + + boolean this_present_location = true && this.is_set_location(); + boolean that_present_location = true && that.is_set_location(); + if (this_present_location || that_present_location) { + if (!(this_present_location && that_present_location)) + return false; + if (!this.location.equals(that.location)) + return false; + } + + boolean this_present_chunk = true && this.is_set_chunk(); + boolean that_present_chunk = true && that.is_set_chunk(); + if (this_present_chunk || that_present_chunk) { + if (!(this_present_chunk && that_present_chunk)) + return false; + if (!this.chunk.equals(that.chunk)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_location = true && (is_set_location()); + builder.append(present_location); + if (present_location) + builder.append(location); + + boolean present_chunk = true && (is_set_chunk()); + builder.append(present_chunk); + if (present_chunk) + builder.append(chunk); + + return builder.toHashCode(); + } + + public int compareTo(uploadChunk_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + uploadChunk_args typedOther = (uploadChunk_args)other; + + lastComparison = Boolean.valueOf(is_set_location()).compareTo(typedOther.is_set_location()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_location()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.location, typedOther.location); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_chunk()).compareTo(typedOther.is_set_chunk()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_chunk()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.chunk, typedOther.chunk); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("uploadChunk_args("); + boolean first = true; + + sb.append("location:"); + if (this.location == null) { + sb.append("null"); + } else { + sb.append(this.location); + } + first = false; + if (!first) sb.append(", "); + sb.append("chunk:"); + if (this.chunk == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.chunk, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 uploadChunk_argsStandardSchemeFactory implements SchemeFactory { + public uploadChunk_argsStandardScheme getScheme() { + return new uploadChunk_argsStandardScheme(); + } + } + + private static class uploadChunk_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, uploadChunk_args 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: // LOCATION + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.location = iprot.readString(); + struct.set_location_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // CHUNK + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.chunk = iprot.readBinary(); + struct.set_chunk_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, uploadChunk_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.location != null) { + oprot.writeFieldBegin(LOCATION_FIELD_DESC); + oprot.writeString(struct.location); + oprot.writeFieldEnd(); + } + if (struct.chunk != null) { + oprot.writeFieldBegin(CHUNK_FIELD_DESC); + oprot.writeBinary(struct.chunk); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class uploadChunk_argsTupleSchemeFactory implements SchemeFactory { + public uploadChunk_argsTupleScheme getScheme() { + return new uploadChunk_argsTupleScheme(); + } + } + + private static class uploadChunk_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, uploadChunk_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.is_set_location()) { + optionals.set(0); + } + if (struct.is_set_chunk()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.is_set_location()) { + oprot.writeString(struct.location); + } + if (struct.is_set_chunk()) { + oprot.writeBinary(struct.chunk); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, uploadChunk_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.location = iprot.readString(); + struct.set_location_isSet(true); + } + if (incoming.get(1)) { + struct.chunk = iprot.readBinary(); + struct.set_chunk_isSet(true); + } + } + } + + } + + public static class uploadChunk_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("uploadChunk_result"); + + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new uploadChunk_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new uploadChunk_resultTupleSchemeFactory()); + } + + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { +; + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + 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); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(uploadChunk_result.class, metaDataMap); + } + + public uploadChunk_result() { + } + + /** + * Performs a deep copy on other. + */ + public uploadChunk_result(uploadChunk_result other) { + } + + public uploadChunk_result deepCopy() { + return new uploadChunk_result(this); + } + + @Override + public void clear() { + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + } + throw new 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(); + } + + switch (field) { + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof uploadChunk_result) + return this.equals((uploadChunk_result)that); + return false; + } + + public boolean equals(uploadChunk_result that) { + if (that == null) + return false; + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + return builder.toHashCode(); + } + + public int compareTo(uploadChunk_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + uploadChunk_result typedOther = (uploadChunk_result)other; + + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("uploadChunk_result("); + boolean first = true; + + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 uploadChunk_resultStandardSchemeFactory implements SchemeFactory { + public uploadChunk_resultStandardScheme getScheme() { + return new uploadChunk_resultStandardScheme(); + } + } + + private static class uploadChunk_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, uploadChunk_result 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) { + 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, uploadChunk_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class uploadChunk_resultTupleSchemeFactory implements SchemeFactory { + public uploadChunk_resultTupleScheme getScheme() { + return new uploadChunk_resultTupleScheme(); + } + } + + private static class uploadChunk_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, uploadChunk_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, uploadChunk_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + + } + + public static class finishFileUpload_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("finishFileUpload_args"); + + private static final org.apache.thrift.protocol.TField LOCATION_FIELD_DESC = new org.apache.thrift.protocol.TField("location", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new finishFileUpload_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new finishFileUpload_argsTupleSchemeFactory()); + } + + private String location; // 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 { + LOCATION((short)1, "location"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // LOCATION + return LOCATION; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.LOCATION, new org.apache.thrift.meta_data.FieldMetaData("location", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(finishFileUpload_args.class, metaDataMap); + } + + public finishFileUpload_args() { + } + + public finishFileUpload_args( + String location) + { + this(); + this.location = location; + } + + /** + * Performs a deep copy on other. + */ + public finishFileUpload_args(finishFileUpload_args other) { + if (other.is_set_location()) { + this.location = other.location; + } + } + + public finishFileUpload_args deepCopy() { + return new finishFileUpload_args(this); + } + + @Override + public void clear() { + this.location = null; + } + + public String get_location() { + return this.location; + } + + public void set_location(String location) { + this.location = location; + } + + public void unset_location() { + this.location = null; + } + + /** Returns true if field location is set (has been assigned a value) and false otherwise */ + public boolean is_set_location() { + return this.location != null; + } + + public void set_location_isSet(boolean value) { + if (!value) { + this.location = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case LOCATION: + if (value == null) { + unset_location(); + } else { + set_location((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case LOCATION: + return get_location(); + + } + throw new 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(); + } + + switch (field) { + case LOCATION: + return is_set_location(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof finishFileUpload_args) + return this.equals((finishFileUpload_args)that); + return false; + } + + public boolean equals(finishFileUpload_args that) { + if (that == null) + return false; + + boolean this_present_location = true && this.is_set_location(); + boolean that_present_location = true && that.is_set_location(); + if (this_present_location || that_present_location) { + if (!(this_present_location && that_present_location)) + return false; + if (!this.location.equals(that.location)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_location = true && (is_set_location()); + builder.append(present_location); + if (present_location) + builder.append(location); + + return builder.toHashCode(); + } + + public int compareTo(finishFileUpload_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + finishFileUpload_args typedOther = (finishFileUpload_args)other; + + lastComparison = Boolean.valueOf(is_set_location()).compareTo(typedOther.is_set_location()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_location()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.location, typedOther.location); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("finishFileUpload_args("); + boolean first = true; + + sb.append("location:"); + if (this.location == null) { + sb.append("null"); + } else { + sb.append(this.location); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 finishFileUpload_argsStandardSchemeFactory implements SchemeFactory { + public finishFileUpload_argsStandardScheme getScheme() { + return new finishFileUpload_argsStandardScheme(); + } + } + + private static class finishFileUpload_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, finishFileUpload_args 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: // LOCATION + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.location = iprot.readString(); + struct.set_location_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, finishFileUpload_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.location != null) { + oprot.writeFieldBegin(LOCATION_FIELD_DESC); + oprot.writeString(struct.location); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class finishFileUpload_argsTupleSchemeFactory implements SchemeFactory { + public finishFileUpload_argsTupleScheme getScheme() { + return new finishFileUpload_argsTupleScheme(); + } + } + + private static class finishFileUpload_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, finishFileUpload_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.is_set_location()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.is_set_location()) { + oprot.writeString(struct.location); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, finishFileUpload_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.location = iprot.readString(); + struct.set_location_isSet(true); + } + } + } + + } + + public static class finishFileUpload_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("finishFileUpload_result"); + + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new finishFileUpload_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new finishFileUpload_resultTupleSchemeFactory()); + } + + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { +; + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + 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); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(finishFileUpload_result.class, metaDataMap); + } + + public finishFileUpload_result() { + } + + /** + * Performs a deep copy on other. + */ + public finishFileUpload_result(finishFileUpload_result other) { + } + + public finishFileUpload_result deepCopy() { + return new finishFileUpload_result(this); + } + + @Override + public void clear() { + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + } + throw new 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(); + } + + switch (field) { + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof finishFileUpload_result) + return this.equals((finishFileUpload_result)that); + return false; + } + + public boolean equals(finishFileUpload_result that) { + if (that == null) + return false; + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + return builder.toHashCode(); + } + + public int compareTo(finishFileUpload_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + finishFileUpload_result typedOther = (finishFileUpload_result)other; + + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("finishFileUpload_result("); + boolean first = true; + + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 finishFileUpload_resultStandardSchemeFactory implements SchemeFactory { + public finishFileUpload_resultStandardScheme getScheme() { + return new finishFileUpload_resultStandardScheme(); + } + } + + private static class finishFileUpload_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, finishFileUpload_result 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) { + 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, finishFileUpload_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class finishFileUpload_resultTupleSchemeFactory implements SchemeFactory { + public finishFileUpload_resultTupleScheme getScheme() { + return new finishFileUpload_resultTupleScheme(); + } + } + + private static class finishFileUpload_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, finishFileUpload_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, finishFileUpload_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + + } + + public static class beginFileDownload_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("beginFileDownload_args"); + + private static final org.apache.thrift.protocol.TField FILE_FIELD_DESC = new org.apache.thrift.protocol.TField("file", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new beginFileDownload_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new beginFileDownload_argsTupleSchemeFactory()); + } + + private String file; // 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 { + FILE((short)1, "file"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // FILE + return FILE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.FILE, new org.apache.thrift.meta_data.FieldMetaData("file", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(beginFileDownload_args.class, metaDataMap); + } + + public beginFileDownload_args() { + } + + public beginFileDownload_args( + String file) + { + this(); + this.file = file; + } + + /** + * Performs a deep copy on other. + */ + public beginFileDownload_args(beginFileDownload_args other) { + if (other.is_set_file()) { + this.file = other.file; + } + } + + public beginFileDownload_args deepCopy() { + return new beginFileDownload_args(this); + } + + @Override + public void clear() { + this.file = null; + } + + public String get_file() { + return this.file; + } + + public void set_file(String file) { + this.file = file; + } + + public void unset_file() { + this.file = null; + } + + /** Returns true if field file is set (has been assigned a value) and false otherwise */ + public boolean is_set_file() { + return this.file != null; + } + + public void set_file_isSet(boolean value) { + if (!value) { + this.file = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case FILE: + if (value == null) { + unset_file(); + } else { + set_file((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case FILE: + return get_file(); + + } + throw new 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(); + } + + switch (field) { + case FILE: + return is_set_file(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof beginFileDownload_args) + return this.equals((beginFileDownload_args)that); + return false; + } + + public boolean equals(beginFileDownload_args that) { + if (that == null) + return false; + + boolean this_present_file = true && this.is_set_file(); + boolean that_present_file = true && that.is_set_file(); + if (this_present_file || that_present_file) { + if (!(this_present_file && that_present_file)) + return false; + if (!this.file.equals(that.file)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_file = true && (is_set_file()); + builder.append(present_file); + if (present_file) + builder.append(file); + + return builder.toHashCode(); + } + + public int compareTo(beginFileDownload_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + beginFileDownload_args typedOther = (beginFileDownload_args)other; + + lastComparison = Boolean.valueOf(is_set_file()).compareTo(typedOther.is_set_file()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_file()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.file, typedOther.file); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("beginFileDownload_args("); + boolean first = true; + + sb.append("file:"); + if (this.file == null) { + sb.append("null"); + } else { + sb.append(this.file); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 beginFileDownload_argsStandardSchemeFactory implements SchemeFactory { + public beginFileDownload_argsStandardScheme getScheme() { + return new beginFileDownload_argsStandardScheme(); + } + } + + private static class beginFileDownload_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, beginFileDownload_args 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: // FILE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.file = iprot.readString(); + struct.set_file_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, beginFileDownload_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.file != null) { + oprot.writeFieldBegin(FILE_FIELD_DESC); + oprot.writeString(struct.file); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class beginFileDownload_argsTupleSchemeFactory implements SchemeFactory { + public beginFileDownload_argsTupleScheme getScheme() { + return new beginFileDownload_argsTupleScheme(); + } + } + + private static class beginFileDownload_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, beginFileDownload_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.is_set_file()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.is_set_file()) { + oprot.writeString(struct.file); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, beginFileDownload_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.file = iprot.readString(); + struct.set_file_isSet(true); + } + } + } + + } + + public static class beginFileDownload_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("beginFileDownload_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new beginFileDownload_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new beginFileDownload_resultTupleSchemeFactory()); + } + + private String success; // 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 { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(beginFileDownload_result.class, metaDataMap); + } + + public beginFileDownload_result() { + } + + public beginFileDownload_result( + String success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public beginFileDownload_result(beginFileDownload_result other) { + if (other.is_set_success()) { + this.success = other.success; + } + } + + public beginFileDownload_result deepCopy() { + return new beginFileDownload_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public String get_success() { + return this.success; + } + + public void set_success(String success) { + this.success = success; + } + + public void unset_success() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean is_set_success() { + return this.success != null; + } + + public void set_success_isSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unset_success(); + } else { + set_success((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return get_success(); + + } + throw new 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(); + } + + switch (field) { + case SUCCESS: + return is_set_success(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof beginFileDownload_result) + return this.equals((beginFileDownload_result)that); + return false; + } + + public boolean equals(beginFileDownload_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.is_set_success(); + boolean that_present_success = true && that.is_set_success(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_success = true && (is_set_success()); + builder.append(present_success); + if (present_success) + builder.append(success); + + return builder.toHashCode(); + } + + public int compareTo(beginFileDownload_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + beginFileDownload_result typedOther = (beginFileDownload_result)other; + + lastComparison = Boolean.valueOf(is_set_success()).compareTo(typedOther.is_set_success()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_success()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("beginFileDownload_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 beginFileDownload_resultStandardSchemeFactory implements SchemeFactory { + public beginFileDownload_resultStandardScheme getScheme() { + return new beginFileDownload_resultStandardScheme(); + } + } + + private static class beginFileDownload_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, beginFileDownload_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.success = iprot.readString(); + struct.set_success_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, beginFileDownload_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeString(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class beginFileDownload_resultTupleSchemeFactory implements SchemeFactory { + public beginFileDownload_resultTupleScheme getScheme() { + return new beginFileDownload_resultTupleScheme(); + } + } + + private static class beginFileDownload_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, beginFileDownload_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.is_set_success()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.is_set_success()) { + oprot.writeString(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, beginFileDownload_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readString(); + struct.set_success_isSet(true); + } + } + } + + } + + public static class downloadChunk_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("downloadChunk_args"); + + private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new downloadChunk_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new downloadChunk_argsTupleSchemeFactory()); + } + + private String 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 { + ID((short)1, "id"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // ID + return ID; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(downloadChunk_args.class, metaDataMap); + } + + public downloadChunk_args() { + } + + public downloadChunk_args( + String id) + { + this(); + this.id = id; + } + + /** + * Performs a deep copy on other. + */ + public downloadChunk_args(downloadChunk_args other) { + if (other.is_set_id()) { + this.id = other.id; + } + } + + public downloadChunk_args deepCopy() { + return new downloadChunk_args(this); + } + + @Override + public void clear() { + this.id = null; + } + + public String get_id() { + return this.id; + } + + public void set_id(String id) { + this.id = id; + } + + public void unset_id() { + this.id = null; + } + + /** Returns true if field id is set (has been assigned a value) and false otherwise */ + public boolean is_set_id() { + return this.id != null; + } + + public void set_id_isSet(boolean value) { + if (!value) { + this.id = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case ID: + if (value == null) { + unset_id(); + } else { + set_id((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case ID: + return get_id(); + + } + throw new 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(); + } + + switch (field) { + case ID: + return is_set_id(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof downloadChunk_args) + return this.equals((downloadChunk_args)that); + return false; + } + + public boolean equals(downloadChunk_args that) { + if (that == null) + return false; + + boolean this_present_id = true && this.is_set_id(); + boolean that_present_id = true && that.is_set_id(); + if (this_present_id || that_present_id) { + if (!(this_present_id && that_present_id)) + return false; + if (!this.id.equals(that.id)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_id = true && (is_set_id()); + builder.append(present_id); + if (present_id) + builder.append(id); + + return builder.toHashCode(); + } + + public int compareTo(downloadChunk_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + downloadChunk_args typedOther = (downloadChunk_args)other; + + lastComparison = Boolean.valueOf(is_set_id()).compareTo(typedOther.is_set_id()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_id()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("downloadChunk_args("); + boolean first = true; + + sb.append("id:"); + if (this.id == null) { + sb.append("null"); + } else { + sb.append(this.id); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 downloadChunk_argsStandardSchemeFactory implements SchemeFactory { + public downloadChunk_argsStandardScheme getScheme() { + return new downloadChunk_argsStandardScheme(); + } + } + + private static class downloadChunk_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, downloadChunk_args 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: // ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.id = iprot.readString(); + struct.set_id_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, downloadChunk_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.id != null) { + oprot.writeFieldBegin(ID_FIELD_DESC); + oprot.writeString(struct.id); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class downloadChunk_argsTupleSchemeFactory implements SchemeFactory { + public downloadChunk_argsTupleScheme getScheme() { + return new downloadChunk_argsTupleScheme(); + } + } + + private static class downloadChunk_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, downloadChunk_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.is_set_id()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.is_set_id()) { + oprot.writeString(struct.id); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, downloadChunk_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.id = iprot.readString(); + struct.set_id_isSet(true); + } + } + } + + } + + public static class downloadChunk_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("downloadChunk_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new downloadChunk_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new downloadChunk_resultTupleSchemeFactory()); + } + + private ByteBuffer success; // 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 { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(downloadChunk_result.class, metaDataMap); + } + + public downloadChunk_result() { + } + + public downloadChunk_result( + ByteBuffer success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public downloadChunk_result(downloadChunk_result other) { + if (other.is_set_success()) { + this.success = org.apache.thrift.TBaseHelper.copyBinary(other.success); +; + } + } + + public downloadChunk_result deepCopy() { + return new downloadChunk_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public byte[] get_success() { + set_success(org.apache.thrift.TBaseHelper.rightSize(success)); + return success == null ? null : success.array(); + } + + public ByteBuffer buffer_for_success() { + return success; + } + + public void set_success(byte[] success) { + set_success(success == null ? (ByteBuffer)null : ByteBuffer.wrap(success)); + } + + public void set_success(ByteBuffer success) { + this.success = success; + } + + public void unset_success() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean is_set_success() { + return this.success != null; + } + + public void set_success_isSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unset_success(); + } else { + set_success((ByteBuffer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return get_success(); + + } + throw new 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(); + } + + switch (field) { + case SUCCESS: + return is_set_success(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof downloadChunk_result) + return this.equals((downloadChunk_result)that); + return false; + } + + public boolean equals(downloadChunk_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.is_set_success(); + boolean that_present_success = true && that.is_set_success(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_success = true && (is_set_success()); + builder.append(present_success); + if (present_success) + builder.append(success); + + return builder.toHashCode(); + } + + public int compareTo(downloadChunk_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + downloadChunk_result typedOther = (downloadChunk_result)other; + + lastComparison = Boolean.valueOf(is_set_success()).compareTo(typedOther.is_set_success()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_success()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("downloadChunk_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.success, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 downloadChunk_resultStandardSchemeFactory implements SchemeFactory { + public downloadChunk_resultStandardScheme getScheme() { + return new downloadChunk_resultStandardScheme(); + } + } + + private static class downloadChunk_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, downloadChunk_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.success = iprot.readBinary(); + struct.set_success_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, downloadChunk_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBinary(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class downloadChunk_resultTupleSchemeFactory implements SchemeFactory { + public downloadChunk_resultTupleScheme getScheme() { + return new downloadChunk_resultTupleScheme(); + } + } + + private static class downloadChunk_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, downloadChunk_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.is_set_success()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.is_set_success()) { + oprot.writeBinary(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, downloadChunk_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readBinary(); + struct.set_success_isSet(true); + } + } + } + + } + + public static class getClusterInfo_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getClusterInfo_args"); + + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getClusterInfo_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getClusterInfo_argsTupleSchemeFactory()); + } + + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { +; + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + 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); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getClusterInfo_args.class, metaDataMap); + } + + public getClusterInfo_args() { + } + + /** + * Performs a deep copy on other. + */ + public getClusterInfo_args(getClusterInfo_args other) { + } + + public getClusterInfo_args deepCopy() { + return new getClusterInfo_args(this); + } + + @Override + public void clear() { + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + } + throw new 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(); + } + + switch (field) { + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getClusterInfo_args) + return this.equals((getClusterInfo_args)that); + return false; + } + + public boolean equals(getClusterInfo_args that) { + if (that == null) + return false; + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + return builder.toHashCode(); + } + + public int compareTo(getClusterInfo_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + getClusterInfo_args typedOther = (getClusterInfo_args)other; + + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getClusterInfo_args("); + boolean first = true; + + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 getClusterInfo_argsStandardSchemeFactory implements SchemeFactory { + public getClusterInfo_argsStandardScheme getScheme() { + return new getClusterInfo_argsStandardScheme(); + } + } + + private static class getClusterInfo_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getClusterInfo_args 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) { + 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, getClusterInfo_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getClusterInfo_argsTupleSchemeFactory implements SchemeFactory { + public getClusterInfo_argsTupleScheme getScheme() { + return new getClusterInfo_argsTupleScheme(); + } + } + + private static class getClusterInfo_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getClusterInfo_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getClusterInfo_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + + } + + public static class getClusterInfo_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getClusterInfo_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getClusterInfo_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getClusterInfo_resultTupleSchemeFactory()); + } + + private ClusterSummary success; // 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 { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ClusterSummary.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getClusterInfo_result.class, metaDataMap); + } + + public getClusterInfo_result() { + } + + public getClusterInfo_result( + ClusterSummary success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public getClusterInfo_result(getClusterInfo_result other) { + if (other.is_set_success()) { + this.success = new ClusterSummary(other.success); + } + } + + public getClusterInfo_result deepCopy() { + return new getClusterInfo_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public ClusterSummary get_success() { + return this.success; + } + + public void set_success(ClusterSummary success) { + this.success = success; + } + + public void unset_success() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean is_set_success() { + return this.success != null; + } + + public void set_success_isSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unset_success(); + } else { + set_success((ClusterSummary)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return get_success(); + + } + throw new 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(); + } + + switch (field) { + case SUCCESS: + return is_set_success(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getClusterInfo_result) + return this.equals((getClusterInfo_result)that); + return false; + } + + public boolean equals(getClusterInfo_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.is_set_success(); + boolean that_present_success = true && that.is_set_success(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_success = true && (is_set_success()); + builder.append(present_success); + if (present_success) + builder.append(success); + + return builder.toHashCode(); + } + + public int compareTo(getClusterInfo_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + getClusterInfo_result typedOther = (getClusterInfo_result)other; + + lastComparison = Boolean.valueOf(is_set_success()).compareTo(typedOther.is_set_success()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_success()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getClusterInfo_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 getClusterInfo_resultStandardSchemeFactory implements SchemeFactory { + public getClusterInfo_resultStandardScheme getScheme() { + return new getClusterInfo_resultStandardScheme(); + } + } + + private static class getClusterInfo_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getClusterInfo_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new ClusterSummary(); + struct.success.read(iprot); + struct.set_success_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, getClusterInfo_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getClusterInfo_resultTupleSchemeFactory implements SchemeFactory { + public getClusterInfo_resultTupleScheme getScheme() { + return new getClusterInfo_resultTupleScheme(); + } + } + + private static class getClusterInfo_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getClusterInfo_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.is_set_success()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.is_set_success()) { + struct.success.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getClusterInfo_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new ClusterSummary(); + struct.success.read(iprot); + struct.set_success_isSet(true); + } + } + } + + } + + public static class getTopologyInfo_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getTopologyInfo_args"); + + private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getTopologyInfo_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getTopologyInfo_argsTupleSchemeFactory()); + } + + private String 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 { + ID((short)1, "id"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // ID + return ID; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getTopologyInfo_args.class, metaDataMap); + } + + public getTopologyInfo_args() { + } + + public getTopologyInfo_args( + String id) + { + this(); + this.id = id; + } + + /** + * Performs a deep copy on other. + */ + public getTopologyInfo_args(getTopologyInfo_args other) { + if (other.is_set_id()) { + this.id = other.id; + } + } + + public getTopologyInfo_args deepCopy() { + return new getTopologyInfo_args(this); + } + + @Override + public void clear() { + this.id = null; + } + + public String get_id() { + return this.id; + } + + public void set_id(String id) { + this.id = id; + } + + public void unset_id() { + this.id = null; + } + + /** Returns true if field id is set (has been assigned a value) and false otherwise */ + public boolean is_set_id() { + return this.id != null; + } + + public void set_id_isSet(boolean value) { + if (!value) { + this.id = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case ID: + if (value == null) { + unset_id(); + } else { + set_id((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case ID: + return get_id(); + + } + throw new 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(); + } + + switch (field) { + case ID: + return is_set_id(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getTopologyInfo_args) + return this.equals((getTopologyInfo_args)that); + return false; + } + + public boolean equals(getTopologyInfo_args that) { + if (that == null) + return false; + + boolean this_present_id = true && this.is_set_id(); + boolean that_present_id = true && that.is_set_id(); + if (this_present_id || that_present_id) { + if (!(this_present_id && that_present_id)) + return false; + if (!this.id.equals(that.id)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_id = true && (is_set_id()); + builder.append(present_id); + if (present_id) + builder.append(id); + + return builder.toHashCode(); + } + + public int compareTo(getTopologyInfo_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + getTopologyInfo_args typedOther = (getTopologyInfo_args)other; + + lastComparison = Boolean.valueOf(is_set_id()).compareTo(typedOther.is_set_id()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_id()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getTopologyInfo_args("); + boolean first = true; + + sb.append("id:"); + if (this.id == null) { + sb.append("null"); + } else { + sb.append(this.id); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 getTopologyInfo_argsStandardSchemeFactory implements SchemeFactory { + public getTopologyInfo_argsStandardScheme getScheme() { + return new getTopologyInfo_argsStandardScheme(); + } + } + + private static class getTopologyInfo_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getTopologyInfo_args 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: // ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.id = iprot.readString(); + struct.set_id_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, getTopologyInfo_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.id != null) { + oprot.writeFieldBegin(ID_FIELD_DESC); + oprot.writeString(struct.id); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getTopologyInfo_argsTupleSchemeFactory implements SchemeFactory { + public getTopologyInfo_argsTupleScheme getScheme() { + return new getTopologyInfo_argsTupleScheme(); + } + } + + private static class getTopologyInfo_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getTopologyInfo_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.is_set_id()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.is_set_id()) { + oprot.writeString(struct.id); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getTopologyInfo_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.id = iprot.readString(); + struct.set_id_isSet(true); + } + } + } + + } + + public static class getTopologyInfo_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getTopologyInfo_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); + private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getTopologyInfo_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getTopologyInfo_resultTupleSchemeFactory()); + } + + private TopologyInfo success; // required + private NotAliveException e; // 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 { + SUCCESS((short)0, "success"), + E((short)1, "e"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + case 1: // E + return E; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TopologyInfo.class))); + tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getTopologyInfo_result.class, metaDataMap); + } + + public getTopologyInfo_result() { + } + + public getTopologyInfo_result( + TopologyInfo success, + NotAliveException e) + { + this(); + this.success = success; + this.e = e; + } + + /** + * Performs a deep copy on other. + */ + public getTopologyInfo_result(getTopologyInfo_result other) { + if (other.is_set_success()) { + this.success = new TopologyInfo(other.success); + } + if (other.is_set_e()) { + this.e = new NotAliveException(other.e); + } + } + + public getTopologyInfo_result deepCopy() { + return new getTopologyInfo_result(this); + } + + @Override + public void clear() { + this.success = null; + this.e = null; + } + + public TopologyInfo get_success() { + return this.success; + } + + public void set_success(TopologyInfo success) { + this.success = success; + } + + public void unset_success() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean is_set_success() { + return this.success != null; + } + + public void set_success_isSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public NotAliveException get_e() { + return this.e; + } + + public void set_e(NotAliveException e) { + this.e = e; + } + + public void unset_e() { + this.e = null; + } + + /** Returns true if field e is set (has been assigned a value) and false otherwise */ + public boolean is_set_e() { + return this.e != null; + } + + public void set_e_isSet(boolean value) { + if (!value) { + this.e = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unset_success(); + } else { + set_success((TopologyInfo)value); + } + break; + + case E: + if (value == null) { + unset_e(); + } else { + set_e((NotAliveException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return get_success(); + + case E: + return get_e(); + + } + throw new 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(); + } + + switch (field) { + case SUCCESS: + return is_set_success(); + case E: + return is_set_e(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getTopologyInfo_result) + return this.equals((getTopologyInfo_result)that); + return false; + } + + public boolean equals(getTopologyInfo_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.is_set_success(); + boolean that_present_success = true && that.is_set_success(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_e = true && this.is_set_e(); + boolean that_present_e = true && that.is_set_e(); + if (this_present_e || that_present_e) { + if (!(this_present_e && that_present_e)) + return false; + if (!this.e.equals(that.e)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_success = true && (is_set_success()); + builder.append(present_success); + if (present_success) + builder.append(success); + + boolean present_e = true && (is_set_e()); + builder.append(present_e); + if (present_e) + builder.append(e); + + return builder.toHashCode(); + } + + public int compareTo(getTopologyInfo_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + getTopologyInfo_result typedOther = (getTopologyInfo_result)other; + + lastComparison = Boolean.valueOf(is_set_success()).compareTo(typedOther.is_set_success()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_success()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_e()).compareTo(typedOther.is_set_e()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_e()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getTopologyInfo_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("e:"); + if (this.e == null) { + sb.append("null"); + } else { + sb.append(this.e); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 getTopologyInfo_resultStandardSchemeFactory implements SchemeFactory { + public getTopologyInfo_resultStandardScheme getScheme() { + return new getTopologyInfo_resultStandardScheme(); + } + } + + private static class getTopologyInfo_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getTopologyInfo_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new TopologyInfo(); + struct.success.read(iprot); + struct.set_success_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // E + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.e = new NotAliveException(); + struct.e.read(iprot); + struct.set_e_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, getTopologyInfo_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.e != null) { + oprot.writeFieldBegin(E_FIELD_DESC); + struct.e.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getTopologyInfo_resultTupleSchemeFactory implements SchemeFactory { + public getTopologyInfo_resultTupleScheme getScheme() { + return new getTopologyInfo_resultTupleScheme(); + } + } + + private static class getTopologyInfo_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getTopologyInfo_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.is_set_success()) { + optionals.set(0); + } + if (struct.is_set_e()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.is_set_success()) { + struct.success.write(oprot); + } + if (struct.is_set_e()) { + struct.e.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getTopologyInfo_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = new TopologyInfo(); + struct.success.read(iprot); + struct.set_success_isSet(true); + } + if (incoming.get(1)) { + struct.e = new NotAliveException(); + struct.e.read(iprot); + struct.set_e_isSet(true); + } + } + } + + } + + public static class getSupervisorWorkers_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSupervisorWorkers_args"); + + private static final org.apache.thrift.protocol.TField HOST_FIELD_DESC = new org.apache.thrift.protocol.TField("host", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getSupervisorWorkers_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getSupervisorWorkers_argsTupleSchemeFactory()); + } + + private String host; // 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 { + HOST((short)1, "host"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // HOST + return HOST; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.HOST, new org.apache.thrift.meta_data.FieldMetaData("host", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSupervisorWorkers_args.class, metaDataMap); + } + + public getSupervisorWorkers_args() { + } + + public getSupervisorWorkers_args( + String host) + { + this(); + this.host = host; + } + + /** + * Performs a deep copy on other. + */ + public getSupervisorWorkers_args(getSupervisorWorkers_args other) { + if (other.is_set_host()) { + this.host = other.host; + } + } + + public getSupervisorWorkers_args deepCopy() { + return new getSupervisorWorkers_args(this); + } + + @Override + public void clear() { + this.host = null; + } + + public String get_host() { + return this.host; + } + + public void set_host(String host) { + this.host = host; + } + + public void unset_host() { + this.host = null; + } + + /** Returns true if field host is set (has been assigned a value) and false otherwise */ + public boolean is_set_host() { + return this.host != null; + } + + public void set_host_isSet(boolean value) { + if (!value) { + this.host = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case HOST: + if (value == null) { + unset_host(); + } else { + set_host((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case HOST: + return get_host(); + + } + throw new 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(); + } + + switch (field) { + case HOST: + return is_set_host(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getSupervisorWorkers_args) + return this.equals((getSupervisorWorkers_args)that); + return false; + } + + public boolean equals(getSupervisorWorkers_args that) { + if (that == null) + return false; + + boolean this_present_host = true && this.is_set_host(); + boolean that_present_host = true && that.is_set_host(); + if (this_present_host || that_present_host) { + if (!(this_present_host && that_present_host)) + return false; + if (!this.host.equals(that.host)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_host = true && (is_set_host()); + builder.append(present_host); + if (present_host) + builder.append(host); + + return builder.toHashCode(); + } + + public int compareTo(getSupervisorWorkers_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + getSupervisorWorkers_args typedOther = (getSupervisorWorkers_args)other; + + lastComparison = Boolean.valueOf(is_set_host()).compareTo(typedOther.is_set_host()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_host()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.host, typedOther.host); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getSupervisorWorkers_args("); + boolean first = true; + + sb.append("host:"); + if (this.host == null) { + sb.append("null"); + } else { + sb.append(this.host); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 getSupervisorWorkers_argsStandardSchemeFactory implements SchemeFactory { + public getSupervisorWorkers_argsStandardScheme getScheme() { + return new getSupervisorWorkers_argsStandardScheme(); + } + } + + private static class getSupervisorWorkers_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getSupervisorWorkers_args 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: // HOST + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.host = iprot.readString(); + struct.set_host_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, getSupervisorWorkers_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.host != null) { + oprot.writeFieldBegin(HOST_FIELD_DESC); + oprot.writeString(struct.host); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getSupervisorWorkers_argsTupleSchemeFactory implements SchemeFactory { + public getSupervisorWorkers_argsTupleScheme getScheme() { + return new getSupervisorWorkers_argsTupleScheme(); + } + } + + private static class getSupervisorWorkers_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getSupervisorWorkers_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.is_set_host()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.is_set_host()) { + oprot.writeString(struct.host); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getSupervisorWorkers_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.host = iprot.readString(); + struct.set_host_isSet(true); + } + } + } + + } + + public static class getSupervisorWorkers_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSupervisorWorkers_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); + private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getSupervisorWorkers_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getSupervisorWorkers_resultTupleSchemeFactory()); + } + + private SupervisorWorkers success; // required + private NotAliveException e; // 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 { + SUCCESS((short)0, "success"), + E((short)1, "e"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + case 1: // E + return E; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SupervisorWorkers.class))); + tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSupervisorWorkers_result.class, metaDataMap); + } + + public getSupervisorWorkers_result() { + } + + public getSupervisorWorkers_result( + SupervisorWorkers success, + NotAliveException e) + { + this(); + this.success = success; + this.e = e; + } + + /** + * Performs a deep copy on other. + */ + public getSupervisorWorkers_result(getSupervisorWorkers_result other) { + if (other.is_set_success()) { + this.success = new SupervisorWorkers(other.success); + } + if (other.is_set_e()) { + this.e = new NotAliveException(other.e); + } + } + + public getSupervisorWorkers_result deepCopy() { + return new getSupervisorWorkers_result(this); + } + + @Override + public void clear() { + this.success = null; + this.e = null; + } + + public SupervisorWorkers get_success() { + return this.success; + } + + public void set_success(SupervisorWorkers success) { + this.success = success; + } + + public void unset_success() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean is_set_success() { + return this.success != null; + } + + public void set_success_isSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public NotAliveException get_e() { + return this.e; + } + + public void set_e(NotAliveException e) { + this.e = e; + } + + public void unset_e() { + this.e = null; + } + + /** Returns true if field e is set (has been assigned a value) and false otherwise */ + public boolean is_set_e() { + return this.e != null; + } + + public void set_e_isSet(boolean value) { + if (!value) { + this.e = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unset_success(); + } else { + set_success((SupervisorWorkers)value); + } + break; + + case E: + if (value == null) { + unset_e(); + } else { + set_e((NotAliveException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return get_success(); + + case E: + return get_e(); + + } + throw new 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(); + } + + switch (field) { + case SUCCESS: + return is_set_success(); + case E: + return is_set_e(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getSupervisorWorkers_result) + return this.equals((getSupervisorWorkers_result)that); + return false; + } + + public boolean equals(getSupervisorWorkers_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.is_set_success(); + boolean that_present_success = true && that.is_set_success(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_e = true && this.is_set_e(); + boolean that_present_e = true && that.is_set_e(); + if (this_present_e || that_present_e) { + if (!(this_present_e && that_present_e)) + return false; + if (!this.e.equals(that.e)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_success = true && (is_set_success()); + builder.append(present_success); + if (present_success) + builder.append(success); + + boolean present_e = true && (is_set_e()); + builder.append(present_e); + if (present_e) + builder.append(e); + + return builder.toHashCode(); + } + + public int compareTo(getSupervisorWorkers_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + getSupervisorWorkers_result typedOther = (getSupervisorWorkers_result)other; + + lastComparison = Boolean.valueOf(is_set_success()).compareTo(typedOther.is_set_success()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_success()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_e()).compareTo(typedOther.is_set_e()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_e()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getSupervisorWorkers_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("e:"); + if (this.e == null) { + sb.append("null"); + } else { + sb.append(this.e); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 getSupervisorWorkers_resultStandardSchemeFactory implements SchemeFactory { + public getSupervisorWorkers_resultStandardScheme getScheme() { + return new getSupervisorWorkers_resultStandardScheme(); + } + } + + private static class getSupervisorWorkers_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getSupervisorWorkers_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new SupervisorWorkers(); + struct.success.read(iprot); + struct.set_success_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // E + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.e = new NotAliveException(); + struct.e.read(iprot); + struct.set_e_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, getSupervisorWorkers_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.e != null) { + oprot.writeFieldBegin(E_FIELD_DESC); + struct.e.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getSupervisorWorkers_resultTupleSchemeFactory implements SchemeFactory { + public getSupervisorWorkers_resultTupleScheme getScheme() { + return new getSupervisorWorkers_resultTupleScheme(); + } + } + + private static class getSupervisorWorkers_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getSupervisorWorkers_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.is_set_success()) { + optionals.set(0); + } + if (struct.is_set_e()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.is_set_success()) { + struct.success.write(oprot); + } + if (struct.is_set_e()) { + struct.e.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getSupervisorWorkers_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = new SupervisorWorkers(); + struct.success.read(iprot); + struct.set_success_isSet(true); + } + if (incoming.get(1)) { + struct.e = new NotAliveException(); + struct.e.read(iprot); + struct.set_e_isSet(true); + } + } + } + + } + + public static class getTopologyConf_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getTopologyConf_args"); + + private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getTopologyConf_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getTopologyConf_argsTupleSchemeFactory()); + } + + private String 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 { + ID((short)1, "id"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // ID + return ID; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getTopologyConf_args.class, metaDataMap); + } + + public getTopologyConf_args() { + } + + public getTopologyConf_args( + String id) + { + this(); + this.id = id; + } + + /** + * Performs a deep copy on other. + */ + public getTopologyConf_args(getTopologyConf_args other) { + if (other.is_set_id()) { + this.id = other.id; + } + } + + public getTopologyConf_args deepCopy() { + return new getTopologyConf_args(this); + } + + @Override + public void clear() { + this.id = null; + } + + public String get_id() { + return this.id; + } + + public void set_id(String id) { + this.id = id; + } + + public void unset_id() { + this.id = null; + } + + /** Returns true if field id is set (has been assigned a value) and false otherwise */ + public boolean is_set_id() { + return this.id != null; + } + + public void set_id_isSet(boolean value) { + if (!value) { + this.id = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case ID: + if (value == null) { + unset_id(); + } else { + set_id((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case ID: + return get_id(); + + } + throw new 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(); + } + + switch (field) { + case ID: + return is_set_id(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getTopologyConf_args) + return this.equals((getTopologyConf_args)that); + return false; + } + + public boolean equals(getTopologyConf_args that) { + if (that == null) + return false; + + boolean this_present_id = true && this.is_set_id(); + boolean that_present_id = true && that.is_set_id(); + if (this_present_id || that_present_id) { + if (!(this_present_id && that_present_id)) + return false; + if (!this.id.equals(that.id)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_id = true && (is_set_id()); + builder.append(present_id); + if (present_id) + builder.append(id); + + return builder.toHashCode(); + } + + public int compareTo(getTopologyConf_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + getTopologyConf_args typedOther = (getTopologyConf_args)other; + + lastComparison = Boolean.valueOf(is_set_id()).compareTo(typedOther.is_set_id()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_id()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getTopologyConf_args("); + boolean first = true; + + sb.append("id:"); + if (this.id == null) { + sb.append("null"); + } else { + sb.append(this.id); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 getTopologyConf_argsStandardSchemeFactory implements SchemeFactory { + public getTopologyConf_argsStandardScheme getScheme() { + return new getTopologyConf_argsStandardScheme(); + } + } + + private static class getTopologyConf_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getTopologyConf_args 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: // ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.id = iprot.readString(); + struct.set_id_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, getTopologyConf_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.id != null) { + oprot.writeFieldBegin(ID_FIELD_DESC); + oprot.writeString(struct.id); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getTopologyConf_argsTupleSchemeFactory implements SchemeFactory { + public getTopologyConf_argsTupleScheme getScheme() { + return new getTopologyConf_argsTupleScheme(); + } + } + + private static class getTopologyConf_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getTopologyConf_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.is_set_id()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.is_set_id()) { + oprot.writeString(struct.id); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getTopologyConf_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.id = iprot.readString(); + struct.set_id_isSet(true); + } + } + } + + } + + public static class getTopologyConf_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getTopologyConf_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); + private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getTopologyConf_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getTopologyConf_resultTupleSchemeFactory()); + } + + private String success; // required + private NotAliveException e; // 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 { + SUCCESS((short)0, "success"), + E((short)1, "e"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + case 1: // E + return E; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getTopologyConf_result.class, metaDataMap); + } + + public getTopologyConf_result() { + } + + public getTopologyConf_result( + String success, + NotAliveException e) + { + this(); + this.success = success; + this.e = e; + } + + /** + * Performs a deep copy on other. + */ + public getTopologyConf_result(getTopologyConf_result other) { + if (other.is_set_success()) { + this.success = other.success; + } + if (other.is_set_e()) { + this.e = new NotAliveException(other.e); + } + } + + public getTopologyConf_result deepCopy() { + return new getTopologyConf_result(this); + } + + @Override + public void clear() { + this.success = null; + this.e = null; + } + + public String get_success() { + return this.success; + } + + public void set_success(String success) { + this.success = success; + } + + public void unset_success() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean is_set_success() { + return this.success != null; + } + + public void set_success_isSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public NotAliveException get_e() { + return this.e; + } + + public void set_e(NotAliveException e) { + this.e = e; + } + + public void unset_e() { + this.e = null; + } + + /** Returns true if field e is set (has been assigned a value) and false otherwise */ + public boolean is_set_e() { + return this.e != null; + } + + public void set_e_isSet(boolean value) { + if (!value) { + this.e = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unset_success(); + } else { + set_success((String)value); + } + break; + + case E: + if (value == null) { + unset_e(); + } else { + set_e((NotAliveException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return get_success(); + + case E: + return get_e(); + + } + throw new 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(); + } + + switch (field) { + case SUCCESS: + return is_set_success(); + case E: + return is_set_e(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getTopologyConf_result) + return this.equals((getTopologyConf_result)that); + return false; + } + + public boolean equals(getTopologyConf_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.is_set_success(); + boolean that_present_success = true && that.is_set_success(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_e = true && this.is_set_e(); + boolean that_present_e = true && that.is_set_e(); + if (this_present_e || that_present_e) { + if (!(this_present_e && that_present_e)) + return false; + if (!this.e.equals(that.e)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_success = true && (is_set_success()); + builder.append(present_success); + if (present_success) + builder.append(success); + + boolean present_e = true && (is_set_e()); + builder.append(present_e); + if (present_e) + builder.append(e); + + return builder.toHashCode(); + } + + public int compareTo(getTopologyConf_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + getTopologyConf_result typedOther = (getTopologyConf_result)other; + + lastComparison = Boolean.valueOf(is_set_success()).compareTo(typedOther.is_set_success()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_success()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_e()).compareTo(typedOther.is_set_e()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_e()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getTopologyConf_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("e:"); + if (this.e == null) { + sb.append("null"); + } else { + sb.append(this.e); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 getTopologyConf_resultStandardSchemeFactory implements SchemeFactory { + public getTopologyConf_resultStandardScheme getScheme() { + return new getTopologyConf_resultStandardScheme(); + } + } + + private static class getTopologyConf_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getTopologyConf_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.success = iprot.readString(); + struct.set_success_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // E + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.e = new NotAliveException(); + struct.e.read(iprot); + struct.set_e_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, getTopologyConf_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeString(struct.success); + oprot.writeFieldEnd(); + } + if (struct.e != null) { + oprot.writeFieldBegin(E_FIELD_DESC); + struct.e.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getTopologyConf_resultTupleSchemeFactory implements SchemeFactory { + public getTopologyConf_resultTupleScheme getScheme() { + return new getTopologyConf_resultTupleScheme(); + } + } + + private static class getTopologyConf_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getTopologyConf_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.is_set_success()) { + optionals.set(0); + } + if (struct.is_set_e()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.is_set_success()) { + oprot.writeString(struct.success); + } + if (struct.is_set_e()) { + struct.e.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getTopologyConf_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = iprot.readString(); + struct.set_success_isSet(true); + } + if (incoming.get(1)) { + struct.e = new NotAliveException(); + struct.e.read(iprot); + struct.set_e_isSet(true); + } + } + } + + } + + public static class getTopology_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getTopology_args"); + + private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getTopology_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getTopology_argsTupleSchemeFactory()); + } + + private String 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 { + ID((short)1, "id"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // ID + return ID; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getTopology_args.class, metaDataMap); + } + + public getTopology_args() { + } + + public getTopology_args( + String id) + { + this(); + this.id = id; + } + + /** + * Performs a deep copy on other. + */ + public getTopology_args(getTopology_args other) { + if (other.is_set_id()) { + this.id = other.id; + } + } + + public getTopology_args deepCopy() { + return new getTopology_args(this); + } + + @Override + public void clear() { + this.id = null; + } + + public String get_id() { + return this.id; + } + + public void set_id(String id) { + this.id = id; + } + + public void unset_id() { + this.id = null; + } + + /** Returns true if field id is set (has been assigned a value) and false otherwise */ + public boolean is_set_id() { + return this.id != null; + } + + public void set_id_isSet(boolean value) { + if (!value) { + this.id = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case ID: + if (value == null) { + unset_id(); + } else { + set_id((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case ID: + return get_id(); + + } + throw new 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(); + } + + switch (field) { + case ID: + return is_set_id(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getTopology_args) + return this.equals((getTopology_args)that); + return false; + } + + public boolean equals(getTopology_args that) { + if (that == null) + return false; + + boolean this_present_id = true && this.is_set_id(); + boolean that_present_id = true && that.is_set_id(); + if (this_present_id || that_present_id) { + if (!(this_present_id && that_present_id)) + return false; + if (!this.id.equals(that.id)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_id = true && (is_set_id()); + builder.append(present_id); + if (present_id) + builder.append(id); + + return builder.toHashCode(); + } + + public int compareTo(getTopology_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + getTopology_args typedOther = (getTopology_args)other; + + lastComparison = Boolean.valueOf(is_set_id()).compareTo(typedOther.is_set_id()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_id()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getTopology_args("); + boolean first = true; + + sb.append("id:"); + if (this.id == null) { + sb.append("null"); + } else { + sb.append(this.id); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 getTopology_argsStandardSchemeFactory implements SchemeFactory { + public getTopology_argsStandardScheme getScheme() { + return new getTopology_argsStandardScheme(); + } + } + + private static class getTopology_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getTopology_args 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: // ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.id = iprot.readString(); + struct.set_id_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, getTopology_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.id != null) { + oprot.writeFieldBegin(ID_FIELD_DESC); + oprot.writeString(struct.id); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getTopology_argsTupleSchemeFactory implements SchemeFactory { + public getTopology_argsTupleScheme getScheme() { + return new getTopology_argsTupleScheme(); + } + } + + private static class getTopology_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getTopology_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.is_set_id()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.is_set_id()) { + oprot.writeString(struct.id); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getTopology_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.id = iprot.readString(); + struct.set_id_isSet(true); + } + } + } + + } + + public static class getTopology_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getTopology_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); + private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getTopology_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getTopology_resultTupleSchemeFactory()); + } + + private StormTopology success; // required + private NotAliveException e; // 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 { + SUCCESS((short)0, "success"), + E((short)1, "e"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + case 1: // E + return E; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, StormTopology.class))); + tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getTopology_result.class, metaDataMap); + } + + public getTopology_result() { + } + + public getTopology_result( + StormTopology success, + NotAliveException e) + { + this(); + this.success = success; + this.e = e; + } + + /** + * Performs a deep copy on other. + */ + public getTopology_result(getTopology_result other) { + if (other.is_set_success()) { + this.success = new StormTopology(other.success); + } + if (other.is_set_e()) { + this.e = new NotAliveException(other.e); + } + } + + public getTopology_result deepCopy() { + return new getTopology_result(this); + } + + @Override + public void clear() { + this.success = null; + this.e = null; + } + + public StormTopology get_success() { + return this.success; + } + + public void set_success(StormTopology success) { + this.success = success; + } + + public void unset_success() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean is_set_success() { + return this.success != null; + } + + public void set_success_isSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public NotAliveException get_e() { + return this.e; + } + + public void set_e(NotAliveException e) { + this.e = e; + } + + public void unset_e() { + this.e = null; + } + + /** Returns true if field e is set (has been assigned a value) and false otherwise */ + public boolean is_set_e() { + return this.e != null; + } + + public void set_e_isSet(boolean value) { + if (!value) { + this.e = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unset_success(); + } else { + set_success((StormTopology)value); + } + break; + + case E: + if (value == null) { + unset_e(); + } else { + set_e((NotAliveException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return get_success(); + + case E: + return get_e(); + + } + throw new 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(); + } + + switch (field) { + case SUCCESS: + return is_set_success(); + case E: + return is_set_e(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getTopology_result) + return this.equals((getTopology_result)that); + return false; + } + + public boolean equals(getTopology_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.is_set_success(); + boolean that_present_success = true && that.is_set_success(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_e = true && this.is_set_e(); + boolean that_present_e = true && that.is_set_e(); + if (this_present_e || that_present_e) { + if (!(this_present_e && that_present_e)) + return false; + if (!this.e.equals(that.e)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_success = true && (is_set_success()); + builder.append(present_success); + if (present_success) + builder.append(success); + + boolean present_e = true && (is_set_e()); + builder.append(present_e); + if (present_e) + builder.append(e); + + return builder.toHashCode(); + } + + public int compareTo(getTopology_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + getTopology_result typedOther = (getTopology_result)other; + + lastComparison = Boolean.valueOf(is_set_success()).compareTo(typedOther.is_set_success()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_success()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_e()).compareTo(typedOther.is_set_e()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_e()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getTopology_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("e:"); + if (this.e == null) { + sb.append("null"); + } else { + sb.append(this.e); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 getTopology_resultStandardSchemeFactory implements SchemeFactory { + public getTopology_resultStandardScheme getScheme() { + return new getTopology_resultStandardScheme(); + } + } + + private static class getTopology_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getTopology_result 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 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new StormTopology(); + struct.success.read(iprot); + struct.set_success_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // E + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.e = new NotAliveException(); + struct.e.read(iprot); + struct.set_e_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, getTopology_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.e != null) { + oprot.writeFieldBegin(E_FIELD_DESC); + struct.e.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getTopology_resultTupleSchemeFactory implements SchemeFactory { + public getTopology_resultTupleScheme getScheme() { + return new getTopology_resultTupleScheme(); + } + } + + private static class getTopology_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getTopology_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.is_set_success()) { + optionals.set(0); + } + if (struct.is_set_e()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.is_set_success()) { + struct.success.write(oprot); + } + if (struct.is_set_e()) { + struct.e.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getTopology_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = new StormTopology(); + struct.success.read(iprot); + struct.set_success_isSet(true); + } + if (incoming.get(1)) { + struct.e = new NotAliveException(); + struct.e.read(iprot); + struct.set_e_isSet(true); + } + } + } + + } + +} diff --git a/jstorm-client/src/main/java/backtype/storm/generated/NotAliveException.java b/jstorm-client/src/main/java/backtype/storm/generated/NotAliveException.java index bc7be8a1e..712d4c2db 100644 --- a/jstorm-client/src/main/java/backtype/storm/generated/NotAliveException.java +++ b/jstorm-client/src/main/java/backtype/storm/generated/NotAliveException.java @@ -1,328 +1,381 @@ -/** - * Autogenerated by Thrift Compiler (0.7.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - */ -package backtype.storm.generated; - -import org.apache.commons.lang.builder.HashCodeBuilder; -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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class NotAliveException extends Exception implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("NotAliveException"); - - 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 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 byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // MSG - return MSG; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - 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); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(NotAliveException.class, metaDataMap); - } - - public NotAliveException() { - } - - public NotAliveException( - String msg) - { - this(); - this.msg = msg; - } - - /** - * Performs a deep copy on other. - */ - public NotAliveException(NotAliveException other) { - if (other.is_set_msg()) { - this.msg = other.msg; - } - } - - public NotAliveException deepCopy() { - return new NotAliveException(this); - } - - @Override - public void clear() { - this.msg = null; - } - - public String get_msg() { - return this.msg; - } - - public void set_msg(String msg) { - this.msg = msg; - } - - public void unset_msg() { - this.msg = null; - } - - /** Returns true if field msg is set (has been assigned a value) and false otherwise */ - public boolean is_set_msg() { - return this.msg != null; - } - - public void set_msg_isSet(boolean value) { - if (!value) { - this.msg = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case MSG: - if (value == null) { - unset_msg(); - } else { - set_msg((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case MSG: - return get_msg(); - - } - throw new 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(); - } - - switch (field) { - case MSG: - return is_set_msg(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof NotAliveException) - return this.equals((NotAliveException)that); - return false; - } - - public boolean equals(NotAliveException that) { - if (that == null) - return false; - - boolean this_present_msg = true && this.is_set_msg(); - boolean that_present_msg = true && that.is_set_msg(); - if (this_present_msg || that_present_msg) { - if (!(this_present_msg && that_present_msg)) - return false; - if (!this.msg.equals(that.msg)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_msg = true && (is_set_msg()); - builder.append(present_msg); - if (present_msg) - builder.append(msg); - - return builder.toHashCode(); - } - - public int compareTo(NotAliveException other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - NotAliveException typedOther = (NotAliveException)other; - - lastComparison = Boolean.valueOf(is_set_msg()).compareTo(typedOther.is_set_msg()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_msg()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.msg, typedOther.msg); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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(); - } - - 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(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("NotAliveException("); - boolean first = true; - - sb.append("msg:"); - if (this.msg == null) { - sb.append("null"); - } else { - sb.append(this.msg); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!is_set_msg()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'msg' is unset! Struct:" + toString()); - } - - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - -} - +/** + * Autogenerated by Thrift Compiler (0.8.0) + * + * 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 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class NotAliveException extends Exception implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("NotAliveException"); + + 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, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new NotAliveExceptionStandardSchemeFactory()); + schemes.put(TupleScheme.class, new NotAliveExceptionTupleSchemeFactory()); + } + + private 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 byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // MSG + return MSG; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + 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); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(NotAliveException.class, metaDataMap); + } + + public NotAliveException() { + } + + public NotAliveException( + String msg) + { + this(); + this.msg = msg; + } + + /** + * Performs a deep copy on other. + */ + public NotAliveException(NotAliveException other) { + if (other.is_set_msg()) { + this.msg = other.msg; + } + } + + public NotAliveException deepCopy() { + return new NotAliveException(this); + } + + @Override + public void clear() { + this.msg = null; + } + + public String get_msg() { + return this.msg; + } + + public void set_msg(String msg) { + this.msg = msg; + } + + public void unset_msg() { + this.msg = null; + } + + /** Returns true if field msg is set (has been assigned a value) and false otherwise */ + public boolean is_set_msg() { + return this.msg != null; + } + + public void set_msg_isSet(boolean value) { + if (!value) { + this.msg = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case MSG: + if (value == null) { + unset_msg(); + } else { + set_msg((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case MSG: + return get_msg(); + + } + throw new 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(); + } + + switch (field) { + case MSG: + return is_set_msg(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof NotAliveException) + return this.equals((NotAliveException)that); + return false; + } + + public boolean equals(NotAliveException that) { + if (that == null) + return false; + + boolean this_present_msg = true && this.is_set_msg(); + boolean that_present_msg = true && that.is_set_msg(); + if (this_present_msg || that_present_msg) { + if (!(this_present_msg && that_present_msg)) + return false; + if (!this.msg.equals(that.msg)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_msg = true && (is_set_msg()); + builder.append(present_msg); + if (present_msg) + builder.append(msg); + + return builder.toHashCode(); + } + + public int compareTo(NotAliveException other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + NotAliveException typedOther = (NotAliveException)other; + + lastComparison = Boolean.valueOf(is_set_msg()).compareTo(typedOther.is_set_msg()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_msg()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.msg, typedOther.msg); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("NotAliveException("); + boolean first = true; + + sb.append("msg:"); + if (this.msg == null) { + sb.append("null"); + } else { + sb.append(this.msg); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!is_set_msg()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'msg' is unset! Struct:" + toString()); + } + + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 NotAliveExceptionStandardSchemeFactory implements SchemeFactory { + public NotAliveExceptionStandardScheme getScheme() { + return new NotAliveExceptionStandardScheme(); + } + } + + private static class NotAliveExceptionStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, NotAliveException 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, NotAliveException 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 NotAliveExceptionTupleSchemeFactory implements SchemeFactory { + public NotAliveExceptionTupleScheme getScheme() { + return new NotAliveExceptionTupleScheme(); + } + } + + private static class NotAliveExceptionTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, NotAliveException struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.msg); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, NotAliveException struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.msg = iprot.readString(); + struct.set_msg_isSet(true); + } + } + +} + diff --git a/jstorm-client/src/main/java/backtype/storm/generated/NullStruct.java b/jstorm-client/src/main/java/backtype/storm/generated/NullStruct.java index fa1a6e3ec..2875acb32 100644 --- a/jstorm-client/src/main/java/backtype/storm/generated/NullStruct.java +++ b/jstorm-client/src/main/java/backtype/storm/generated/NullStruct.java @@ -1,225 +1,275 @@ -/** - * Autogenerated by Thrift Compiler (0.7.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - */ -package backtype.storm.generated; - -import org.apache.commons.lang.builder.HashCodeBuilder; -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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class NullStruct implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("NullStruct"); - - - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -; - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - 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); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(NullStruct.class, metaDataMap); - } - - public NullStruct() { - } - - /** - * Performs a deep copy on other. - */ - public NullStruct(NullStruct other) { - } - - public NullStruct deepCopy() { - return new NullStruct(this); - } - - @Override - public void clear() { - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - } - throw new 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(); - } - - switch (field) { - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof NullStruct) - return this.equals((NullStruct)that); - return false; - } - - public boolean equals(NullStruct that) { - if (that == null) - return false; - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - return builder.toHashCode(); - } - - public int compareTo(NullStruct other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - NullStruct typedOther = (NullStruct)other; - - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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) { - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("NullStruct("); - boolean first = true; - - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - -} - +/** + * Autogenerated by Thrift Compiler (0.8.0) + * + * 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 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class NullStruct implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("NullStruct"); + + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new NullStructStandardSchemeFactory()); + schemes.put(TupleScheme.class, new NullStructTupleSchemeFactory()); + } + + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { +; + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + 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); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(NullStruct.class, metaDataMap); + } + + public NullStruct() { + } + + /** + * Performs a deep copy on other. + */ + public NullStruct(NullStruct other) { + } + + public NullStruct deepCopy() { + return new NullStruct(this); + } + + @Override + public void clear() { + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + } + throw new 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(); + } + + switch (field) { + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof NullStruct) + return this.equals((NullStruct)that); + return false; + } + + public boolean equals(NullStruct that) { + if (that == null) + return false; + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + return builder.toHashCode(); + } + + public int compareTo(NullStruct other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + NullStruct typedOther = (NullStruct)other; + + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("NullStruct("); + boolean first = true; + + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 NullStructStandardSchemeFactory implements SchemeFactory { + public NullStructStandardScheme getScheme() { + return new NullStructStandardScheme(); + } + } + + private static class NullStructStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, NullStruct 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) { + 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, NullStruct struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class NullStructTupleSchemeFactory implements SchemeFactory { + public NullStructTupleScheme getScheme() { + return new NullStructTupleScheme(); + } + } + + private static class NullStructTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, NullStruct struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, NullStruct struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + +} + diff --git a/jstorm-client/src/main/java/backtype/storm/generated/RebalanceOptions.java b/jstorm-client/src/main/java/backtype/storm/generated/RebalanceOptions.java index 2c26ba72b..b3c246a66 100644 --- a/jstorm-client/src/main/java/backtype/storm/generated/RebalanceOptions.java +++ b/jstorm-client/src/main/java/backtype/storm/generated/RebalanceOptions.java @@ -1,320 +1,383 @@ -/** - * Autogenerated by Thrift Compiler (0.7.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - */ -package backtype.storm.generated; - -import org.apache.commons.lang.builder.HashCodeBuilder; -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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class RebalanceOptions implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RebalanceOptions"); - - 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 - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - WAIT_SECS((short)1, "wait_secs"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // WAIT_SECS - return WAIT_SECS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __WAIT_SECS_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - - 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); - tmpMap.put(_Fields.WAIT_SECS, new org.apache.thrift.meta_data.FieldMetaData("wait_secs", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RebalanceOptions.class, metaDataMap); - } - - public RebalanceOptions() { - } - - /** - * Performs a deep copy on other. - */ - public RebalanceOptions(RebalanceOptions other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); - this.wait_secs = other.wait_secs; - } - - public RebalanceOptions deepCopy() { - return new RebalanceOptions(this); - } - - @Override - public void clear() { - set_wait_secs_isSet(false); - this.wait_secs = 0; - } - - public int get_wait_secs() { - return this.wait_secs; - } - - public void set_wait_secs(int wait_secs) { - this.wait_secs = wait_secs; - set_wait_secs_isSet(true); - } - - public void unset_wait_secs() { - __isset_bit_vector.clear(__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); - } - - public void set_wait_secs_isSet(boolean value) { - __isset_bit_vector.set(__WAIT_SECS_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case WAIT_SECS: - if (value == null) { - unset_wait_secs(); - } else { - set_wait_secs((Integer)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case WAIT_SECS: - return Integer.valueOf(get_wait_secs()); - - } - throw new 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(); - } - - switch (field) { - case WAIT_SECS: - return is_set_wait_secs(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof RebalanceOptions) - return this.equals((RebalanceOptions)that); - return false; - } - - public boolean equals(RebalanceOptions that) { - if (that == null) - return false; - - boolean this_present_wait_secs = true && this.is_set_wait_secs(); - boolean that_present_wait_secs = true && that.is_set_wait_secs(); - if (this_present_wait_secs || that_present_wait_secs) { - if (!(this_present_wait_secs && that_present_wait_secs)) - return false; - if (this.wait_secs != that.wait_secs) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_wait_secs = true && (is_set_wait_secs()); - builder.append(present_wait_secs); - if (present_wait_secs) - builder.append(wait_secs); - - return builder.toHashCode(); - } - - public int compareTo(RebalanceOptions other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - RebalanceOptions typedOther = (RebalanceOptions)other; - - lastComparison = Boolean.valueOf(is_set_wait_secs()).compareTo(typedOther.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); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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(); - } - - 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(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("RebalanceOptions("); - boolean first = true; - - if (is_set_wait_secs()) { - sb.append("wait_secs:"); - sb.append(this.wait_secs); - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - 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); - 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); - } - } - -} - +/** + * Autogenerated by Thrift Compiler (0.8.0) + * + * 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 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class RebalanceOptions implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RebalanceOptions"); + + 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 static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new RebalanceOptionsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new RebalanceOptionsTupleSchemeFactory()); + } + + 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 { + WAIT_SECS((short)1, "wait_secs"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // WAIT_SECS + return WAIT_SECS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __WAIT_SECS_ISSET_ID = 0; + private BitSet __isset_bit_vector = new BitSet(1); + private _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); + tmpMap.put(_Fields.WAIT_SECS, new org.apache.thrift.meta_data.FieldMetaData("wait_secs", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RebalanceOptions.class, metaDataMap); + } + + public RebalanceOptions() { + } + + /** + * Performs a deep copy on other. + */ + public RebalanceOptions(RebalanceOptions other) { + __isset_bit_vector.clear(); + __isset_bit_vector.or(other.__isset_bit_vector); + this.wait_secs = other.wait_secs; + } + + public RebalanceOptions deepCopy() { + return new RebalanceOptions(this); + } + + @Override + public void clear() { + set_wait_secs_isSet(false); + this.wait_secs = 0; + } + + public int get_wait_secs() { + return this.wait_secs; + } + + public void set_wait_secs(int wait_secs) { + this.wait_secs = wait_secs; + set_wait_secs_isSet(true); + } + + public void unset_wait_secs() { + __isset_bit_vector.clear(__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); + } + + public void set_wait_secs_isSet(boolean value) { + __isset_bit_vector.set(__WAIT_SECS_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case WAIT_SECS: + if (value == null) { + unset_wait_secs(); + } else { + set_wait_secs((Integer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case WAIT_SECS: + return Integer.valueOf(get_wait_secs()); + + } + throw new 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(); + } + + switch (field) { + case WAIT_SECS: + return is_set_wait_secs(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof RebalanceOptions) + return this.equals((RebalanceOptions)that); + return false; + } + + public boolean equals(RebalanceOptions that) { + if (that == null) + return false; + + boolean this_present_wait_secs = true && this.is_set_wait_secs(); + boolean that_present_wait_secs = true && that.is_set_wait_secs(); + if (this_present_wait_secs || that_present_wait_secs) { + if (!(this_present_wait_secs && that_present_wait_secs)) + return false; + if (this.wait_secs != that.wait_secs) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_wait_secs = true && (is_set_wait_secs()); + builder.append(present_wait_secs); + if (present_wait_secs) + builder.append(wait_secs); + + return builder.toHashCode(); + } + + public int compareTo(RebalanceOptions other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + RebalanceOptions typedOther = (RebalanceOptions)other; + + lastComparison = Boolean.valueOf(is_set_wait_secs()).compareTo(typedOther.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); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("RebalanceOptions("); + boolean first = true; + + if (is_set_wait_secs()) { + sb.append("wait_secs:"); + sb.append(this.wait_secs); + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + 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); + 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 RebalanceOptionsStandardSchemeFactory implements SchemeFactory { + public RebalanceOptionsStandardScheme getScheme() { + return new RebalanceOptionsStandardScheme(); + } + } + + private static class RebalanceOptionsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, RebalanceOptions 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, RebalanceOptions 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 RebalanceOptionsTupleSchemeFactory implements SchemeFactory { + public RebalanceOptionsTupleScheme getScheme() { + return new RebalanceOptionsTupleScheme(); + } + } + + private static class RebalanceOptionsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, RebalanceOptions 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, RebalanceOptions 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); + } + } + } + +} + diff --git a/jstorm-client/src/main/java/backtype/storm/generated/ShellComponent.java b/jstorm-client/src/main/java/backtype/storm/generated/ShellComponent.java index 21f73e0e9..942fb3d65 100644 --- a/jstorm-client/src/main/java/backtype/storm/generated/ShellComponent.java +++ b/jstorm-client/src/main/java/backtype/storm/generated/ShellComponent.java @@ -1,417 +1,491 @@ -/** - * Autogenerated by Thrift Compiler (0.7.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - */ -package backtype.storm.generated; - -import org.apache.commons.lang.builder.HashCodeBuilder; -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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class ShellComponent implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ShellComponent"); - - private static final org.apache.thrift.protocol.TField EXECUTION_COMMAND_FIELD_DESC = new org.apache.thrift.protocol.TField("execution_command", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField SCRIPT_FIELD_DESC = new org.apache.thrift.protocol.TField("script", org.apache.thrift.protocol.TType.STRING, (short)2); - - private String execution_command; // required - private String script; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - EXECUTION_COMMAND((short)1, "execution_command"), - SCRIPT((short)2, "script"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // EXECUTION_COMMAND - return EXECUTION_COMMAND; - case 2: // SCRIPT - return SCRIPT; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.EXECUTION_COMMAND, new org.apache.thrift.meta_data.FieldMetaData("execution_command", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.SCRIPT, new org.apache.thrift.meta_data.FieldMetaData("script", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ShellComponent.class, metaDataMap); - } - - public ShellComponent() { - } - - public ShellComponent( - String execution_command, - String script) - { - this(); - this.execution_command = execution_command; - this.script = script; - } - - /** - * Performs a deep copy on other. - */ - public ShellComponent(ShellComponent other) { - if (other.is_set_execution_command()) { - this.execution_command = other.execution_command; - } - if (other.is_set_script()) { - this.script = other.script; - } - } - - public ShellComponent deepCopy() { - return new ShellComponent(this); - } - - @Override - public void clear() { - this.execution_command = null; - this.script = null; - } - - public String get_execution_command() { - return this.execution_command; - } - - public void set_execution_command(String execution_command) { - this.execution_command = execution_command; - } - - public void unset_execution_command() { - this.execution_command = null; - } - - /** Returns true if field execution_command is set (has been assigned a value) and false otherwise */ - public boolean is_set_execution_command() { - return this.execution_command != null; - } - - public void set_execution_command_isSet(boolean value) { - if (!value) { - this.execution_command = null; - } - } - - public String get_script() { - return this.script; - } - - public void set_script(String script) { - this.script = script; - } - - public void unset_script() { - this.script = null; - } - - /** Returns true if field script is set (has been assigned a value) and false otherwise */ - public boolean is_set_script() { - return this.script != null; - } - - public void set_script_isSet(boolean value) { - if (!value) { - this.script = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case EXECUTION_COMMAND: - if (value == null) { - unset_execution_command(); - } else { - set_execution_command((String)value); - } - break; - - case SCRIPT: - if (value == null) { - unset_script(); - } else { - set_script((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case EXECUTION_COMMAND: - return get_execution_command(); - - case SCRIPT: - return get_script(); - - } - throw new 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(); - } - - switch (field) { - case EXECUTION_COMMAND: - return is_set_execution_command(); - case SCRIPT: - return is_set_script(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof ShellComponent) - return this.equals((ShellComponent)that); - return false; - } - - public boolean equals(ShellComponent that) { - if (that == null) - return false; - - boolean this_present_execution_command = true && this.is_set_execution_command(); - boolean that_present_execution_command = true && that.is_set_execution_command(); - if (this_present_execution_command || that_present_execution_command) { - if (!(this_present_execution_command && that_present_execution_command)) - return false; - if (!this.execution_command.equals(that.execution_command)) - return false; - } - - boolean this_present_script = true && this.is_set_script(); - boolean that_present_script = true && that.is_set_script(); - if (this_present_script || that_present_script) { - if (!(this_present_script && that_present_script)) - return false; - if (!this.script.equals(that.script)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_execution_command = true && (is_set_execution_command()); - builder.append(present_execution_command); - if (present_execution_command) - builder.append(execution_command); - - boolean present_script = true && (is_set_script()); - builder.append(present_script); - if (present_script) - builder.append(script); - - return builder.toHashCode(); - } - - public int compareTo(ShellComponent other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - ShellComponent typedOther = (ShellComponent)other; - - lastComparison = Boolean.valueOf(is_set_execution_command()).compareTo(typedOther.is_set_execution_command()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_execution_command()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.execution_command, typedOther.execution_command); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_script()).compareTo(typedOther.is_set_script()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_script()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.script, typedOther.script); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // EXECUTION_COMMAND - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.execution_command = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // SCRIPT - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.script = 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.execution_command != null) { - oprot.writeFieldBegin(EXECUTION_COMMAND_FIELD_DESC); - oprot.writeString(this.execution_command); - oprot.writeFieldEnd(); - } - if (this.script != null) { - oprot.writeFieldBegin(SCRIPT_FIELD_DESC); - oprot.writeString(this.script); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("ShellComponent("); - boolean first = true; - - sb.append("execution_command:"); - if (this.execution_command == null) { - sb.append("null"); - } else { - sb.append(this.execution_command); - } - first = false; - if (!first) sb.append(", "); - sb.append("script:"); - if (this.script == null) { - sb.append("null"); - } else { - sb.append(this.script); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - -} - +/** + * Autogenerated by Thrift Compiler (0.8.0) + * + * 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 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class ShellComponent implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ShellComponent"); + + private static final org.apache.thrift.protocol.TField EXECUTION_COMMAND_FIELD_DESC = new org.apache.thrift.protocol.TField("execution_command", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField SCRIPT_FIELD_DESC = new org.apache.thrift.protocol.TField("script", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new ShellComponentStandardSchemeFactory()); + schemes.put(TupleScheme.class, new ShellComponentTupleSchemeFactory()); + } + + private String execution_command; // required + private String script; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + EXECUTION_COMMAND((short)1, "execution_command"), + SCRIPT((short)2, "script"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // EXECUTION_COMMAND + return EXECUTION_COMMAND; + case 2: // SCRIPT + return SCRIPT; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.EXECUTION_COMMAND, new org.apache.thrift.meta_data.FieldMetaData("execution_command", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.SCRIPT, new org.apache.thrift.meta_data.FieldMetaData("script", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ShellComponent.class, metaDataMap); + } + + public ShellComponent() { + } + + public ShellComponent( + String execution_command, + String script) + { + this(); + this.execution_command = execution_command; + this.script = script; + } + + /** + * Performs a deep copy on other. + */ + public ShellComponent(ShellComponent other) { + if (other.is_set_execution_command()) { + this.execution_command = other.execution_command; + } + if (other.is_set_script()) { + this.script = other.script; + } + } + + public ShellComponent deepCopy() { + return new ShellComponent(this); + } + + @Override + public void clear() { + this.execution_command = null; + this.script = null; + } + + public String get_execution_command() { + return this.execution_command; + } + + public void set_execution_command(String execution_command) { + this.execution_command = execution_command; + } + + public void unset_execution_command() { + this.execution_command = null; + } + + /** Returns true if field execution_command is set (has been assigned a value) and false otherwise */ + public boolean is_set_execution_command() { + return this.execution_command != null; + } + + public void set_execution_command_isSet(boolean value) { + if (!value) { + this.execution_command = null; + } + } + + public String get_script() { + return this.script; + } + + public void set_script(String script) { + this.script = script; + } + + public void unset_script() { + this.script = null; + } + + /** Returns true if field script is set (has been assigned a value) and false otherwise */ + public boolean is_set_script() { + return this.script != null; + } + + public void set_script_isSet(boolean value) { + if (!value) { + this.script = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case EXECUTION_COMMAND: + if (value == null) { + unset_execution_command(); + } else { + set_execution_command((String)value); + } + break; + + case SCRIPT: + if (value == null) { + unset_script(); + } else { + set_script((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case EXECUTION_COMMAND: + return get_execution_command(); + + case SCRIPT: + return get_script(); + + } + throw new 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(); + } + + switch (field) { + case EXECUTION_COMMAND: + return is_set_execution_command(); + case SCRIPT: + return is_set_script(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof ShellComponent) + return this.equals((ShellComponent)that); + return false; + } + + public boolean equals(ShellComponent that) { + if (that == null) + return false; + + boolean this_present_execution_command = true && this.is_set_execution_command(); + boolean that_present_execution_command = true && that.is_set_execution_command(); + if (this_present_execution_command || that_present_execution_command) { + if (!(this_present_execution_command && that_present_execution_command)) + return false; + if (!this.execution_command.equals(that.execution_command)) + return false; + } + + boolean this_present_script = true && this.is_set_script(); + boolean that_present_script = true && that.is_set_script(); + if (this_present_script || that_present_script) { + if (!(this_present_script && that_present_script)) + return false; + if (!this.script.equals(that.script)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_execution_command = true && (is_set_execution_command()); + builder.append(present_execution_command); + if (present_execution_command) + builder.append(execution_command); + + boolean present_script = true && (is_set_script()); + builder.append(present_script); + if (present_script) + builder.append(script); + + return builder.toHashCode(); + } + + public int compareTo(ShellComponent other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + ShellComponent typedOther = (ShellComponent)other; + + lastComparison = Boolean.valueOf(is_set_execution_command()).compareTo(typedOther.is_set_execution_command()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_execution_command()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.execution_command, typedOther.execution_command); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_script()).compareTo(typedOther.is_set_script()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_script()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.script, typedOther.script); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("ShellComponent("); + boolean first = true; + + sb.append("execution_command:"); + if (this.execution_command == null) { + sb.append("null"); + } else { + sb.append(this.execution_command); + } + first = false; + if (!first) sb.append(", "); + sb.append("script:"); + if (this.script == null) { + sb.append("null"); + } else { + sb.append(this.script); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 ShellComponentStandardSchemeFactory implements SchemeFactory { + public ShellComponentStandardScheme getScheme() { + return new ShellComponentStandardScheme(); + } + } + + private static class ShellComponentStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, ShellComponent 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: // EXECUTION_COMMAND + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.execution_command = iprot.readString(); + struct.set_execution_command_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // SCRIPT + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.script = iprot.readString(); + struct.set_script_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, ShellComponent struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.execution_command != null) { + oprot.writeFieldBegin(EXECUTION_COMMAND_FIELD_DESC); + oprot.writeString(struct.execution_command); + oprot.writeFieldEnd(); + } + if (struct.script != null) { + oprot.writeFieldBegin(SCRIPT_FIELD_DESC); + oprot.writeString(struct.script); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class ShellComponentTupleSchemeFactory implements SchemeFactory { + public ShellComponentTupleScheme getScheme() { + return new ShellComponentTupleScheme(); + } + } + + private static class ShellComponentTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, ShellComponent struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.is_set_execution_command()) { + optionals.set(0); + } + if (struct.is_set_script()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.is_set_execution_command()) { + oprot.writeString(struct.execution_command); + } + if (struct.is_set_script()) { + oprot.writeString(struct.script); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, ShellComponent struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.execution_command = iprot.readString(); + struct.set_execution_command_isSet(true); + } + if (incoming.get(1)) { + struct.script = iprot.readString(); + struct.set_script_isSet(true); + } + } + } + +} + diff --git a/jstorm-client/src/main/java/backtype/storm/generated/SpoutSpec.java b/jstorm-client/src/main/java/backtype/storm/generated/SpoutSpec.java index 443f71dba..4c6f24891 100644 --- a/jstorm-client/src/main/java/backtype/storm/generated/SpoutSpec.java +++ b/jstorm-client/src/main/java/backtype/storm/generated/SpoutSpec.java @@ -1,427 +1,486 @@ -/** - * Autogenerated by Thrift Compiler (0.7.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - */ -package backtype.storm.generated; - -import org.apache.commons.lang.builder.HashCodeBuilder; -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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class SpoutSpec implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SpoutSpec"); - - private static final org.apache.thrift.protocol.TField SPOUT_OBJECT_FIELD_DESC = new org.apache.thrift.protocol.TField("spout_object", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField COMMON_FIELD_DESC = new org.apache.thrift.protocol.TField("common", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private ComponentObject spout_object; // required - private ComponentCommon common; // 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 { - SPOUT_OBJECT((short)1, "spout_object"), - COMMON((short)2, "common"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SPOUT_OBJECT - return SPOUT_OBJECT; - case 2: // COMMON - return COMMON; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.SPOUT_OBJECT, new org.apache.thrift.meta_data.FieldMetaData("spout_object", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ComponentObject.class))); - tmpMap.put(_Fields.COMMON, new org.apache.thrift.meta_data.FieldMetaData("common", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ComponentCommon.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SpoutSpec.class, metaDataMap); - } - - public SpoutSpec() { - } - - public SpoutSpec( - ComponentObject spout_object, - ComponentCommon common) - { - this(); - this.spout_object = spout_object; - this.common = common; - } - - /** - * Performs a deep copy on other. - */ - public SpoutSpec(SpoutSpec other) { - if (other.is_set_spout_object()) { - this.spout_object = new ComponentObject(other.spout_object); - } - if (other.is_set_common()) { - this.common = new ComponentCommon(other.common); - } - } - - public SpoutSpec deepCopy() { - return new SpoutSpec(this); - } - - @Override - public void clear() { - this.spout_object = null; - this.common = null; - } - - public ComponentObject get_spout_object() { - return this.spout_object; - } - - public void set_spout_object(ComponentObject spout_object) { - this.spout_object = spout_object; - } - - public void unset_spout_object() { - this.spout_object = null; - } - - /** Returns true if field spout_object is set (has been assigned a value) and false otherwise */ - public boolean is_set_spout_object() { - return this.spout_object != null; - } - - public void set_spout_object_isSet(boolean value) { - if (!value) { - this.spout_object = null; - } - } - - public ComponentCommon get_common() { - return this.common; - } - - public void set_common(ComponentCommon common) { - this.common = common; - } - - public void unset_common() { - this.common = null; - } - - /** Returns true if field common is set (has been assigned a value) and false otherwise */ - public boolean is_set_common() { - return this.common != null; - } - - public void set_common_isSet(boolean value) { - if (!value) { - this.common = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SPOUT_OBJECT: - if (value == null) { - unset_spout_object(); - } else { - set_spout_object((ComponentObject)value); - } - break; - - case COMMON: - if (value == null) { - unset_common(); - } else { - set_common((ComponentCommon)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SPOUT_OBJECT: - return get_spout_object(); - - case COMMON: - return get_common(); - - } - throw new 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(); - } - - switch (field) { - case SPOUT_OBJECT: - return is_set_spout_object(); - case COMMON: - return is_set_common(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof SpoutSpec) - return this.equals((SpoutSpec)that); - return false; - } - - public boolean equals(SpoutSpec that) { - if (that == null) - return false; - - boolean this_present_spout_object = true && this.is_set_spout_object(); - boolean that_present_spout_object = true && that.is_set_spout_object(); - if (this_present_spout_object || that_present_spout_object) { - if (!(this_present_spout_object && that_present_spout_object)) - return false; - if (!this.spout_object.equals(that.spout_object)) - return false; - } - - boolean this_present_common = true && this.is_set_common(); - boolean that_present_common = true && that.is_set_common(); - if (this_present_common || that_present_common) { - if (!(this_present_common && that_present_common)) - return false; - if (!this.common.equals(that.common)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_spout_object = true && (is_set_spout_object()); - builder.append(present_spout_object); - if (present_spout_object) - builder.append(spout_object); - - boolean present_common = true && (is_set_common()); - builder.append(present_common); - if (present_common) - builder.append(common); - - return builder.toHashCode(); - } - - public int compareTo(SpoutSpec other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - SpoutSpec typedOther = (SpoutSpec)other; - - lastComparison = Boolean.valueOf(is_set_spout_object()).compareTo(typedOther.is_set_spout_object()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_spout_object()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.spout_object, typedOther.spout_object); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_common()).compareTo(typedOther.is_set_common()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_common()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.common, typedOther.common); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // SPOUT_OBJECT - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.spout_object = new ComponentObject(); - this.spout_object.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // COMMON - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.common = new ComponentCommon(); - this.common.read(iprot); - } 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.spout_object != null) { - oprot.writeFieldBegin(SPOUT_OBJECT_FIELD_DESC); - this.spout_object.write(oprot); - oprot.writeFieldEnd(); - } - if (this.common != null) { - oprot.writeFieldBegin(COMMON_FIELD_DESC); - this.common.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("SpoutSpec("); - boolean first = true; - - sb.append("spout_object:"); - if (this.spout_object == null) { - sb.append("null"); - } else { - sb.append(this.spout_object); - } - first = false; - if (!first) sb.append(", "); - sb.append("common:"); - if (this.common == null) { - sb.append("null"); - } else { - sb.append(this.common); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!is_set_spout_object()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'spout_object' is unset! Struct:" + toString()); - } - - if (!is_set_common()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'common' is unset! Struct:" + toString()); - } - - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - -} - +/** + * Autogenerated by Thrift Compiler (0.8.0) + * + * 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 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SpoutSpec implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SpoutSpec"); + + private static final org.apache.thrift.protocol.TField SPOUT_OBJECT_FIELD_DESC = new org.apache.thrift.protocol.TField("spout_object", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField COMMON_FIELD_DESC = new org.apache.thrift.protocol.TField("common", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new SpoutSpecStandardSchemeFactory()); + schemes.put(TupleScheme.class, new SpoutSpecTupleSchemeFactory()); + } + + private ComponentObject spout_object; // required + private ComponentCommon common; // 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 { + SPOUT_OBJECT((short)1, "spout_object"), + COMMON((short)2, "common"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // SPOUT_OBJECT + return SPOUT_OBJECT; + case 2: // COMMON + return COMMON; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.SPOUT_OBJECT, new org.apache.thrift.meta_data.FieldMetaData("spout_object", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ComponentObject.class))); + tmpMap.put(_Fields.COMMON, new org.apache.thrift.meta_data.FieldMetaData("common", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ComponentCommon.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SpoutSpec.class, metaDataMap); + } + + public SpoutSpec() { + } + + public SpoutSpec( + ComponentObject spout_object, + ComponentCommon common) + { + this(); + this.spout_object = spout_object; + this.common = common; + } + + /** + * Performs a deep copy on other. + */ + public SpoutSpec(SpoutSpec other) { + if (other.is_set_spout_object()) { + this.spout_object = new ComponentObject(other.spout_object); + } + if (other.is_set_common()) { + this.common = new ComponentCommon(other.common); + } + } + + public SpoutSpec deepCopy() { + return new SpoutSpec(this); + } + + @Override + public void clear() { + this.spout_object = null; + this.common = null; + } + + public ComponentObject get_spout_object() { + return this.spout_object; + } + + public void set_spout_object(ComponentObject spout_object) { + this.spout_object = spout_object; + } + + public void unset_spout_object() { + this.spout_object = null; + } + + /** Returns true if field spout_object is set (has been assigned a value) and false otherwise */ + public boolean is_set_spout_object() { + return this.spout_object != null; + } + + public void set_spout_object_isSet(boolean value) { + if (!value) { + this.spout_object = null; + } + } + + public ComponentCommon get_common() { + return this.common; + } + + public void set_common(ComponentCommon common) { + this.common = common; + } + + public void unset_common() { + this.common = null; + } + + /** Returns true if field common is set (has been assigned a value) and false otherwise */ + public boolean is_set_common() { + return this.common != null; + } + + public void set_common_isSet(boolean value) { + if (!value) { + this.common = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SPOUT_OBJECT: + if (value == null) { + unset_spout_object(); + } else { + set_spout_object((ComponentObject)value); + } + break; + + case COMMON: + if (value == null) { + unset_common(); + } else { + set_common((ComponentCommon)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SPOUT_OBJECT: + return get_spout_object(); + + case COMMON: + return get_common(); + + } + throw new 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(); + } + + switch (field) { + case SPOUT_OBJECT: + return is_set_spout_object(); + case COMMON: + return is_set_common(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof SpoutSpec) + return this.equals((SpoutSpec)that); + return false; + } + + public boolean equals(SpoutSpec that) { + if (that == null) + return false; + + boolean this_present_spout_object = true && this.is_set_spout_object(); + boolean that_present_spout_object = true && that.is_set_spout_object(); + if (this_present_spout_object || that_present_spout_object) { + if (!(this_present_spout_object && that_present_spout_object)) + return false; + if (!this.spout_object.equals(that.spout_object)) + return false; + } + + boolean this_present_common = true && this.is_set_common(); + boolean that_present_common = true && that.is_set_common(); + if (this_present_common || that_present_common) { + if (!(this_present_common && that_present_common)) + return false; + if (!this.common.equals(that.common)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_spout_object = true && (is_set_spout_object()); + builder.append(present_spout_object); + if (present_spout_object) + builder.append(spout_object); + + boolean present_common = true && (is_set_common()); + builder.append(present_common); + if (present_common) + builder.append(common); + + return builder.toHashCode(); + } + + public int compareTo(SpoutSpec other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + SpoutSpec typedOther = (SpoutSpec)other; + + lastComparison = Boolean.valueOf(is_set_spout_object()).compareTo(typedOther.is_set_spout_object()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_spout_object()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.spout_object, typedOther.spout_object); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_common()).compareTo(typedOther.is_set_common()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_common()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.common, typedOther.common); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("SpoutSpec("); + boolean first = true; + + sb.append("spout_object:"); + if (this.spout_object == null) { + sb.append("null"); + } else { + sb.append(this.spout_object); + } + first = false; + if (!first) sb.append(", "); + sb.append("common:"); + if (this.common == null) { + sb.append("null"); + } else { + sb.append(this.common); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!is_set_spout_object()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'spout_object' is unset! Struct:" + toString()); + } + + if (!is_set_common()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'common' is unset! Struct:" + toString()); + } + + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 SpoutSpecStandardSchemeFactory implements SchemeFactory { + public SpoutSpecStandardScheme getScheme() { + return new SpoutSpecStandardScheme(); + } + } + + private static class SpoutSpecStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, SpoutSpec 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: // SPOUT_OBJECT + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.spout_object = new ComponentObject(); + struct.spout_object.read(iprot); + struct.set_spout_object_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // COMMON + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.common = new ComponentCommon(); + struct.common.read(iprot); + struct.set_common_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, SpoutSpec struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.spout_object != null) { + oprot.writeFieldBegin(SPOUT_OBJECT_FIELD_DESC); + struct.spout_object.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.common != null) { + oprot.writeFieldBegin(COMMON_FIELD_DESC); + struct.common.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class SpoutSpecTupleSchemeFactory implements SchemeFactory { + public SpoutSpecTupleScheme getScheme() { + return new SpoutSpecTupleScheme(); + } + } + + private static class SpoutSpecTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, SpoutSpec struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.spout_object.write(oprot); + struct.common.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, SpoutSpec struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.spout_object = new ComponentObject(); + struct.spout_object.read(iprot); + struct.set_spout_object_isSet(true); + struct.common = new ComponentCommon(); + struct.common.read(iprot); + struct.set_common_isSet(true); + } + } + +} + diff --git a/jstorm-client/src/main/java/backtype/storm/generated/StateSpoutSpec.java b/jstorm-client/src/main/java/backtype/storm/generated/StateSpoutSpec.java index 5aa159d3e..131ef2978 100644 --- a/jstorm-client/src/main/java/backtype/storm/generated/StateSpoutSpec.java +++ b/jstorm-client/src/main/java/backtype/storm/generated/StateSpoutSpec.java @@ -1,427 +1,486 @@ -/** - * Autogenerated by Thrift Compiler (0.7.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - */ -package backtype.storm.generated; - -import org.apache.commons.lang.builder.HashCodeBuilder; -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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class StateSpoutSpec implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("StateSpoutSpec"); - - private static final org.apache.thrift.protocol.TField STATE_SPOUT_OBJECT_FIELD_DESC = new org.apache.thrift.protocol.TField("state_spout_object", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField COMMON_FIELD_DESC = new org.apache.thrift.protocol.TField("common", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private ComponentObject state_spout_object; // required - private ComponentCommon common; // 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 { - STATE_SPOUT_OBJECT((short)1, "state_spout_object"), - COMMON((short)2, "common"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATE_SPOUT_OBJECT - return STATE_SPOUT_OBJECT; - case 2: // COMMON - return COMMON; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.STATE_SPOUT_OBJECT, new org.apache.thrift.meta_data.FieldMetaData("state_spout_object", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ComponentObject.class))); - tmpMap.put(_Fields.COMMON, new org.apache.thrift.meta_data.FieldMetaData("common", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ComponentCommon.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(StateSpoutSpec.class, metaDataMap); - } - - public StateSpoutSpec() { - } - - public StateSpoutSpec( - ComponentObject state_spout_object, - ComponentCommon common) - { - this(); - this.state_spout_object = state_spout_object; - this.common = common; - } - - /** - * Performs a deep copy on other. - */ - public StateSpoutSpec(StateSpoutSpec other) { - if (other.is_set_state_spout_object()) { - this.state_spout_object = new ComponentObject(other.state_spout_object); - } - if (other.is_set_common()) { - this.common = new ComponentCommon(other.common); - } - } - - public StateSpoutSpec deepCopy() { - return new StateSpoutSpec(this); - } - - @Override - public void clear() { - this.state_spout_object = null; - this.common = null; - } - - public ComponentObject get_state_spout_object() { - return this.state_spout_object; - } - - public void set_state_spout_object(ComponentObject state_spout_object) { - this.state_spout_object = state_spout_object; - } - - public void unset_state_spout_object() { - this.state_spout_object = null; - } - - /** Returns true if field state_spout_object is set (has been assigned a value) and false otherwise */ - public boolean is_set_state_spout_object() { - return this.state_spout_object != null; - } - - public void set_state_spout_object_isSet(boolean value) { - if (!value) { - this.state_spout_object = null; - } - } - - public ComponentCommon get_common() { - return this.common; - } - - public void set_common(ComponentCommon common) { - this.common = common; - } - - public void unset_common() { - this.common = null; - } - - /** Returns true if field common is set (has been assigned a value) and false otherwise */ - public boolean is_set_common() { - return this.common != null; - } - - public void set_common_isSet(boolean value) { - if (!value) { - this.common = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATE_SPOUT_OBJECT: - if (value == null) { - unset_state_spout_object(); - } else { - set_state_spout_object((ComponentObject)value); - } - break; - - case COMMON: - if (value == null) { - unset_common(); - } else { - set_common((ComponentCommon)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATE_SPOUT_OBJECT: - return get_state_spout_object(); - - case COMMON: - return get_common(); - - } - throw new 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(); - } - - switch (field) { - case STATE_SPOUT_OBJECT: - return is_set_state_spout_object(); - case COMMON: - return is_set_common(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof StateSpoutSpec) - return this.equals((StateSpoutSpec)that); - return false; - } - - public boolean equals(StateSpoutSpec that) { - if (that == null) - return false; - - boolean this_present_state_spout_object = true && this.is_set_state_spout_object(); - boolean that_present_state_spout_object = true && that.is_set_state_spout_object(); - if (this_present_state_spout_object || that_present_state_spout_object) { - if (!(this_present_state_spout_object && that_present_state_spout_object)) - return false; - if (!this.state_spout_object.equals(that.state_spout_object)) - return false; - } - - boolean this_present_common = true && this.is_set_common(); - boolean that_present_common = true && that.is_set_common(); - if (this_present_common || that_present_common) { - if (!(this_present_common && that_present_common)) - return false; - if (!this.common.equals(that.common)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_state_spout_object = true && (is_set_state_spout_object()); - builder.append(present_state_spout_object); - if (present_state_spout_object) - builder.append(state_spout_object); - - boolean present_common = true && (is_set_common()); - builder.append(present_common); - if (present_common) - builder.append(common); - - return builder.toHashCode(); - } - - public int compareTo(StateSpoutSpec other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - StateSpoutSpec typedOther = (StateSpoutSpec)other; - - lastComparison = Boolean.valueOf(is_set_state_spout_object()).compareTo(typedOther.is_set_state_spout_object()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_state_spout_object()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.state_spout_object, typedOther.state_spout_object); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_common()).compareTo(typedOther.is_set_common()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_common()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.common, typedOther.common); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // STATE_SPOUT_OBJECT - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.state_spout_object = new ComponentObject(); - this.state_spout_object.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // COMMON - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.common = new ComponentCommon(); - this.common.read(iprot); - } 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.state_spout_object != null) { - oprot.writeFieldBegin(STATE_SPOUT_OBJECT_FIELD_DESC); - this.state_spout_object.write(oprot); - oprot.writeFieldEnd(); - } - if (this.common != null) { - oprot.writeFieldBegin(COMMON_FIELD_DESC); - this.common.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("StateSpoutSpec("); - boolean first = true; - - sb.append("state_spout_object:"); - if (this.state_spout_object == null) { - sb.append("null"); - } else { - sb.append(this.state_spout_object); - } - first = false; - if (!first) sb.append(", "); - sb.append("common:"); - if (this.common == null) { - sb.append("null"); - } else { - sb.append(this.common); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!is_set_state_spout_object()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'state_spout_object' is unset! Struct:" + toString()); - } - - if (!is_set_common()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'common' is unset! Struct:" + toString()); - } - - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - -} - +/** + * Autogenerated by Thrift Compiler (0.8.0) + * + * 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 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class StateSpoutSpec implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("StateSpoutSpec"); + + private static final org.apache.thrift.protocol.TField STATE_SPOUT_OBJECT_FIELD_DESC = new org.apache.thrift.protocol.TField("state_spout_object", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField COMMON_FIELD_DESC = new org.apache.thrift.protocol.TField("common", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new StateSpoutSpecStandardSchemeFactory()); + schemes.put(TupleScheme.class, new StateSpoutSpecTupleSchemeFactory()); + } + + private ComponentObject state_spout_object; // required + private ComponentCommon common; // 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 { + STATE_SPOUT_OBJECT((short)1, "state_spout_object"), + COMMON((short)2, "common"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // STATE_SPOUT_OBJECT + return STATE_SPOUT_OBJECT; + case 2: // COMMON + return COMMON; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.STATE_SPOUT_OBJECT, new org.apache.thrift.meta_data.FieldMetaData("state_spout_object", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ComponentObject.class))); + tmpMap.put(_Fields.COMMON, new org.apache.thrift.meta_data.FieldMetaData("common", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ComponentCommon.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(StateSpoutSpec.class, metaDataMap); + } + + public StateSpoutSpec() { + } + + public StateSpoutSpec( + ComponentObject state_spout_object, + ComponentCommon common) + { + this(); + this.state_spout_object = state_spout_object; + this.common = common; + } + + /** + * Performs a deep copy on other. + */ + public StateSpoutSpec(StateSpoutSpec other) { + if (other.is_set_state_spout_object()) { + this.state_spout_object = new ComponentObject(other.state_spout_object); + } + if (other.is_set_common()) { + this.common = new ComponentCommon(other.common); + } + } + + public StateSpoutSpec deepCopy() { + return new StateSpoutSpec(this); + } + + @Override + public void clear() { + this.state_spout_object = null; + this.common = null; + } + + public ComponentObject get_state_spout_object() { + return this.state_spout_object; + } + + public void set_state_spout_object(ComponentObject state_spout_object) { + this.state_spout_object = state_spout_object; + } + + public void unset_state_spout_object() { + this.state_spout_object = null; + } + + /** Returns true if field state_spout_object is set (has been assigned a value) and false otherwise */ + public boolean is_set_state_spout_object() { + return this.state_spout_object != null; + } + + public void set_state_spout_object_isSet(boolean value) { + if (!value) { + this.state_spout_object = null; + } + } + + public ComponentCommon get_common() { + return this.common; + } + + public void set_common(ComponentCommon common) { + this.common = common; + } + + public void unset_common() { + this.common = null; + } + + /** Returns true if field common is set (has been assigned a value) and false otherwise */ + public boolean is_set_common() { + return this.common != null; + } + + public void set_common_isSet(boolean value) { + if (!value) { + this.common = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case STATE_SPOUT_OBJECT: + if (value == null) { + unset_state_spout_object(); + } else { + set_state_spout_object((ComponentObject)value); + } + break; + + case COMMON: + if (value == null) { + unset_common(); + } else { + set_common((ComponentCommon)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case STATE_SPOUT_OBJECT: + return get_state_spout_object(); + + case COMMON: + return get_common(); + + } + throw new 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(); + } + + switch (field) { + case STATE_SPOUT_OBJECT: + return is_set_state_spout_object(); + case COMMON: + return is_set_common(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof StateSpoutSpec) + return this.equals((StateSpoutSpec)that); + return false; + } + + public boolean equals(StateSpoutSpec that) { + if (that == null) + return false; + + boolean this_present_state_spout_object = true && this.is_set_state_spout_object(); + boolean that_present_state_spout_object = true && that.is_set_state_spout_object(); + if (this_present_state_spout_object || that_present_state_spout_object) { + if (!(this_present_state_spout_object && that_present_state_spout_object)) + return false; + if (!this.state_spout_object.equals(that.state_spout_object)) + return false; + } + + boolean this_present_common = true && this.is_set_common(); + boolean that_present_common = true && that.is_set_common(); + if (this_present_common || that_present_common) { + if (!(this_present_common && that_present_common)) + return false; + if (!this.common.equals(that.common)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_state_spout_object = true && (is_set_state_spout_object()); + builder.append(present_state_spout_object); + if (present_state_spout_object) + builder.append(state_spout_object); + + boolean present_common = true && (is_set_common()); + builder.append(present_common); + if (present_common) + builder.append(common); + + return builder.toHashCode(); + } + + public int compareTo(StateSpoutSpec other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + StateSpoutSpec typedOther = (StateSpoutSpec)other; + + lastComparison = Boolean.valueOf(is_set_state_spout_object()).compareTo(typedOther.is_set_state_spout_object()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_state_spout_object()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.state_spout_object, typedOther.state_spout_object); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_common()).compareTo(typedOther.is_set_common()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_common()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.common, typedOther.common); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("StateSpoutSpec("); + boolean first = true; + + sb.append("state_spout_object:"); + if (this.state_spout_object == null) { + sb.append("null"); + } else { + sb.append(this.state_spout_object); + } + first = false; + if (!first) sb.append(", "); + sb.append("common:"); + if (this.common == null) { + sb.append("null"); + } else { + sb.append(this.common); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!is_set_state_spout_object()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'state_spout_object' is unset! Struct:" + toString()); + } + + if (!is_set_common()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'common' is unset! Struct:" + toString()); + } + + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 StateSpoutSpecStandardSchemeFactory implements SchemeFactory { + public StateSpoutSpecStandardScheme getScheme() { + return new StateSpoutSpecStandardScheme(); + } + } + + private static class StateSpoutSpecStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, StateSpoutSpec 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: // STATE_SPOUT_OBJECT + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.state_spout_object = new ComponentObject(); + struct.state_spout_object.read(iprot); + struct.set_state_spout_object_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // COMMON + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.common = new ComponentCommon(); + struct.common.read(iprot); + struct.set_common_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, StateSpoutSpec struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.state_spout_object != null) { + oprot.writeFieldBegin(STATE_SPOUT_OBJECT_FIELD_DESC); + struct.state_spout_object.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.common != null) { + oprot.writeFieldBegin(COMMON_FIELD_DESC); + struct.common.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class StateSpoutSpecTupleSchemeFactory implements SchemeFactory { + public StateSpoutSpecTupleScheme getScheme() { + return new StateSpoutSpecTupleScheme(); + } + } + + private static class StateSpoutSpecTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, StateSpoutSpec struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.state_spout_object.write(oprot); + struct.common.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, StateSpoutSpec struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.state_spout_object = new ComponentObject(); + struct.state_spout_object.read(iprot); + struct.set_state_spout_object_isSet(true); + struct.common = new ComponentCommon(); + struct.common.read(iprot); + struct.set_common_isSet(true); + } + } + +} + diff --git a/jstorm-client/src/main/java/backtype/storm/generated/StormTopology.java b/jstorm-client/src/main/java/backtype/storm/generated/StormTopology.java index 60a279c7a..440d228bf 100644 --- a/jstorm-client/src/main/java/backtype/storm/generated/StormTopology.java +++ b/jstorm-client/src/main/java/backtype/storm/generated/StormTopology.java @@ -1,660 +1,778 @@ -/** - * Autogenerated by Thrift Compiler (0.7.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - */ -package backtype.storm.generated; - -import org.apache.commons.lang.builder.HashCodeBuilder; -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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class StormTopology implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("StormTopology"); - - private static final org.apache.thrift.protocol.TField SPOUTS_FIELD_DESC = new org.apache.thrift.protocol.TField("spouts", org.apache.thrift.protocol.TType.MAP, (short)1); - private static final org.apache.thrift.protocol.TField BOLTS_FIELD_DESC = new org.apache.thrift.protocol.TField("bolts", org.apache.thrift.protocol.TType.MAP, (short)2); - private static final org.apache.thrift.protocol.TField STATE_SPOUTS_FIELD_DESC = new org.apache.thrift.protocol.TField("state_spouts", org.apache.thrift.protocol.TType.MAP, (short)3); - - private Map spouts; // required - private Map bolts; // required - private Map state_spouts; // 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 { - SPOUTS((short)1, "spouts"), - BOLTS((short)2, "bolts"), - STATE_SPOUTS((short)3, "state_spouts"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SPOUTS - return SPOUTS; - case 2: // BOLTS - return BOLTS; - case 3: // STATE_SPOUTS - return STATE_SPOUTS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.SPOUTS, new org.apache.thrift.meta_data.FieldMetaData("spouts", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SpoutSpec.class)))); - tmpMap.put(_Fields.BOLTS, new org.apache.thrift.meta_data.FieldMetaData("bolts", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Bolt.class)))); - tmpMap.put(_Fields.STATE_SPOUTS, new org.apache.thrift.meta_data.FieldMetaData("state_spouts", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, StateSpoutSpec.class)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(StormTopology.class, metaDataMap); - } - - public StormTopology() { - } - - public StormTopology( - Map spouts, - Map bolts, - Map state_spouts) - { - this(); - this.spouts = spouts; - this.bolts = bolts; - this.state_spouts = state_spouts; - } - - /** - * Performs a deep copy on other. - */ - public StormTopology(StormTopology other) { - if (other.is_set_spouts()) { - Map __this__spouts = new HashMap(); - for (Map.Entry other_element : other.spouts.entrySet()) { - - String other_element_key = other_element.getKey(); - SpoutSpec other_element_value = other_element.getValue(); - - String __this__spouts_copy_key = other_element_key; - - SpoutSpec __this__spouts_copy_value = new SpoutSpec(other_element_value); - - __this__spouts.put(__this__spouts_copy_key, __this__spouts_copy_value); - } - this.spouts = __this__spouts; - } - if (other.is_set_bolts()) { - Map __this__bolts = new HashMap(); - for (Map.Entry other_element : other.bolts.entrySet()) { - - String other_element_key = other_element.getKey(); - Bolt other_element_value = other_element.getValue(); - - String __this__bolts_copy_key = other_element_key; - - Bolt __this__bolts_copy_value = new Bolt(other_element_value); - - __this__bolts.put(__this__bolts_copy_key, __this__bolts_copy_value); - } - this.bolts = __this__bolts; - } - if (other.is_set_state_spouts()) { - Map __this__state_spouts = new HashMap(); - for (Map.Entry other_element : other.state_spouts.entrySet()) { - - String other_element_key = other_element.getKey(); - StateSpoutSpec other_element_value = other_element.getValue(); - - String __this__state_spouts_copy_key = other_element_key; - - StateSpoutSpec __this__state_spouts_copy_value = new StateSpoutSpec(other_element_value); - - __this__state_spouts.put(__this__state_spouts_copy_key, __this__state_spouts_copy_value); - } - this.state_spouts = __this__state_spouts; - } - } - - public StormTopology deepCopy() { - return new StormTopology(this); - } - - @Override - public void clear() { - this.spouts = null; - this.bolts = null; - this.state_spouts = null; - } - - public int get_spouts_size() { - return (this.spouts == null) ? 0 : this.spouts.size(); - } - - public void put_to_spouts(String key, SpoutSpec val) { - if (this.spouts == null) { - this.spouts = new HashMap(); - } - this.spouts.put(key, val); - } - - public Map get_spouts() { - return this.spouts; - } - - public void set_spouts(Map spouts) { - this.spouts = spouts; - } - - public void unset_spouts() { - this.spouts = null; - } - - /** Returns true if field spouts is set (has been assigned a value) and false otherwise */ - public boolean is_set_spouts() { - return this.spouts != null; - } - - public void set_spouts_isSet(boolean value) { - if (!value) { - this.spouts = null; - } - } - - public int get_bolts_size() { - return (this.bolts == null) ? 0 : this.bolts.size(); - } - - public void put_to_bolts(String key, Bolt val) { - if (this.bolts == null) { - this.bolts = new HashMap(); - } - this.bolts.put(key, val); - } - - public Map get_bolts() { - return this.bolts; - } - - public void set_bolts(Map bolts) { - this.bolts = bolts; - } - - public void unset_bolts() { - this.bolts = null; - } - - /** Returns true if field bolts is set (has been assigned a value) and false otherwise */ - public boolean is_set_bolts() { - return this.bolts != null; - } - - public void set_bolts_isSet(boolean value) { - if (!value) { - this.bolts = null; - } - } - - public int get_state_spouts_size() { - return (this.state_spouts == null) ? 0 : this.state_spouts.size(); - } - - public void put_to_state_spouts(String key, StateSpoutSpec val) { - if (this.state_spouts == null) { - this.state_spouts = new HashMap(); - } - this.state_spouts.put(key, val); - } - - public Map get_state_spouts() { - return this.state_spouts; - } - - public void set_state_spouts(Map state_spouts) { - this.state_spouts = state_spouts; - } - - public void unset_state_spouts() { - this.state_spouts = null; - } - - /** Returns true if field state_spouts is set (has been assigned a value) and false otherwise */ - public boolean is_set_state_spouts() { - return this.state_spouts != null; - } - - public void set_state_spouts_isSet(boolean value) { - if (!value) { - this.state_spouts = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SPOUTS: - if (value == null) { - unset_spouts(); - } else { - set_spouts((Map)value); - } - break; - - case BOLTS: - if (value == null) { - unset_bolts(); - } else { - set_bolts((Map)value); - } - break; - - case STATE_SPOUTS: - if (value == null) { - unset_state_spouts(); - } else { - set_state_spouts((Map)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SPOUTS: - return get_spouts(); - - case BOLTS: - return get_bolts(); - - case STATE_SPOUTS: - return get_state_spouts(); - - } - throw new 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(); - } - - switch (field) { - case SPOUTS: - return is_set_spouts(); - case BOLTS: - return is_set_bolts(); - case STATE_SPOUTS: - return is_set_state_spouts(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof StormTopology) - return this.equals((StormTopology)that); - return false; - } - - public boolean equals(StormTopology that) { - if (that == null) - return false; - - boolean this_present_spouts = true && this.is_set_spouts(); - boolean that_present_spouts = true && that.is_set_spouts(); - if (this_present_spouts || that_present_spouts) { - if (!(this_present_spouts && that_present_spouts)) - return false; - if (!this.spouts.equals(that.spouts)) - return false; - } - - boolean this_present_bolts = true && this.is_set_bolts(); - boolean that_present_bolts = true && that.is_set_bolts(); - if (this_present_bolts || that_present_bolts) { - if (!(this_present_bolts && that_present_bolts)) - return false; - if (!this.bolts.equals(that.bolts)) - return false; - } - - boolean this_present_state_spouts = true && this.is_set_state_spouts(); - boolean that_present_state_spouts = true && that.is_set_state_spouts(); - if (this_present_state_spouts || that_present_state_spouts) { - if (!(this_present_state_spouts && that_present_state_spouts)) - return false; - if (!this.state_spouts.equals(that.state_spouts)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_spouts = true && (is_set_spouts()); - builder.append(present_spouts); - if (present_spouts) - builder.append(spouts); - - boolean present_bolts = true && (is_set_bolts()); - builder.append(present_bolts); - if (present_bolts) - builder.append(bolts); - - boolean present_state_spouts = true && (is_set_state_spouts()); - builder.append(present_state_spouts); - if (present_state_spouts) - builder.append(state_spouts); - - return builder.toHashCode(); - } - - public int compareTo(StormTopology other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - StormTopology typedOther = (StormTopology)other; - - lastComparison = Boolean.valueOf(is_set_spouts()).compareTo(typedOther.is_set_spouts()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_spouts()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.spouts, typedOther.spouts); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_bolts()).compareTo(typedOther.is_set_bolts()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_bolts()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bolts, typedOther.bolts); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_state_spouts()).compareTo(typedOther.is_set_state_spouts()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_state_spouts()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.state_spouts, typedOther.state_spouts); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // SPOUTS - if (field.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map22 = iprot.readMapBegin(); - this.spouts = new HashMap(2*_map22.size); - for (int _i23 = 0; _i23 < _map22.size; ++_i23) - { - String _key24; // required - SpoutSpec _val25; // required - _key24 = iprot.readString(); - _val25 = new SpoutSpec(); - _val25.read(iprot); - this.spouts.put(_key24, _val25); - } - iprot.readMapEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // BOLTS - if (field.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map26 = iprot.readMapBegin(); - this.bolts = new HashMap(2*_map26.size); - for (int _i27 = 0; _i27 < _map26.size; ++_i27) - { - String _key28; // required - Bolt _val29; // required - _key28 = iprot.readString(); - _val29 = new Bolt(); - _val29.read(iprot); - this.bolts.put(_key28, _val29); - } - iprot.readMapEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // STATE_SPOUTS - if (field.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map30 = iprot.readMapBegin(); - this.state_spouts = new HashMap(2*_map30.size); - for (int _i31 = 0; _i31 < _map30.size; ++_i31) - { - String _key32; // required - StateSpoutSpec _val33; // required - _key32 = iprot.readString(); - _val33 = new StateSpoutSpec(); - _val33.read(iprot); - this.state_spouts.put(_key32, _val33); - } - iprot.readMapEnd(); - } - } 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.spouts != null) { - oprot.writeFieldBegin(SPOUTS_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, this.spouts.size())); - for (Map.Entry _iter34 : this.spouts.entrySet()) - { - oprot.writeString(_iter34.getKey()); - _iter34.getValue().write(oprot); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - if (this.bolts != null) { - oprot.writeFieldBegin(BOLTS_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, this.bolts.size())); - for (Map.Entry _iter35 : this.bolts.entrySet()) - { - oprot.writeString(_iter35.getKey()); - _iter35.getValue().write(oprot); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - if (this.state_spouts != null) { - oprot.writeFieldBegin(STATE_SPOUTS_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, this.state_spouts.size())); - for (Map.Entry _iter36 : this.state_spouts.entrySet()) - { - oprot.writeString(_iter36.getKey()); - _iter36.getValue().write(oprot); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("StormTopology("); - boolean first = true; - - sb.append("spouts:"); - if (this.spouts == null) { - sb.append("null"); - } else { - sb.append(this.spouts); - } - first = false; - if (!first) sb.append(", "); - sb.append("bolts:"); - if (this.bolts == null) { - sb.append("null"); - } else { - sb.append(this.bolts); - } - first = false; - if (!first) sb.append(", "); - sb.append("state_spouts:"); - if (this.state_spouts == null) { - sb.append("null"); - } else { - sb.append(this.state_spouts); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!is_set_spouts()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'spouts' is unset! Struct:" + toString()); - } - - if (!is_set_bolts()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'bolts' is unset! Struct:" + toString()); - } - - if (!is_set_state_spouts()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'state_spouts' is unset! Struct:" + toString()); - } - - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - -} - +/** + * Autogenerated by Thrift Compiler (0.8.0) + * + * 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 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class StormTopology implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("StormTopology"); + + private static final org.apache.thrift.protocol.TField SPOUTS_FIELD_DESC = new org.apache.thrift.protocol.TField("spouts", org.apache.thrift.protocol.TType.MAP, (short)1); + private static final org.apache.thrift.protocol.TField BOLTS_FIELD_DESC = new org.apache.thrift.protocol.TField("bolts", org.apache.thrift.protocol.TType.MAP, (short)2); + private static final org.apache.thrift.protocol.TField STATE_SPOUTS_FIELD_DESC = new org.apache.thrift.protocol.TField("state_spouts", org.apache.thrift.protocol.TType.MAP, (short)3); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new StormTopologyStandardSchemeFactory()); + schemes.put(TupleScheme.class, new StormTopologyTupleSchemeFactory()); + } + + private Map spouts; // required + private Map bolts; // required + private Map state_spouts; // 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 { + SPOUTS((short)1, "spouts"), + BOLTS((short)2, "bolts"), + STATE_SPOUTS((short)3, "state_spouts"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // SPOUTS + return SPOUTS; + case 2: // BOLTS + return BOLTS; + case 3: // STATE_SPOUTS + return STATE_SPOUTS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.SPOUTS, new org.apache.thrift.meta_data.FieldMetaData("spouts", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SpoutSpec.class)))); + tmpMap.put(_Fields.BOLTS, new org.apache.thrift.meta_data.FieldMetaData("bolts", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Bolt.class)))); + tmpMap.put(_Fields.STATE_SPOUTS, new org.apache.thrift.meta_data.FieldMetaData("state_spouts", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, StateSpoutSpec.class)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(StormTopology.class, metaDataMap); + } + + public StormTopology() { + } + + public StormTopology( + Map spouts, + Map bolts, + Map state_spouts) + { + this(); + this.spouts = spouts; + this.bolts = bolts; + this.state_spouts = state_spouts; + } + + /** + * Performs a deep copy on other. + */ + public StormTopology(StormTopology other) { + if (other.is_set_spouts()) { + Map __this__spouts = new HashMap(); + for (Map.Entry other_element : other.spouts.entrySet()) { + + String other_element_key = other_element.getKey(); + SpoutSpec other_element_value = other_element.getValue(); + + String __this__spouts_copy_key = other_element_key; + + SpoutSpec __this__spouts_copy_value = new SpoutSpec(other_element_value); + + __this__spouts.put(__this__spouts_copy_key, __this__spouts_copy_value); + } + this.spouts = __this__spouts; + } + if (other.is_set_bolts()) { + Map __this__bolts = new HashMap(); + for (Map.Entry other_element : other.bolts.entrySet()) { + + String other_element_key = other_element.getKey(); + Bolt other_element_value = other_element.getValue(); + + String __this__bolts_copy_key = other_element_key; + + Bolt __this__bolts_copy_value = new Bolt(other_element_value); + + __this__bolts.put(__this__bolts_copy_key, __this__bolts_copy_value); + } + this.bolts = __this__bolts; + } + if (other.is_set_state_spouts()) { + Map __this__state_spouts = new HashMap(); + for (Map.Entry other_element : other.state_spouts.entrySet()) { + + String other_element_key = other_element.getKey(); + StateSpoutSpec other_element_value = other_element.getValue(); + + String __this__state_spouts_copy_key = other_element_key; + + StateSpoutSpec __this__state_spouts_copy_value = new StateSpoutSpec(other_element_value); + + __this__state_spouts.put(__this__state_spouts_copy_key, __this__state_spouts_copy_value); + } + this.state_spouts = __this__state_spouts; + } + } + + public StormTopology deepCopy() { + return new StormTopology(this); + } + + @Override + public void clear() { + this.spouts = null; + this.bolts = null; + this.state_spouts = null; + } + + public int get_spouts_size() { + return (this.spouts == null) ? 0 : this.spouts.size(); + } + + public void put_to_spouts(String key, SpoutSpec val) { + if (this.spouts == null) { + this.spouts = new HashMap(); + } + this.spouts.put(key, val); + } + + public Map get_spouts() { + return this.spouts; + } + + public void set_spouts(Map spouts) { + this.spouts = spouts; + } + + public void unset_spouts() { + this.spouts = null; + } + + /** Returns true if field spouts is set (has been assigned a value) and false otherwise */ + public boolean is_set_spouts() { + return this.spouts != null; + } + + public void set_spouts_isSet(boolean value) { + if (!value) { + this.spouts = null; + } + } + + public int get_bolts_size() { + return (this.bolts == null) ? 0 : this.bolts.size(); + } + + public void put_to_bolts(String key, Bolt val) { + if (this.bolts == null) { + this.bolts = new HashMap(); + } + this.bolts.put(key, val); + } + + public Map get_bolts() { + return this.bolts; + } + + public void set_bolts(Map bolts) { + this.bolts = bolts; + } + + public void unset_bolts() { + this.bolts = null; + } + + /** Returns true if field bolts is set (has been assigned a value) and false otherwise */ + public boolean is_set_bolts() { + return this.bolts != null; + } + + public void set_bolts_isSet(boolean value) { + if (!value) { + this.bolts = null; + } + } + + public int get_state_spouts_size() { + return (this.state_spouts == null) ? 0 : this.state_spouts.size(); + } + + public void put_to_state_spouts(String key, StateSpoutSpec val) { + if (this.state_spouts == null) { + this.state_spouts = new HashMap(); + } + this.state_spouts.put(key, val); + } + + public Map get_state_spouts() { + return this.state_spouts; + } + + public void set_state_spouts(Map state_spouts) { + this.state_spouts = state_spouts; + } + + public void unset_state_spouts() { + this.state_spouts = null; + } + + /** Returns true if field state_spouts is set (has been assigned a value) and false otherwise */ + public boolean is_set_state_spouts() { + return this.state_spouts != null; + } + + public void set_state_spouts_isSet(boolean value) { + if (!value) { + this.state_spouts = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SPOUTS: + if (value == null) { + unset_spouts(); + } else { + set_spouts((Map)value); + } + break; + + case BOLTS: + if (value == null) { + unset_bolts(); + } else { + set_bolts((Map)value); + } + break; + + case STATE_SPOUTS: + if (value == null) { + unset_state_spouts(); + } else { + set_state_spouts((Map)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SPOUTS: + return get_spouts(); + + case BOLTS: + return get_bolts(); + + case STATE_SPOUTS: + return get_state_spouts(); + + } + throw new 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(); + } + + switch (field) { + case SPOUTS: + return is_set_spouts(); + case BOLTS: + return is_set_bolts(); + case STATE_SPOUTS: + return is_set_state_spouts(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof StormTopology) + return this.equals((StormTopology)that); + return false; + } + + public boolean equals(StormTopology that) { + if (that == null) + return false; + + boolean this_present_spouts = true && this.is_set_spouts(); + boolean that_present_spouts = true && that.is_set_spouts(); + if (this_present_spouts || that_present_spouts) { + if (!(this_present_spouts && that_present_spouts)) + return false; + if (!this.spouts.equals(that.spouts)) + return false; + } + + boolean this_present_bolts = true && this.is_set_bolts(); + boolean that_present_bolts = true && that.is_set_bolts(); + if (this_present_bolts || that_present_bolts) { + if (!(this_present_bolts && that_present_bolts)) + return false; + if (!this.bolts.equals(that.bolts)) + return false; + } + + boolean this_present_state_spouts = true && this.is_set_state_spouts(); + boolean that_present_state_spouts = true && that.is_set_state_spouts(); + if (this_present_state_spouts || that_present_state_spouts) { + if (!(this_present_state_spouts && that_present_state_spouts)) + return false; + if (!this.state_spouts.equals(that.state_spouts)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_spouts = true && (is_set_spouts()); + builder.append(present_spouts); + if (present_spouts) + builder.append(spouts); + + boolean present_bolts = true && (is_set_bolts()); + builder.append(present_bolts); + if (present_bolts) + builder.append(bolts); + + boolean present_state_spouts = true && (is_set_state_spouts()); + builder.append(present_state_spouts); + if (present_state_spouts) + builder.append(state_spouts); + + return builder.toHashCode(); + } + + public int compareTo(StormTopology other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + StormTopology typedOther = (StormTopology)other; + + lastComparison = Boolean.valueOf(is_set_spouts()).compareTo(typedOther.is_set_spouts()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_spouts()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.spouts, typedOther.spouts); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_bolts()).compareTo(typedOther.is_set_bolts()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_bolts()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bolts, typedOther.bolts); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_state_spouts()).compareTo(typedOther.is_set_state_spouts()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_state_spouts()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.state_spouts, typedOther.state_spouts); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("StormTopology("); + boolean first = true; + + sb.append("spouts:"); + if (this.spouts == null) { + sb.append("null"); + } else { + sb.append(this.spouts); + } + first = false; + if (!first) sb.append(", "); + sb.append("bolts:"); + if (this.bolts == null) { + sb.append("null"); + } else { + sb.append(this.bolts); + } + first = false; + if (!first) sb.append(", "); + sb.append("state_spouts:"); + if (this.state_spouts == null) { + sb.append("null"); + } else { + sb.append(this.state_spouts); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!is_set_spouts()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'spouts' is unset! Struct:" + toString()); + } + + if (!is_set_bolts()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'bolts' is unset! Struct:" + toString()); + } + + if (!is_set_state_spouts()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'state_spouts' is unset! Struct:" + toString()); + } + + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 StormTopologyStandardSchemeFactory implements SchemeFactory { + public StormTopologyStandardScheme getScheme() { + return new StormTopologyStandardScheme(); + } + } + + private static class StormTopologyStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, StormTopology 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: // SPOUTS + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map44 = iprot.readMapBegin(); + struct.spouts = new HashMap(2*_map44.size); + for (int _i45 = 0; _i45 < _map44.size; ++_i45) + { + String _key46; // required + SpoutSpec _val47; // required + _key46 = iprot.readString(); + _val47 = new SpoutSpec(); + _val47.read(iprot); + struct.spouts.put(_key46, _val47); + } + iprot.readMapEnd(); + } + struct.set_spouts_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // BOLTS + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map48 = iprot.readMapBegin(); + struct.bolts = new HashMap(2*_map48.size); + for (int _i49 = 0; _i49 < _map48.size; ++_i49) + { + String _key50; // required + Bolt _val51; // required + _key50 = iprot.readString(); + _val51 = new Bolt(); + _val51.read(iprot); + struct.bolts.put(_key50, _val51); + } + iprot.readMapEnd(); + } + struct.set_bolts_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // STATE_SPOUTS + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map52 = iprot.readMapBegin(); + struct.state_spouts = new HashMap(2*_map52.size); + for (int _i53 = 0; _i53 < _map52.size; ++_i53) + { + String _key54; // required + StateSpoutSpec _val55; // required + _key54 = iprot.readString(); + _val55 = new StateSpoutSpec(); + _val55.read(iprot); + struct.state_spouts.put(_key54, _val55); + } + iprot.readMapEnd(); + } + struct.set_state_spouts_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, StormTopology struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.spouts != null) { + oprot.writeFieldBegin(SPOUTS_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.spouts.size())); + for (Map.Entry _iter56 : struct.spouts.entrySet()) + { + oprot.writeString(_iter56.getKey()); + _iter56.getValue().write(oprot); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.bolts != null) { + oprot.writeFieldBegin(BOLTS_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.bolts.size())); + for (Map.Entry _iter57 : struct.bolts.entrySet()) + { + oprot.writeString(_iter57.getKey()); + _iter57.getValue().write(oprot); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.state_spouts != null) { + oprot.writeFieldBegin(STATE_SPOUTS_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.state_spouts.size())); + for (Map.Entry _iter58 : struct.state_spouts.entrySet()) + { + oprot.writeString(_iter58.getKey()); + _iter58.getValue().write(oprot); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class StormTopologyTupleSchemeFactory implements SchemeFactory { + public StormTopologyTupleScheme getScheme() { + return new StormTopologyTupleScheme(); + } + } + + private static class StormTopologyTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, StormTopology struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + { + oprot.writeI32(struct.spouts.size()); + for (Map.Entry _iter59 : struct.spouts.entrySet()) + { + oprot.writeString(_iter59.getKey()); + _iter59.getValue().write(oprot); + } + } + { + oprot.writeI32(struct.bolts.size()); + for (Map.Entry _iter60 : struct.bolts.entrySet()) + { + oprot.writeString(_iter60.getKey()); + _iter60.getValue().write(oprot); + } + } + { + oprot.writeI32(struct.state_spouts.size()); + for (Map.Entry _iter61 : struct.state_spouts.entrySet()) + { + oprot.writeString(_iter61.getKey()); + _iter61.getValue().write(oprot); + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, StormTopology struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + { + org.apache.thrift.protocol.TMap _map62 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.spouts = new HashMap(2*_map62.size); + for (int _i63 = 0; _i63 < _map62.size; ++_i63) + { + String _key64; // required + SpoutSpec _val65; // required + _key64 = iprot.readString(); + _val65 = new SpoutSpec(); + _val65.read(iprot); + struct.spouts.put(_key64, _val65); + } + } + struct.set_spouts_isSet(true); + { + org.apache.thrift.protocol.TMap _map66 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.bolts = new HashMap(2*_map66.size); + for (int _i67 = 0; _i67 < _map66.size; ++_i67) + { + String _key68; // required + Bolt _val69; // required + _key68 = iprot.readString(); + _val69 = new Bolt(); + _val69.read(iprot); + struct.bolts.put(_key68, _val69); + } + } + struct.set_bolts_isSet(true); + { + org.apache.thrift.protocol.TMap _map70 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.state_spouts = new HashMap(2*_map70.size); + for (int _i71 = 0; _i71 < _map70.size; ++_i71) + { + String _key72; // required + StateSpoutSpec _val73; // required + _key72 = iprot.readString(); + _val73 = new StateSpoutSpec(); + _val73.read(iprot); + struct.state_spouts.put(_key72, _val73); + } + } + struct.set_state_spouts_isSet(true); + } + } + +} + diff --git a/jstorm-client/src/main/java/backtype/storm/generated/StreamInfo.java b/jstorm-client/src/main/java/backtype/storm/generated/StreamInfo.java index d8791f949..c65a69829 100644 --- a/jstorm-client/src/main/java/backtype/storm/generated/StreamInfo.java +++ b/jstorm-client/src/main/java/backtype/storm/generated/StreamInfo.java @@ -1,462 +1,533 @@ -/** - * Autogenerated by Thrift Compiler (0.7.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - */ -package backtype.storm.generated; - -import org.apache.commons.lang.builder.HashCodeBuilder; -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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class StreamInfo implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("StreamInfo"); - - private static final org.apache.thrift.protocol.TField OUTPUT_FIELDS_FIELD_DESC = new org.apache.thrift.protocol.TField("output_fields", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.protocol.TField DIRECT_FIELD_DESC = new org.apache.thrift.protocol.TField("direct", org.apache.thrift.protocol.TType.BOOL, (short)2); - - private List output_fields; // required - private boolean direct; // 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 { - OUTPUT_FIELDS((short)1, "output_fields"), - DIRECT((short)2, "direct"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // OUTPUT_FIELDS - return OUTPUT_FIELDS; - case 2: // DIRECT - return DIRECT; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __DIRECT_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - - 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); - tmpMap.put(_Fields.OUTPUT_FIELDS, new org.apache.thrift.meta_data.FieldMetaData("output_fields", org.apache.thrift.TFieldRequirementType.REQUIRED, - 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.DIRECT, new org.apache.thrift.meta_data.FieldMetaData("direct", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(StreamInfo.class, metaDataMap); - } - - public StreamInfo() { - } - - public StreamInfo( - List output_fields, - boolean direct) - { - this(); - this.output_fields = output_fields; - this.direct = direct; - set_direct_isSet(true); - } - - /** - * Performs a deep copy on other. - */ - public StreamInfo(StreamInfo other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); - if (other.is_set_output_fields()) { - List __this__output_fields = new ArrayList(); - for (String other_element : other.output_fields) { - __this__output_fields.add(other_element); - } - this.output_fields = __this__output_fields; - } - this.direct = other.direct; - } - - public StreamInfo deepCopy() { - return new StreamInfo(this); - } - - @Override - public void clear() { - this.output_fields = null; - set_direct_isSet(false); - this.direct = false; - } - - public int get_output_fields_size() { - return (this.output_fields == null) ? 0 : this.output_fields.size(); - } - - public java.util.Iterator get_output_fields_iterator() { - return (this.output_fields == null) ? null : this.output_fields.iterator(); - } - - public void add_to_output_fields(String elem) { - if (this.output_fields == null) { - this.output_fields = new ArrayList(); - } - this.output_fields.add(elem); - } - - public List get_output_fields() { - return this.output_fields; - } - - public void set_output_fields(List output_fields) { - this.output_fields = output_fields; - } - - public void unset_output_fields() { - this.output_fields = null; - } - - /** Returns true if field output_fields is set (has been assigned a value) and false otherwise */ - public boolean is_set_output_fields() { - return this.output_fields != null; - } - - public void set_output_fields_isSet(boolean value) { - if (!value) { - this.output_fields = null; - } - } - - public boolean is_direct() { - return this.direct; - } - - public void set_direct(boolean direct) { - this.direct = direct; - set_direct_isSet(true); - } - - public void unset_direct() { - __isset_bit_vector.clear(__DIRECT_ISSET_ID); - } - - /** Returns true if field direct is set (has been assigned a value) and false otherwise */ - public boolean is_set_direct() { - return __isset_bit_vector.get(__DIRECT_ISSET_ID); - } - - public void set_direct_isSet(boolean value) { - __isset_bit_vector.set(__DIRECT_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case OUTPUT_FIELDS: - if (value == null) { - unset_output_fields(); - } else { - set_output_fields((List)value); - } - break; - - case DIRECT: - if (value == null) { - unset_direct(); - } else { - set_direct((Boolean)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case OUTPUT_FIELDS: - return get_output_fields(); - - case DIRECT: - return Boolean.valueOf(is_direct()); - - } - throw new 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(); - } - - switch (field) { - case OUTPUT_FIELDS: - return is_set_output_fields(); - case DIRECT: - return is_set_direct(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof StreamInfo) - return this.equals((StreamInfo)that); - return false; - } - - public boolean equals(StreamInfo that) { - if (that == null) - return false; - - boolean this_present_output_fields = true && this.is_set_output_fields(); - boolean that_present_output_fields = true && that.is_set_output_fields(); - if (this_present_output_fields || that_present_output_fields) { - if (!(this_present_output_fields && that_present_output_fields)) - return false; - if (!this.output_fields.equals(that.output_fields)) - return false; - } - - boolean this_present_direct = true; - boolean that_present_direct = true; - if (this_present_direct || that_present_direct) { - if (!(this_present_direct && that_present_direct)) - return false; - if (this.direct != that.direct) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_output_fields = true && (is_set_output_fields()); - builder.append(present_output_fields); - if (present_output_fields) - builder.append(output_fields); - - boolean present_direct = true; - builder.append(present_direct); - if (present_direct) - builder.append(direct); - - return builder.toHashCode(); - } - - public int compareTo(StreamInfo other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - StreamInfo typedOther = (StreamInfo)other; - - lastComparison = Boolean.valueOf(is_set_output_fields()).compareTo(typedOther.is_set_output_fields()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_output_fields()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.output_fields, typedOther.output_fields); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_direct()).compareTo(typedOther.is_set_direct()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_direct()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.direct, typedOther.direct); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // OUTPUT_FIELDS - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list8 = iprot.readListBegin(); - this.output_fields = new ArrayList(_list8.size); - for (int _i9 = 0; _i9 < _list8.size; ++_i9) - { - String _elem10; // required - _elem10 = iprot.readString(); - this.output_fields.add(_elem10); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // DIRECT - if (field.type == org.apache.thrift.protocol.TType.BOOL) { - this.direct = iprot.readBool(); - set_direct_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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.output_fields != null) { - oprot.writeFieldBegin(OUTPUT_FIELDS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, this.output_fields.size())); - for (String _iter11 : this.output_fields) - { - oprot.writeString(_iter11); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(DIRECT_FIELD_DESC); - oprot.writeBool(this.direct); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("StreamInfo("); - boolean first = true; - - sb.append("output_fields:"); - if (this.output_fields == null) { - sb.append("null"); - } else { - sb.append(this.output_fields); - } - first = false; - if (!first) sb.append(", "); - sb.append("direct:"); - sb.append(this.direct); - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!is_set_output_fields()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'output_fields' is unset! Struct:" + toString()); - } - - if (!is_set_direct()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'direct' is unset! Struct:" + toString()); - } - - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - 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); - 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); - } - } - -} - +/** + * Autogenerated by Thrift Compiler (0.8.0) + * + * 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 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class StreamInfo implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("StreamInfo"); + + private static final org.apache.thrift.protocol.TField OUTPUT_FIELDS_FIELD_DESC = new org.apache.thrift.protocol.TField("output_fields", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField DIRECT_FIELD_DESC = new org.apache.thrift.protocol.TField("direct", org.apache.thrift.protocol.TType.BOOL, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new StreamInfoStandardSchemeFactory()); + schemes.put(TupleScheme.class, new StreamInfoTupleSchemeFactory()); + } + + private List output_fields; // required + private boolean direct; // 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 { + OUTPUT_FIELDS((short)1, "output_fields"), + DIRECT((short)2, "direct"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // OUTPUT_FIELDS + return OUTPUT_FIELDS; + case 2: // DIRECT + return DIRECT; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __DIRECT_ISSET_ID = 0; + private BitSet __isset_bit_vector = new BitSet(1); + 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); + tmpMap.put(_Fields.OUTPUT_FIELDS, new org.apache.thrift.meta_data.FieldMetaData("output_fields", org.apache.thrift.TFieldRequirementType.REQUIRED, + 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.DIRECT, new org.apache.thrift.meta_data.FieldMetaData("direct", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(StreamInfo.class, metaDataMap); + } + + public StreamInfo() { + } + + public StreamInfo( + List output_fields, + boolean direct) + { + this(); + this.output_fields = output_fields; + this.direct = direct; + set_direct_isSet(true); + } + + /** + * Performs a deep copy on other. + */ + public StreamInfo(StreamInfo other) { + __isset_bit_vector.clear(); + __isset_bit_vector.or(other.__isset_bit_vector); + if (other.is_set_output_fields()) { + List __this__output_fields = new ArrayList(); + for (String other_element : other.output_fields) { + __this__output_fields.add(other_element); + } + this.output_fields = __this__output_fields; + } + this.direct = other.direct; + } + + public StreamInfo deepCopy() { + return new StreamInfo(this); + } + + @Override + public void clear() { + this.output_fields = null; + set_direct_isSet(false); + this.direct = false; + } + + public int get_output_fields_size() { + return (this.output_fields == null) ? 0 : this.output_fields.size(); + } + + public java.util.Iterator get_output_fields_iterator() { + return (this.output_fields == null) ? null : this.output_fields.iterator(); + } + + public void add_to_output_fields(String elem) { + if (this.output_fields == null) { + this.output_fields = new ArrayList(); + } + this.output_fields.add(elem); + } + + public List get_output_fields() { + return this.output_fields; + } + + public void set_output_fields(List output_fields) { + this.output_fields = output_fields; + } + + public void unset_output_fields() { + this.output_fields = null; + } + + /** Returns true if field output_fields is set (has been assigned a value) and false otherwise */ + public boolean is_set_output_fields() { + return this.output_fields != null; + } + + public void set_output_fields_isSet(boolean value) { + if (!value) { + this.output_fields = null; + } + } + + public boolean is_direct() { + return this.direct; + } + + public void set_direct(boolean direct) { + this.direct = direct; + set_direct_isSet(true); + } + + public void unset_direct() { + __isset_bit_vector.clear(__DIRECT_ISSET_ID); + } + + /** Returns true if field direct is set (has been assigned a value) and false otherwise */ + public boolean is_set_direct() { + return __isset_bit_vector.get(__DIRECT_ISSET_ID); + } + + public void set_direct_isSet(boolean value) { + __isset_bit_vector.set(__DIRECT_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case OUTPUT_FIELDS: + if (value == null) { + unset_output_fields(); + } else { + set_output_fields((List)value); + } + break; + + case DIRECT: + if (value == null) { + unset_direct(); + } else { + set_direct((Boolean)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case OUTPUT_FIELDS: + return get_output_fields(); + + case DIRECT: + return Boolean.valueOf(is_direct()); + + } + throw new 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(); + } + + switch (field) { + case OUTPUT_FIELDS: + return is_set_output_fields(); + case DIRECT: + return is_set_direct(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof StreamInfo) + return this.equals((StreamInfo)that); + return false; + } + + public boolean equals(StreamInfo that) { + if (that == null) + return false; + + boolean this_present_output_fields = true && this.is_set_output_fields(); + boolean that_present_output_fields = true && that.is_set_output_fields(); + if (this_present_output_fields || that_present_output_fields) { + if (!(this_present_output_fields && that_present_output_fields)) + return false; + if (!this.output_fields.equals(that.output_fields)) + return false; + } + + boolean this_present_direct = true; + boolean that_present_direct = true; + if (this_present_direct || that_present_direct) { + if (!(this_present_direct && that_present_direct)) + return false; + if (this.direct != that.direct) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_output_fields = true && (is_set_output_fields()); + builder.append(present_output_fields); + if (present_output_fields) + builder.append(output_fields); + + boolean present_direct = true; + builder.append(present_direct); + if (present_direct) + builder.append(direct); + + return builder.toHashCode(); + } + + public int compareTo(StreamInfo other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + StreamInfo typedOther = (StreamInfo)other; + + lastComparison = Boolean.valueOf(is_set_output_fields()).compareTo(typedOther.is_set_output_fields()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_output_fields()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.output_fields, typedOther.output_fields); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_direct()).compareTo(typedOther.is_set_direct()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_direct()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.direct, typedOther.direct); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("StreamInfo("); + boolean first = true; + + sb.append("output_fields:"); + if (this.output_fields == null) { + sb.append("null"); + } else { + sb.append(this.output_fields); + } + first = false; + if (!first) sb.append(", "); + sb.append("direct:"); + sb.append(this.direct); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!is_set_output_fields()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'output_fields' is unset! Struct:" + toString()); + } + + if (!is_set_direct()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'direct' is unset! Struct:" + toString()); + } + + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + 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); + 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 StreamInfoStandardSchemeFactory implements SchemeFactory { + public StreamInfoStandardScheme getScheme() { + return new StreamInfoStandardScheme(); + } + } + + private static class StreamInfoStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, StreamInfo 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: // OUTPUT_FIELDS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list16 = iprot.readListBegin(); + struct.output_fields = new ArrayList(_list16.size); + for (int _i17 = 0; _i17 < _list16.size; ++_i17) + { + String _elem18; // required + _elem18 = iprot.readString(); + struct.output_fields.add(_elem18); + } + iprot.readListEnd(); + } + struct.set_output_fields_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // DIRECT + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.direct = iprot.readBool(); + struct.set_direct_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, StreamInfo struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.output_fields != null) { + oprot.writeFieldBegin(OUTPUT_FIELDS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.output_fields.size())); + for (String _iter19 : struct.output_fields) + { + oprot.writeString(_iter19); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(DIRECT_FIELD_DESC); + oprot.writeBool(struct.direct); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class StreamInfoTupleSchemeFactory implements SchemeFactory { + public StreamInfoTupleScheme getScheme() { + return new StreamInfoTupleScheme(); + } + } + + private static class StreamInfoTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, StreamInfo struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + { + oprot.writeI32(struct.output_fields.size()); + for (String _iter20 : struct.output_fields) + { + oprot.writeString(_iter20); + } + } + oprot.writeBool(struct.direct); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, StreamInfo struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + { + org.apache.thrift.protocol.TList _list21 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.output_fields = new ArrayList(_list21.size); + for (int _i22 = 0; _i22 < _list21.size; ++_i22) + { + String _elem23; // required + _elem23 = iprot.readString(); + struct.output_fields.add(_elem23); + } + } + struct.set_output_fields_isSet(true); + struct.direct = iprot.readBool(); + struct.set_direct_isSet(true); + } + } + +} + diff --git a/jstorm-client/src/main/java/backtype/storm/generated/SupervisorSummary.java b/jstorm-client/src/main/java/backtype/storm/generated/SupervisorSummary.java index 7f7666325..559f5ba94 100644 --- a/jstorm-client/src/main/java/backtype/storm/generated/SupervisorSummary.java +++ b/jstorm-client/src/main/java/backtype/storm/generated/SupervisorSummary.java @@ -1,609 +1,671 @@ -/** - * Autogenerated by Thrift Compiler (0.7.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - */ -package backtype.storm.generated; - -import org.apache.commons.lang.builder.HashCodeBuilder; -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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class SupervisorSummary implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SupervisorSummary"); - - private static final org.apache.thrift.protocol.TField HOST_FIELD_DESC = new org.apache.thrift.protocol.TField("host", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField UPTIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("uptime_secs", org.apache.thrift.protocol.TType.I32, (short)2); - private static final org.apache.thrift.protocol.TField NUM_WORKERS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_workers", org.apache.thrift.protocol.TType.I32, (short)3); - private static final org.apache.thrift.protocol.TField NUM_USED_WORKERS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_used_workers", org.apache.thrift.protocol.TType.I32, (short)4); - - private String host; // required - private int uptime_secs; // required - private int num_workers; // required - private int num_used_workers; // 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 { - HOST((short)1, "host"), - UPTIME_SECS((short)2, "uptime_secs"), - NUM_WORKERS((short)3, "num_workers"), - NUM_USED_WORKERS((short)4, "num_used_workers"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // HOST - return HOST; - case 2: // UPTIME_SECS - return UPTIME_SECS; - case 3: // NUM_WORKERS - return NUM_WORKERS; - case 4: // NUM_USED_WORKERS - return NUM_USED_WORKERS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __UPTIME_SECS_ISSET_ID = 0; - private static final int __NUM_WORKERS_ISSET_ID = 1; - private static final int __NUM_USED_WORKERS_ISSET_ID = 2; - private BitSet __isset_bit_vector = new BitSet(3); - - 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); - tmpMap.put(_Fields.HOST, new org.apache.thrift.meta_data.FieldMetaData("host", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.UPTIME_SECS, new org.apache.thrift.meta_data.FieldMetaData("uptime_secs", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.NUM_WORKERS, new org.apache.thrift.meta_data.FieldMetaData("num_workers", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.NUM_USED_WORKERS, new org.apache.thrift.meta_data.FieldMetaData("num_used_workers", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SupervisorSummary.class, metaDataMap); - } - - public SupervisorSummary() { - } - - public SupervisorSummary( - String host, - int uptime_secs, - int num_workers, - int num_used_workers) - { - this(); - this.host = host; - this.uptime_secs = uptime_secs; - set_uptime_secs_isSet(true); - this.num_workers = num_workers; - set_num_workers_isSet(true); - this.num_used_workers = num_used_workers; - set_num_used_workers_isSet(true); - } - - /** - * Performs a deep copy on other. - */ - public SupervisorSummary(SupervisorSummary other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); - if (other.is_set_host()) { - this.host = other.host; - } - this.uptime_secs = other.uptime_secs; - this.num_workers = other.num_workers; - this.num_used_workers = other.num_used_workers; - } - - public SupervisorSummary deepCopy() { - return new SupervisorSummary(this); - } - - @Override - public void clear() { - this.host = null; - set_uptime_secs_isSet(false); - this.uptime_secs = 0; - set_num_workers_isSet(false); - this.num_workers = 0; - set_num_used_workers_isSet(false); - this.num_used_workers = 0; - } - - public String get_host() { - return this.host; - } - - public void set_host(String host) { - this.host = host; - } - - public void unset_host() { - this.host = null; - } - - /** Returns true if field host is set (has been assigned a value) and false otherwise */ - public boolean is_set_host() { - return this.host != null; - } - - public void set_host_isSet(boolean value) { - if (!value) { - this.host = null; - } - } - - public int get_uptime_secs() { - return this.uptime_secs; - } - - public void set_uptime_secs(int uptime_secs) { - this.uptime_secs = uptime_secs; - set_uptime_secs_isSet(true); - } - - public void unset_uptime_secs() { - __isset_bit_vector.clear(__UPTIME_SECS_ISSET_ID); - } - - /** Returns true if field uptime_secs is set (has been assigned a value) and false otherwise */ - public boolean is_set_uptime_secs() { - return __isset_bit_vector.get(__UPTIME_SECS_ISSET_ID); - } - - public void set_uptime_secs_isSet(boolean value) { - __isset_bit_vector.set(__UPTIME_SECS_ISSET_ID, value); - } - - public int get_num_workers() { - return this.num_workers; - } - - public void set_num_workers(int num_workers) { - this.num_workers = num_workers; - set_num_workers_isSet(true); - } - - public void unset_num_workers() { - __isset_bit_vector.clear(__NUM_WORKERS_ISSET_ID); - } - - /** Returns true if field num_workers is set (has been assigned a value) and false otherwise */ - public boolean is_set_num_workers() { - return __isset_bit_vector.get(__NUM_WORKERS_ISSET_ID); - } - - public void set_num_workers_isSet(boolean value) { - __isset_bit_vector.set(__NUM_WORKERS_ISSET_ID, value); - } - - public int get_num_used_workers() { - return this.num_used_workers; - } - - public void set_num_used_workers(int num_used_workers) { - this.num_used_workers = num_used_workers; - set_num_used_workers_isSet(true); - } - - public void unset_num_used_workers() { - __isset_bit_vector.clear(__NUM_USED_WORKERS_ISSET_ID); - } - - /** Returns true if field num_used_workers is set (has been assigned a value) and false otherwise */ - public boolean is_set_num_used_workers() { - return __isset_bit_vector.get(__NUM_USED_WORKERS_ISSET_ID); - } - - public void set_num_used_workers_isSet(boolean value) { - __isset_bit_vector.set(__NUM_USED_WORKERS_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case HOST: - if (value == null) { - unset_host(); - } else { - set_host((String)value); - } - break; - - case UPTIME_SECS: - if (value == null) { - unset_uptime_secs(); - } else { - set_uptime_secs((Integer)value); - } - break; - - case NUM_WORKERS: - if (value == null) { - unset_num_workers(); - } else { - set_num_workers((Integer)value); - } - break; - - case NUM_USED_WORKERS: - if (value == null) { - unset_num_used_workers(); - } else { - set_num_used_workers((Integer)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case HOST: - return get_host(); - - case UPTIME_SECS: - return Integer.valueOf(get_uptime_secs()); - - case NUM_WORKERS: - return Integer.valueOf(get_num_workers()); - - case NUM_USED_WORKERS: - return Integer.valueOf(get_num_used_workers()); - - } - throw new 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(); - } - - switch (field) { - case HOST: - return is_set_host(); - case UPTIME_SECS: - return is_set_uptime_secs(); - case NUM_WORKERS: - return is_set_num_workers(); - case NUM_USED_WORKERS: - return is_set_num_used_workers(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof SupervisorSummary) - return this.equals((SupervisorSummary)that); - return false; - } - - public boolean equals(SupervisorSummary that) { - if (that == null) - return false; - - boolean this_present_host = true && this.is_set_host(); - boolean that_present_host = true && that.is_set_host(); - if (this_present_host || that_present_host) { - if (!(this_present_host && that_present_host)) - return false; - if (!this.host.equals(that.host)) - return false; - } - - boolean this_present_uptime_secs = true; - boolean that_present_uptime_secs = true; - if (this_present_uptime_secs || that_present_uptime_secs) { - if (!(this_present_uptime_secs && that_present_uptime_secs)) - return false; - if (this.uptime_secs != that.uptime_secs) - return false; - } - - boolean this_present_num_workers = true; - boolean that_present_num_workers = true; - if (this_present_num_workers || that_present_num_workers) { - if (!(this_present_num_workers && that_present_num_workers)) - return false; - if (this.num_workers != that.num_workers) - return false; - } - - boolean this_present_num_used_workers = true; - boolean that_present_num_used_workers = true; - if (this_present_num_used_workers || that_present_num_used_workers) { - if (!(this_present_num_used_workers && that_present_num_used_workers)) - return false; - if (this.num_used_workers != that.num_used_workers) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_host = true && (is_set_host()); - builder.append(present_host); - if (present_host) - builder.append(host); - - boolean present_uptime_secs = true; - builder.append(present_uptime_secs); - if (present_uptime_secs) - builder.append(uptime_secs); - - boolean present_num_workers = true; - builder.append(present_num_workers); - if (present_num_workers) - builder.append(num_workers); - - boolean present_num_used_workers = true; - builder.append(present_num_used_workers); - if (present_num_used_workers) - builder.append(num_used_workers); - - return builder.toHashCode(); - } - - public int compareTo(SupervisorSummary other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - SupervisorSummary typedOther = (SupervisorSummary)other; - - lastComparison = Boolean.valueOf(is_set_host()).compareTo(typedOther.is_set_host()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_host()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.host, typedOther.host); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_uptime_secs()).compareTo(typedOther.is_set_uptime_secs()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_uptime_secs()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uptime_secs, typedOther.uptime_secs); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_num_workers()).compareTo(typedOther.is_set_num_workers()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_num_workers()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_workers, typedOther.num_workers); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_num_used_workers()).compareTo(typedOther.is_set_num_used_workers()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_num_used_workers()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_used_workers, typedOther.num_used_workers); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // HOST - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.host = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // UPTIME_SECS - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.uptime_secs = iprot.readI32(); - set_uptime_secs_isSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // NUM_WORKERS - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.num_workers = iprot.readI32(); - set_num_workers_isSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // NUM_USED_WORKERS - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.num_used_workers = iprot.readI32(); - set_num_used_workers_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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.host != null) { - oprot.writeFieldBegin(HOST_FIELD_DESC); - oprot.writeString(this.host); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(UPTIME_SECS_FIELD_DESC); - oprot.writeI32(this.uptime_secs); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(NUM_WORKERS_FIELD_DESC); - oprot.writeI32(this.num_workers); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(NUM_USED_WORKERS_FIELD_DESC); - oprot.writeI32(this.num_used_workers); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("SupervisorSummary("); - boolean first = true; - - sb.append("host:"); - if (this.host == null) { - sb.append("null"); - } else { - sb.append(this.host); - } - first = false; - if (!first) sb.append(", "); - sb.append("uptime_secs:"); - sb.append(this.uptime_secs); - first = false; - if (!first) sb.append(", "); - sb.append("num_workers:"); - sb.append(this.num_workers); - first = false; - if (!first) sb.append(", "); - sb.append("num_used_workers:"); - sb.append(this.num_used_workers); - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!is_set_host()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'host' is unset! Struct:" + toString()); - } - - if (!is_set_uptime_secs()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'uptime_secs' is unset! Struct:" + toString()); - } - - if (!is_set_num_workers()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'num_workers' is unset! Struct:" + toString()); - } - - if (!is_set_num_used_workers()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'num_used_workers' is unset! Struct:" + toString()); - } - - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - 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); - 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); - } - } - -} - +/** + * Autogenerated by Thrift Compiler (0.8.0) + * + * 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 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SupervisorSummary implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SupervisorSummary"); + + private static final org.apache.thrift.protocol.TField HOST_FIELD_DESC = new org.apache.thrift.protocol.TField("host", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField UPTIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("uptime_secs", org.apache.thrift.protocol.TType.I32, (short)2); + private static final org.apache.thrift.protocol.TField NUM_WORKERS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_workers", org.apache.thrift.protocol.TType.I32, (short)3); + private static final org.apache.thrift.protocol.TField NUM_USED_WORKERS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_used_workers", org.apache.thrift.protocol.TType.I32, (short)4); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new SupervisorSummaryStandardSchemeFactory()); + schemes.put(TupleScheme.class, new SupervisorSummaryTupleSchemeFactory()); + } + + private String host; // required + private int uptime_secs; // required + private int num_workers; // required + private int num_used_workers; // 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 { + HOST((short)1, "host"), + UPTIME_SECS((short)2, "uptime_secs"), + NUM_WORKERS((short)3, "num_workers"), + NUM_USED_WORKERS((short)4, "num_used_workers"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // HOST + return HOST; + case 2: // UPTIME_SECS + return UPTIME_SECS; + case 3: // NUM_WORKERS + return NUM_WORKERS; + case 4: // NUM_USED_WORKERS + return NUM_USED_WORKERS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __UPTIME_SECS_ISSET_ID = 0; + private static final int __NUM_WORKERS_ISSET_ID = 1; + private static final int __NUM_USED_WORKERS_ISSET_ID = 2; + private BitSet __isset_bit_vector = new BitSet(3); + 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); + tmpMap.put(_Fields.HOST, new org.apache.thrift.meta_data.FieldMetaData("host", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.UPTIME_SECS, new org.apache.thrift.meta_data.FieldMetaData("uptime_secs", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.NUM_WORKERS, new org.apache.thrift.meta_data.FieldMetaData("num_workers", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.NUM_USED_WORKERS, new org.apache.thrift.meta_data.FieldMetaData("num_used_workers", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SupervisorSummary.class, metaDataMap); + } + + public SupervisorSummary() { + } + + public SupervisorSummary( + String host, + int uptime_secs, + int num_workers, + int num_used_workers) + { + this(); + this.host = host; + this.uptime_secs = uptime_secs; + set_uptime_secs_isSet(true); + this.num_workers = num_workers; + set_num_workers_isSet(true); + this.num_used_workers = num_used_workers; + set_num_used_workers_isSet(true); + } + + /** + * Performs a deep copy on other. + */ + public SupervisorSummary(SupervisorSummary other) { + __isset_bit_vector.clear(); + __isset_bit_vector.or(other.__isset_bit_vector); + if (other.is_set_host()) { + this.host = other.host; + } + this.uptime_secs = other.uptime_secs; + this.num_workers = other.num_workers; + this.num_used_workers = other.num_used_workers; + } + + public SupervisorSummary deepCopy() { + return new SupervisorSummary(this); + } + + @Override + public void clear() { + this.host = null; + set_uptime_secs_isSet(false); + this.uptime_secs = 0; + set_num_workers_isSet(false); + this.num_workers = 0; + set_num_used_workers_isSet(false); + this.num_used_workers = 0; + } + + public String get_host() { + return this.host; + } + + public void set_host(String host) { + this.host = host; + } + + public void unset_host() { + this.host = null; + } + + /** Returns true if field host is set (has been assigned a value) and false otherwise */ + public boolean is_set_host() { + return this.host != null; + } + + public void set_host_isSet(boolean value) { + if (!value) { + this.host = null; + } + } + + public int get_uptime_secs() { + return this.uptime_secs; + } + + public void set_uptime_secs(int uptime_secs) { + this.uptime_secs = uptime_secs; + set_uptime_secs_isSet(true); + } + + public void unset_uptime_secs() { + __isset_bit_vector.clear(__UPTIME_SECS_ISSET_ID); + } + + /** Returns true if field uptime_secs is set (has been assigned a value) and false otherwise */ + public boolean is_set_uptime_secs() { + return __isset_bit_vector.get(__UPTIME_SECS_ISSET_ID); + } + + public void set_uptime_secs_isSet(boolean value) { + __isset_bit_vector.set(__UPTIME_SECS_ISSET_ID, value); + } + + public int get_num_workers() { + return this.num_workers; + } + + public void set_num_workers(int num_workers) { + this.num_workers = num_workers; + set_num_workers_isSet(true); + } + + public void unset_num_workers() { + __isset_bit_vector.clear(__NUM_WORKERS_ISSET_ID); + } + + /** Returns true if field num_workers is set (has been assigned a value) and false otherwise */ + public boolean is_set_num_workers() { + return __isset_bit_vector.get(__NUM_WORKERS_ISSET_ID); + } + + public void set_num_workers_isSet(boolean value) { + __isset_bit_vector.set(__NUM_WORKERS_ISSET_ID, value); + } + + public int get_num_used_workers() { + return this.num_used_workers; + } + + public void set_num_used_workers(int num_used_workers) { + this.num_used_workers = num_used_workers; + set_num_used_workers_isSet(true); + } + + public void unset_num_used_workers() { + __isset_bit_vector.clear(__NUM_USED_WORKERS_ISSET_ID); + } + + /** Returns true if field num_used_workers is set (has been assigned a value) and false otherwise */ + public boolean is_set_num_used_workers() { + return __isset_bit_vector.get(__NUM_USED_WORKERS_ISSET_ID); + } + + public void set_num_used_workers_isSet(boolean value) { + __isset_bit_vector.set(__NUM_USED_WORKERS_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case HOST: + if (value == null) { + unset_host(); + } else { + set_host((String)value); + } + break; + + case UPTIME_SECS: + if (value == null) { + unset_uptime_secs(); + } else { + set_uptime_secs((Integer)value); + } + break; + + case NUM_WORKERS: + if (value == null) { + unset_num_workers(); + } else { + set_num_workers((Integer)value); + } + break; + + case NUM_USED_WORKERS: + if (value == null) { + unset_num_used_workers(); + } else { + set_num_used_workers((Integer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case HOST: + return get_host(); + + case UPTIME_SECS: + return Integer.valueOf(get_uptime_secs()); + + case NUM_WORKERS: + return Integer.valueOf(get_num_workers()); + + case NUM_USED_WORKERS: + return Integer.valueOf(get_num_used_workers()); + + } + throw new 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(); + } + + switch (field) { + case HOST: + return is_set_host(); + case UPTIME_SECS: + return is_set_uptime_secs(); + case NUM_WORKERS: + return is_set_num_workers(); + case NUM_USED_WORKERS: + return is_set_num_used_workers(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof SupervisorSummary) + return this.equals((SupervisorSummary)that); + return false; + } + + public boolean equals(SupervisorSummary that) { + if (that == null) + return false; + + boolean this_present_host = true && this.is_set_host(); + boolean that_present_host = true && that.is_set_host(); + if (this_present_host || that_present_host) { + if (!(this_present_host && that_present_host)) + return false; + if (!this.host.equals(that.host)) + return false; + } + + boolean this_present_uptime_secs = true; + boolean that_present_uptime_secs = true; + if (this_present_uptime_secs || that_present_uptime_secs) { + if (!(this_present_uptime_secs && that_present_uptime_secs)) + return false; + if (this.uptime_secs != that.uptime_secs) + return false; + } + + boolean this_present_num_workers = true; + boolean that_present_num_workers = true; + if (this_present_num_workers || that_present_num_workers) { + if (!(this_present_num_workers && that_present_num_workers)) + return false; + if (this.num_workers != that.num_workers) + return false; + } + + boolean this_present_num_used_workers = true; + boolean that_present_num_used_workers = true; + if (this_present_num_used_workers || that_present_num_used_workers) { + if (!(this_present_num_used_workers && that_present_num_used_workers)) + return false; + if (this.num_used_workers != that.num_used_workers) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_host = true && (is_set_host()); + builder.append(present_host); + if (present_host) + builder.append(host); + + boolean present_uptime_secs = true; + builder.append(present_uptime_secs); + if (present_uptime_secs) + builder.append(uptime_secs); + + boolean present_num_workers = true; + builder.append(present_num_workers); + if (present_num_workers) + builder.append(num_workers); + + boolean present_num_used_workers = true; + builder.append(present_num_used_workers); + if (present_num_used_workers) + builder.append(num_used_workers); + + return builder.toHashCode(); + } + + public int compareTo(SupervisorSummary other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + SupervisorSummary typedOther = (SupervisorSummary)other; + + lastComparison = Boolean.valueOf(is_set_host()).compareTo(typedOther.is_set_host()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_host()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.host, typedOther.host); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_uptime_secs()).compareTo(typedOther.is_set_uptime_secs()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_uptime_secs()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uptime_secs, typedOther.uptime_secs); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_num_workers()).compareTo(typedOther.is_set_num_workers()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_num_workers()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_workers, typedOther.num_workers); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_num_used_workers()).compareTo(typedOther.is_set_num_used_workers()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_num_used_workers()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_used_workers, typedOther.num_used_workers); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("SupervisorSummary("); + boolean first = true; + + sb.append("host:"); + if (this.host == null) { + sb.append("null"); + } else { + sb.append(this.host); + } + first = false; + if (!first) sb.append(", "); + sb.append("uptime_secs:"); + sb.append(this.uptime_secs); + first = false; + if (!first) sb.append(", "); + sb.append("num_workers:"); + sb.append(this.num_workers); + first = false; + if (!first) sb.append(", "); + sb.append("num_used_workers:"); + sb.append(this.num_used_workers); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!is_set_host()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'host' is unset! Struct:" + toString()); + } + + if (!is_set_uptime_secs()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'uptime_secs' is unset! Struct:" + toString()); + } + + if (!is_set_num_workers()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'num_workers' is unset! Struct:" + toString()); + } + + if (!is_set_num_used_workers()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'num_used_workers' is unset! Struct:" + toString()); + } + + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + 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); + 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 SupervisorSummaryStandardSchemeFactory implements SchemeFactory { + public SupervisorSummaryStandardScheme getScheme() { + return new SupervisorSummaryStandardScheme(); + } + } + + private static class SupervisorSummaryStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, SupervisorSummary 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: // HOST + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.host = iprot.readString(); + struct.set_host_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // UPTIME_SECS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.uptime_secs = iprot.readI32(); + struct.set_uptime_secs_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // NUM_WORKERS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.num_workers = iprot.readI32(); + struct.set_num_workers_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // NUM_USED_WORKERS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.num_used_workers = iprot.readI32(); + struct.set_num_used_workers_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, SupervisorSummary struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.host != null) { + oprot.writeFieldBegin(HOST_FIELD_DESC); + oprot.writeString(struct.host); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(UPTIME_SECS_FIELD_DESC); + oprot.writeI32(struct.uptime_secs); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(NUM_WORKERS_FIELD_DESC); + oprot.writeI32(struct.num_workers); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(NUM_USED_WORKERS_FIELD_DESC); + oprot.writeI32(struct.num_used_workers); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class SupervisorSummaryTupleSchemeFactory implements SchemeFactory { + public SupervisorSummaryTupleScheme getScheme() { + return new SupervisorSummaryTupleScheme(); + } + } + + private static class SupervisorSummaryTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, SupervisorSummary struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.host); + oprot.writeI32(struct.uptime_secs); + oprot.writeI32(struct.num_workers); + oprot.writeI32(struct.num_used_workers); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, SupervisorSummary struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.host = iprot.readString(); + struct.set_host_isSet(true); + struct.uptime_secs = iprot.readI32(); + struct.set_uptime_secs_isSet(true); + struct.num_workers = iprot.readI32(); + struct.set_num_workers_isSet(true); + struct.num_used_workers = iprot.readI32(); + struct.set_num_used_workers_isSet(true); + } + } + +} + diff --git a/jstorm-client/src/main/java/backtype/storm/generated/SupervisorWorkers.java b/jstorm-client/src/main/java/backtype/storm/generated/SupervisorWorkers.java index 54a13ab6c..ad6153cb1 100644 --- a/jstorm-client/src/main/java/backtype/storm/generated/SupervisorWorkers.java +++ b/jstorm-client/src/main/java/backtype/storm/generated/SupervisorWorkers.java @@ -1,464 +1,538 @@ -/** - * Autogenerated by Thrift Compiler (0.7.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - */ -package backtype.storm.generated; - -import org.apache.commons.lang.builder.HashCodeBuilder; -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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class SupervisorWorkers implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SupervisorWorkers"); - - private static final org.apache.thrift.protocol.TField SUPERVISOR_FIELD_DESC = new org.apache.thrift.protocol.TField("supervisor", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField WORKERS_FIELD_DESC = new org.apache.thrift.protocol.TField("workers", org.apache.thrift.protocol.TType.LIST, (short)2); - - private SupervisorSummary supervisor; // required - private List workers; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUPERVISOR((short)1, "supervisor"), - WORKERS((short)2, "workers"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SUPERVISOR - return SUPERVISOR; - case 2: // WORKERS - return WORKERS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.SUPERVISOR, new org.apache.thrift.meta_data.FieldMetaData("supervisor", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SupervisorSummary.class))); - tmpMap.put(_Fields.WORKERS, new org.apache.thrift.meta_data.FieldMetaData("workers", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, WorkerSummary.class)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SupervisorWorkers.class, metaDataMap); - } - - public SupervisorWorkers() { - } - - public SupervisorWorkers( - SupervisorSummary supervisor, - List workers) - { - this(); - this.supervisor = supervisor; - this.workers = workers; - } - - /** - * Performs a deep copy on other. - */ - public SupervisorWorkers(SupervisorWorkers other) { - if (other.is_set_supervisor()) { - this.supervisor = new SupervisorSummary(other.supervisor); - } - if (other.is_set_workers()) { - List __this__workers = new ArrayList(); - for (WorkerSummary other_element : other.workers) { - __this__workers.add(new WorkerSummary(other_element)); - } - this.workers = __this__workers; - } - } - - public SupervisorWorkers deepCopy() { - return new SupervisorWorkers(this); - } - - @Override - public void clear() { - this.supervisor = null; - this.workers = null; - } - - public SupervisorSummary get_supervisor() { - return this.supervisor; - } - - public void set_supervisor(SupervisorSummary supervisor) { - this.supervisor = supervisor; - } - - public void unset_supervisor() { - this.supervisor = null; - } - - /** Returns true if field supervisor is set (has been assigned a value) and false otherwise */ - public boolean is_set_supervisor() { - return this.supervisor != null; - } - - public void set_supervisor_isSet(boolean value) { - if (!value) { - this.supervisor = null; - } - } - - public int get_workers_size() { - return (this.workers == null) ? 0 : this.workers.size(); - } - - public java.util.Iterator get_workers_iterator() { - return (this.workers == null) ? null : this.workers.iterator(); - } - - public void add_to_workers(WorkerSummary elem) { - if (this.workers == null) { - this.workers = new ArrayList(); - } - this.workers.add(elem); - } - - public List get_workers() { - return this.workers; - } - - public void set_workers(List workers) { - this.workers = workers; - } - - public void unset_workers() { - this.workers = null; - } - - /** Returns true if field workers is set (has been assigned a value) and false otherwise */ - public boolean is_set_workers() { - return this.workers != null; - } - - public void set_workers_isSet(boolean value) { - if (!value) { - this.workers = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUPERVISOR: - if (value == null) { - unset_supervisor(); - } else { - set_supervisor((SupervisorSummary)value); - } - break; - - case WORKERS: - if (value == null) { - unset_workers(); - } else { - set_workers((List)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUPERVISOR: - return get_supervisor(); - - case WORKERS: - return get_workers(); - - } - throw new 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(); - } - - switch (field) { - case SUPERVISOR: - return is_set_supervisor(); - case WORKERS: - return is_set_workers(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof SupervisorWorkers) - return this.equals((SupervisorWorkers)that); - return false; - } - - public boolean equals(SupervisorWorkers that) { - if (that == null) - return false; - - boolean this_present_supervisor = true && this.is_set_supervisor(); - boolean that_present_supervisor = true && that.is_set_supervisor(); - if (this_present_supervisor || that_present_supervisor) { - if (!(this_present_supervisor && that_present_supervisor)) - return false; - if (!this.supervisor.equals(that.supervisor)) - return false; - } - - boolean this_present_workers = true && this.is_set_workers(); - boolean that_present_workers = true && that.is_set_workers(); - if (this_present_workers || that_present_workers) { - if (!(this_present_workers && that_present_workers)) - return false; - if (!this.workers.equals(that.workers)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_supervisor = true && (is_set_supervisor()); - builder.append(present_supervisor); - if (present_supervisor) - builder.append(supervisor); - - boolean present_workers = true && (is_set_workers()); - builder.append(present_workers); - if (present_workers) - builder.append(workers); - - return builder.toHashCode(); - } - - public int compareTo(SupervisorWorkers other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - SupervisorWorkers typedOther = (SupervisorWorkers)other; - - lastComparison = Boolean.valueOf(is_set_supervisor()).compareTo(typedOther.is_set_supervisor()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_supervisor()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.supervisor, typedOther.supervisor); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_workers()).compareTo(typedOther.is_set_workers()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_workers()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.workers, typedOther.workers); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // SUPERVISOR - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.supervisor = new SupervisorSummary(); - this.supervisor.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // WORKERS - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list117 = iprot.readListBegin(); - this.workers = new ArrayList(_list117.size); - for (int _i118 = 0; _i118 < _list117.size; ++_i118) - { - WorkerSummary _elem119; // required - _elem119 = new WorkerSummary(); - _elem119.read(iprot); - this.workers.add(_elem119); - } - 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.supervisor != null) { - oprot.writeFieldBegin(SUPERVISOR_FIELD_DESC); - this.supervisor.write(oprot); - oprot.writeFieldEnd(); - } - if (this.workers != null) { - oprot.writeFieldBegin(WORKERS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.workers.size())); - for (WorkerSummary _iter120 : this.workers) - { - _iter120.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("SupervisorWorkers("); - boolean first = true; - - sb.append("supervisor:"); - if (this.supervisor == null) { - sb.append("null"); - } else { - sb.append(this.supervisor); - } - first = false; - if (!first) sb.append(", "); - sb.append("workers:"); - if (this.workers == null) { - sb.append("null"); - } else { - sb.append(this.workers); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!is_set_supervisor()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'supervisor' is unset! Struct:" + toString()); - } - - if (!is_set_workers()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'workers' is unset! Struct:" + toString()); - } - - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - -} - +/** + * Autogenerated by Thrift Compiler (0.8.0) + * + * 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 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SupervisorWorkers implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SupervisorWorkers"); + + private static final org.apache.thrift.protocol.TField SUPERVISOR_FIELD_DESC = new org.apache.thrift.protocol.TField("supervisor", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField WORKERS_FIELD_DESC = new org.apache.thrift.protocol.TField("workers", org.apache.thrift.protocol.TType.LIST, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new SupervisorWorkersStandardSchemeFactory()); + schemes.put(TupleScheme.class, new SupervisorWorkersTupleSchemeFactory()); + } + + private SupervisorSummary supervisor; // required + private List workers; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUPERVISOR((short)1, "supervisor"), + WORKERS((short)2, "workers"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // SUPERVISOR + return SUPERVISOR; + case 2: // WORKERS + return WORKERS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.SUPERVISOR, new org.apache.thrift.meta_data.FieldMetaData("supervisor", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SupervisorSummary.class))); + tmpMap.put(_Fields.WORKERS, new org.apache.thrift.meta_data.FieldMetaData("workers", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, WorkerSummary.class)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SupervisorWorkers.class, metaDataMap); + } + + public SupervisorWorkers() { + } + + public SupervisorWorkers( + SupervisorSummary supervisor, + List workers) + { + this(); + this.supervisor = supervisor; + this.workers = workers; + } + + /** + * Performs a deep copy on other. + */ + public SupervisorWorkers(SupervisorWorkers other) { + if (other.is_set_supervisor()) { + this.supervisor = new SupervisorSummary(other.supervisor); + } + if (other.is_set_workers()) { + List __this__workers = new ArrayList(); + for (WorkerSummary other_element : other.workers) { + __this__workers.add(new WorkerSummary(other_element)); + } + this.workers = __this__workers; + } + } + + public SupervisorWorkers deepCopy() { + return new SupervisorWorkers(this); + } + + @Override + public void clear() { + this.supervisor = null; + this.workers = null; + } + + public SupervisorSummary get_supervisor() { + return this.supervisor; + } + + public void set_supervisor(SupervisorSummary supervisor) { + this.supervisor = supervisor; + } + + public void unset_supervisor() { + this.supervisor = null; + } + + /** Returns true if field supervisor is set (has been assigned a value) and false otherwise */ + public boolean is_set_supervisor() { + return this.supervisor != null; + } + + public void set_supervisor_isSet(boolean value) { + if (!value) { + this.supervisor = null; + } + } + + public int get_workers_size() { + return (this.workers == null) ? 0 : this.workers.size(); + } + + public java.util.Iterator get_workers_iterator() { + return (this.workers == null) ? null : this.workers.iterator(); + } + + public void add_to_workers(WorkerSummary elem) { + if (this.workers == null) { + this.workers = new ArrayList(); + } + this.workers.add(elem); + } + + public List get_workers() { + return this.workers; + } + + public void set_workers(List workers) { + this.workers = workers; + } + + public void unset_workers() { + this.workers = null; + } + + /** Returns true if field workers is set (has been assigned a value) and false otherwise */ + public boolean is_set_workers() { + return this.workers != null; + } + + public void set_workers_isSet(boolean value) { + if (!value) { + this.workers = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUPERVISOR: + if (value == null) { + unset_supervisor(); + } else { + set_supervisor((SupervisorSummary)value); + } + break; + + case WORKERS: + if (value == null) { + unset_workers(); + } else { + set_workers((List)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUPERVISOR: + return get_supervisor(); + + case WORKERS: + return get_workers(); + + } + throw new 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(); + } + + switch (field) { + case SUPERVISOR: + return is_set_supervisor(); + case WORKERS: + return is_set_workers(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof SupervisorWorkers) + return this.equals((SupervisorWorkers)that); + return false; + } + + public boolean equals(SupervisorWorkers that) { + if (that == null) + return false; + + boolean this_present_supervisor = true && this.is_set_supervisor(); + boolean that_present_supervisor = true && that.is_set_supervisor(); + if (this_present_supervisor || that_present_supervisor) { + if (!(this_present_supervisor && that_present_supervisor)) + return false; + if (!this.supervisor.equals(that.supervisor)) + return false; + } + + boolean this_present_workers = true && this.is_set_workers(); + boolean that_present_workers = true && that.is_set_workers(); + if (this_present_workers || that_present_workers) { + if (!(this_present_workers && that_present_workers)) + return false; + if (!this.workers.equals(that.workers)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_supervisor = true && (is_set_supervisor()); + builder.append(present_supervisor); + if (present_supervisor) + builder.append(supervisor); + + boolean present_workers = true && (is_set_workers()); + builder.append(present_workers); + if (present_workers) + builder.append(workers); + + return builder.toHashCode(); + } + + public int compareTo(SupervisorWorkers other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + SupervisorWorkers typedOther = (SupervisorWorkers)other; + + lastComparison = Boolean.valueOf(is_set_supervisor()).compareTo(typedOther.is_set_supervisor()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_supervisor()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.supervisor, typedOther.supervisor); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_workers()).compareTo(typedOther.is_set_workers()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_workers()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.workers, typedOther.workers); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("SupervisorWorkers("); + boolean first = true; + + sb.append("supervisor:"); + if (this.supervisor == null) { + sb.append("null"); + } else { + sb.append(this.supervisor); + } + first = false; + if (!first) sb.append(", "); + sb.append("workers:"); + if (this.workers == null) { + sb.append("null"); + } else { + sb.append(this.workers); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!is_set_supervisor()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'supervisor' is unset! Struct:" + toString()); + } + + if (!is_set_workers()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'workers' is unset! Struct:" + toString()); + } + + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 SupervisorWorkersStandardSchemeFactory implements SchemeFactory { + public SupervisorWorkersStandardScheme getScheme() { + return new SupervisorWorkersStandardScheme(); + } + } + + private static class SupervisorWorkersStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, SupervisorWorkers 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: // SUPERVISOR + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.supervisor = new SupervisorSummary(); + struct.supervisor.read(iprot); + struct.set_supervisor_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // WORKERS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list234 = iprot.readListBegin(); + struct.workers = new ArrayList(_list234.size); + for (int _i235 = 0; _i235 < _list234.size; ++_i235) + { + WorkerSummary _elem236; // required + _elem236 = new WorkerSummary(); + _elem236.read(iprot); + struct.workers.add(_elem236); + } + iprot.readListEnd(); + } + struct.set_workers_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, SupervisorWorkers struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.supervisor != null) { + oprot.writeFieldBegin(SUPERVISOR_FIELD_DESC); + struct.supervisor.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.workers != null) { + oprot.writeFieldBegin(WORKERS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.workers.size())); + for (WorkerSummary _iter237 : struct.workers) + { + _iter237.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class SupervisorWorkersTupleSchemeFactory implements SchemeFactory { + public SupervisorWorkersTupleScheme getScheme() { + return new SupervisorWorkersTupleScheme(); + } + } + + private static class SupervisorWorkersTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, SupervisorWorkers struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.supervisor.write(oprot); + { + oprot.writeI32(struct.workers.size()); + for (WorkerSummary _iter238 : struct.workers) + { + _iter238.write(oprot); + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, SupervisorWorkers struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.supervisor = new SupervisorSummary(); + struct.supervisor.read(iprot); + struct.set_supervisor_isSet(true); + { + org.apache.thrift.protocol.TList _list239 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.workers = new ArrayList(_list239.size); + for (int _i240 = 0; _i240 < _list239.size; ++_i240) + { + WorkerSummary _elem241; // required + _elem241 = new WorkerSummary(); + _elem241.read(iprot); + struct.workers.add(_elem241); + } + } + struct.set_workers_isSet(true); + } + } + +} + diff --git a/jstorm-client/src/main/java/backtype/storm/generated/TaskStats.java b/jstorm-client/src/main/java/backtype/storm/generated/TaskStats.java index 4e042e69a..f16ce79d3 100644 --- a/jstorm-client/src/main/java/backtype/storm/generated/TaskStats.java +++ b/jstorm-client/src/main/java/backtype/storm/generated/TaskStats.java @@ -1,1285 +1,1578 @@ -/** - * Autogenerated by Thrift Compiler (0.7.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - */ -package backtype.storm.generated; - -import org.apache.commons.lang.builder.HashCodeBuilder; -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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TaskStats implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TaskStats"); - - private static final org.apache.thrift.protocol.TField EMITTED_FIELD_DESC = new org.apache.thrift.protocol.TField("emitted", org.apache.thrift.protocol.TType.MAP, (short)1); - private static final org.apache.thrift.protocol.TField SEND_TPS_FIELD_DESC = new org.apache.thrift.protocol.TField("send_tps", org.apache.thrift.protocol.TType.MAP, (short)2); - private static final org.apache.thrift.protocol.TField RECV_TPS_FIELD_DESC = new org.apache.thrift.protocol.TField("recv_tps", org.apache.thrift.protocol.TType.MAP, (short)3); - private static final org.apache.thrift.protocol.TField ACKED_FIELD_DESC = new org.apache.thrift.protocol.TField("acked", org.apache.thrift.protocol.TType.MAP, (short)4); - private static final org.apache.thrift.protocol.TField FAILED_FIELD_DESC = new org.apache.thrift.protocol.TField("failed", org.apache.thrift.protocol.TType.MAP, (short)5); - private static final org.apache.thrift.protocol.TField PROCESS_MS_AVG_FIELD_DESC = new org.apache.thrift.protocol.TField("process_ms_avg", org.apache.thrift.protocol.TType.MAP, (short)6); - - private Map> emitted; // required - private Map> send_tps; // required - private Map> recv_tps; // required - private Map> acked; // required - private Map> failed; // required - private Map> process_ms_avg; // 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 { - EMITTED((short)1, "emitted"), - SEND_TPS((short)2, "send_tps"), - RECV_TPS((short)3, "recv_tps"), - ACKED((short)4, "acked"), - FAILED((short)5, "failed"), - PROCESS_MS_AVG((short)6, "process_ms_avg"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // EMITTED - return EMITTED; - case 2: // SEND_TPS - return SEND_TPS; - case 3: // RECV_TPS - return RECV_TPS; - case 4: // ACKED - return ACKED; - case 5: // FAILED - return FAILED; - case 6: // PROCESS_MS_AVG - return PROCESS_MS_AVG; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // 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); - tmpMap.put(_Fields.EMITTED, new org.apache.thrift.meta_data.FieldMetaData("emitted", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))))); - tmpMap.put(_Fields.SEND_TPS, new org.apache.thrift.meta_data.FieldMetaData("send_tps", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))))); - tmpMap.put(_Fields.RECV_TPS, new org.apache.thrift.meta_data.FieldMetaData("recv_tps", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, GlobalStreamId.class), - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))))); - tmpMap.put(_Fields.ACKED, new org.apache.thrift.meta_data.FieldMetaData("acked", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, GlobalStreamId.class), - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))))); - tmpMap.put(_Fields.FAILED, new org.apache.thrift.meta_data.FieldMetaData("failed", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, GlobalStreamId.class), - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))))); - tmpMap.put(_Fields.PROCESS_MS_AVG, new org.apache.thrift.meta_data.FieldMetaData("process_ms_avg", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, GlobalStreamId.class), - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TaskStats.class, metaDataMap); - } - - public TaskStats() { - } - - public TaskStats( - Map> emitted, - Map> send_tps, - Map> recv_tps, - Map> acked, - Map> failed, - Map> process_ms_avg) - { - this(); - this.emitted = emitted; - this.send_tps = send_tps; - this.recv_tps = recv_tps; - this.acked = acked; - this.failed = failed; - this.process_ms_avg = process_ms_avg; - } - - /** - * Performs a deep copy on other. - */ - public TaskStats(TaskStats other) { - if (other.is_set_emitted()) { - Map> __this__emitted = new HashMap>(); - for (Map.Entry> other_element : other.emitted.entrySet()) { - - String other_element_key = other_element.getKey(); - Map other_element_value = other_element.getValue(); - - String __this__emitted_copy_key = other_element_key; - - Map __this__emitted_copy_value = new HashMap(); - for (Map.Entry other_element_value_element : other_element_value.entrySet()) { - - String other_element_value_element_key = other_element_value_element.getKey(); - Long other_element_value_element_value = other_element_value_element.getValue(); - - String __this__emitted_copy_value_copy_key = other_element_value_element_key; - - Long __this__emitted_copy_value_copy_value = other_element_value_element_value; - - __this__emitted_copy_value.put(__this__emitted_copy_value_copy_key, __this__emitted_copy_value_copy_value); - } - - __this__emitted.put(__this__emitted_copy_key, __this__emitted_copy_value); - } - this.emitted = __this__emitted; - } - if (other.is_set_send_tps()) { - Map> __this__send_tps = new HashMap>(); - for (Map.Entry> other_element : other.send_tps.entrySet()) { - - String other_element_key = other_element.getKey(); - Map other_element_value = other_element.getValue(); - - String __this__send_tps_copy_key = other_element_key; - - Map __this__send_tps_copy_value = new HashMap(); - for (Map.Entry other_element_value_element : other_element_value.entrySet()) { - - String other_element_value_element_key = other_element_value_element.getKey(); - Double other_element_value_element_value = other_element_value_element.getValue(); - - String __this__send_tps_copy_value_copy_key = other_element_value_element_key; - - Double __this__send_tps_copy_value_copy_value = other_element_value_element_value; - - __this__send_tps_copy_value.put(__this__send_tps_copy_value_copy_key, __this__send_tps_copy_value_copy_value); - } - - __this__send_tps.put(__this__send_tps_copy_key, __this__send_tps_copy_value); - } - this.send_tps = __this__send_tps; - } - if (other.is_set_recv_tps()) { - Map> __this__recv_tps = new HashMap>(); - for (Map.Entry> other_element : other.recv_tps.entrySet()) { - - String other_element_key = other_element.getKey(); - Map other_element_value = other_element.getValue(); - - String __this__recv_tps_copy_key = other_element_key; - - Map __this__recv_tps_copy_value = new HashMap(); - for (Map.Entry other_element_value_element : other_element_value.entrySet()) { - - GlobalStreamId other_element_value_element_key = other_element_value_element.getKey(); - Double other_element_value_element_value = other_element_value_element.getValue(); - - GlobalStreamId __this__recv_tps_copy_value_copy_key = new GlobalStreamId(other_element_value_element_key); - - Double __this__recv_tps_copy_value_copy_value = other_element_value_element_value; - - __this__recv_tps_copy_value.put(__this__recv_tps_copy_value_copy_key, __this__recv_tps_copy_value_copy_value); - } - - __this__recv_tps.put(__this__recv_tps_copy_key, __this__recv_tps_copy_value); - } - this.recv_tps = __this__recv_tps; - } - if (other.is_set_acked()) { - Map> __this__acked = new HashMap>(); - for (Map.Entry> other_element : other.acked.entrySet()) { - - String other_element_key = other_element.getKey(); - Map other_element_value = other_element.getValue(); - - String __this__acked_copy_key = other_element_key; - - Map __this__acked_copy_value = new HashMap(); - for (Map.Entry other_element_value_element : other_element_value.entrySet()) { - - GlobalStreamId other_element_value_element_key = other_element_value_element.getKey(); - Long other_element_value_element_value = other_element_value_element.getValue(); - - GlobalStreamId __this__acked_copy_value_copy_key = new GlobalStreamId(other_element_value_element_key); - - Long __this__acked_copy_value_copy_value = other_element_value_element_value; - - __this__acked_copy_value.put(__this__acked_copy_value_copy_key, __this__acked_copy_value_copy_value); - } - - __this__acked.put(__this__acked_copy_key, __this__acked_copy_value); - } - this.acked = __this__acked; - } - if (other.is_set_failed()) { - Map> __this__failed = new HashMap>(); - for (Map.Entry> other_element : other.failed.entrySet()) { - - String other_element_key = other_element.getKey(); - Map other_element_value = other_element.getValue(); - - String __this__failed_copy_key = other_element_key; - - Map __this__failed_copy_value = new HashMap(); - for (Map.Entry other_element_value_element : other_element_value.entrySet()) { - - GlobalStreamId other_element_value_element_key = other_element_value_element.getKey(); - Long other_element_value_element_value = other_element_value_element.getValue(); - - GlobalStreamId __this__failed_copy_value_copy_key = new GlobalStreamId(other_element_value_element_key); - - Long __this__failed_copy_value_copy_value = other_element_value_element_value; - - __this__failed_copy_value.put(__this__failed_copy_value_copy_key, __this__failed_copy_value_copy_value); - } - - __this__failed.put(__this__failed_copy_key, __this__failed_copy_value); - } - this.failed = __this__failed; - } - if (other.is_set_process_ms_avg()) { - Map> __this__process_ms_avg = new HashMap>(); - for (Map.Entry> other_element : other.process_ms_avg.entrySet()) { - - String other_element_key = other_element.getKey(); - Map other_element_value = other_element.getValue(); - - String __this__process_ms_avg_copy_key = other_element_key; - - Map __this__process_ms_avg_copy_value = new HashMap(); - for (Map.Entry other_element_value_element : other_element_value.entrySet()) { - - GlobalStreamId other_element_value_element_key = other_element_value_element.getKey(); - Double other_element_value_element_value = other_element_value_element.getValue(); - - GlobalStreamId __this__process_ms_avg_copy_value_copy_key = new GlobalStreamId(other_element_value_element_key); - - Double __this__process_ms_avg_copy_value_copy_value = other_element_value_element_value; - - __this__process_ms_avg_copy_value.put(__this__process_ms_avg_copy_value_copy_key, __this__process_ms_avg_copy_value_copy_value); - } - - __this__process_ms_avg.put(__this__process_ms_avg_copy_key, __this__process_ms_avg_copy_value); - } - this.process_ms_avg = __this__process_ms_avg; - } - } - - public TaskStats deepCopy() { - return new TaskStats(this); - } - - @Override - public void clear() { - this.emitted = null; - this.send_tps = null; - this.recv_tps = null; - this.acked = null; - this.failed = null; - this.process_ms_avg = null; - } - - public int get_emitted_size() { - return (this.emitted == null) ? 0 : this.emitted.size(); - } - - public void put_to_emitted(String key, Map val) { - if (this.emitted == null) { - this.emitted = new HashMap>(); - } - this.emitted.put(key, val); - } - - public Map> get_emitted() { - return this.emitted; - } - - public void set_emitted(Map> emitted) { - this.emitted = emitted; - } - - public void unset_emitted() { - this.emitted = null; - } - - /** Returns true if field emitted is set (has been assigned a value) and false otherwise */ - public boolean is_set_emitted() { - return this.emitted != null; - } - - public void set_emitted_isSet(boolean value) { - if (!value) { - this.emitted = null; - } - } - - public int get_send_tps_size() { - return (this.send_tps == null) ? 0 : this.send_tps.size(); - } - - public void put_to_send_tps(String key, Map val) { - if (this.send_tps == null) { - this.send_tps = new HashMap>(); - } - this.send_tps.put(key, val); - } - - public Map> get_send_tps() { - return this.send_tps; - } - - public void set_send_tps(Map> send_tps) { - this.send_tps = send_tps; - } - - public void unset_send_tps() { - this.send_tps = null; - } - - /** Returns true if field send_tps is set (has been assigned a value) and false otherwise */ - public boolean is_set_send_tps() { - return this.send_tps != null; - } - - public void set_send_tps_isSet(boolean value) { - if (!value) { - this.send_tps = null; - } - } - - public int get_recv_tps_size() { - return (this.recv_tps == null) ? 0 : this.recv_tps.size(); - } - - public void put_to_recv_tps(String key, Map val) { - if (this.recv_tps == null) { - this.recv_tps = new HashMap>(); - } - this.recv_tps.put(key, val); - } - - public Map> get_recv_tps() { - return this.recv_tps; - } - - public void set_recv_tps(Map> recv_tps) { - this.recv_tps = recv_tps; - } - - public void unset_recv_tps() { - this.recv_tps = null; - } - - /** Returns true if field recv_tps is set (has been assigned a value) and false otherwise */ - public boolean is_set_recv_tps() { - return this.recv_tps != null; - } - - public void set_recv_tps_isSet(boolean value) { - if (!value) { - this.recv_tps = null; - } - } - - public int get_acked_size() { - return (this.acked == null) ? 0 : this.acked.size(); - } - - public void put_to_acked(String key, Map val) { - if (this.acked == null) { - this.acked = new HashMap>(); - } - this.acked.put(key, val); - } - - public Map> get_acked() { - return this.acked; - } - - public void set_acked(Map> acked) { - this.acked = acked; - } - - public void unset_acked() { - this.acked = null; - } - - /** Returns true if field acked is set (has been assigned a value) and false otherwise */ - public boolean is_set_acked() { - return this.acked != null; - } - - public void set_acked_isSet(boolean value) { - if (!value) { - this.acked = null; - } - } - - public int get_failed_size() { - return (this.failed == null) ? 0 : this.failed.size(); - } - - public void put_to_failed(String key, Map val) { - if (this.failed == null) { - this.failed = new HashMap>(); - } - this.failed.put(key, val); - } - - public Map> get_failed() { - return this.failed; - } - - public void set_failed(Map> failed) { - this.failed = failed; - } - - public void unset_failed() { - this.failed = null; - } - - /** Returns true if field failed is set (has been assigned a value) and false otherwise */ - public boolean is_set_failed() { - return this.failed != null; - } - - public void set_failed_isSet(boolean value) { - if (!value) { - this.failed = null; - } - } - - public int get_process_ms_avg_size() { - return (this.process_ms_avg == null) ? 0 : this.process_ms_avg.size(); - } - - public void put_to_process_ms_avg(String key, Map val) { - if (this.process_ms_avg == null) { - this.process_ms_avg = new HashMap>(); - } - this.process_ms_avg.put(key, val); - } - - public Map> get_process_ms_avg() { - return this.process_ms_avg; - } - - public void set_process_ms_avg(Map> process_ms_avg) { - this.process_ms_avg = process_ms_avg; - } - - public void unset_process_ms_avg() { - this.process_ms_avg = null; - } - - /** Returns true if field process_ms_avg is set (has been assigned a value) and false otherwise */ - public boolean is_set_process_ms_avg() { - return this.process_ms_avg != null; - } - - public void set_process_ms_avg_isSet(boolean value) { - if (!value) { - this.process_ms_avg = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case EMITTED: - if (value == null) { - unset_emitted(); - } else { - set_emitted((Map>)value); - } - break; - - case SEND_TPS: - if (value == null) { - unset_send_tps(); - } else { - set_send_tps((Map>)value); - } - break; - - case RECV_TPS: - if (value == null) { - unset_recv_tps(); - } else { - set_recv_tps((Map>)value); - } - break; - - case ACKED: - if (value == null) { - unset_acked(); - } else { - set_acked((Map>)value); - } - break; - - case FAILED: - if (value == null) { - unset_failed(); - } else { - set_failed((Map>)value); - } - break; - - case PROCESS_MS_AVG: - if (value == null) { - unset_process_ms_avg(); - } else { - set_process_ms_avg((Map>)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case EMITTED: - return get_emitted(); - - case SEND_TPS: - return get_send_tps(); - - case RECV_TPS: - return get_recv_tps(); - - case ACKED: - return get_acked(); - - case FAILED: - return get_failed(); - - case PROCESS_MS_AVG: - return get_process_ms_avg(); - - } - throw new 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(); - } - - switch (field) { - case EMITTED: - return is_set_emitted(); - case SEND_TPS: - return is_set_send_tps(); - case RECV_TPS: - return is_set_recv_tps(); - case ACKED: - return is_set_acked(); - case FAILED: - return is_set_failed(); - case PROCESS_MS_AVG: - return is_set_process_ms_avg(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TaskStats) - return this.equals((TaskStats)that); - return false; - } - - public boolean equals(TaskStats that) { - if (that == null) - return false; - - boolean this_present_emitted = true && this.is_set_emitted(); - boolean that_present_emitted = true && that.is_set_emitted(); - if (this_present_emitted || that_present_emitted) { - if (!(this_present_emitted && that_present_emitted)) - return false; - if (!this.emitted.equals(that.emitted)) - return false; - } - - boolean this_present_send_tps = true && this.is_set_send_tps(); - boolean that_present_send_tps = true && that.is_set_send_tps(); - if (this_present_send_tps || that_present_send_tps) { - if (!(this_present_send_tps && that_present_send_tps)) - return false; - if (!this.send_tps.equals(that.send_tps)) - return false; - } - - boolean this_present_recv_tps = true && this.is_set_recv_tps(); - boolean that_present_recv_tps = true && that.is_set_recv_tps(); - if (this_present_recv_tps || that_present_recv_tps) { - if (!(this_present_recv_tps && that_present_recv_tps)) - return false; - if (!this.recv_tps.equals(that.recv_tps)) - return false; - } - - boolean this_present_acked = true && this.is_set_acked(); - boolean that_present_acked = true && that.is_set_acked(); - if (this_present_acked || that_present_acked) { - if (!(this_present_acked && that_present_acked)) - return false; - if (!this.acked.equals(that.acked)) - return false; - } - - boolean this_present_failed = true && this.is_set_failed(); - boolean that_present_failed = true && that.is_set_failed(); - if (this_present_failed || that_present_failed) { - if (!(this_present_failed && that_present_failed)) - return false; - if (!this.failed.equals(that.failed)) - return false; - } - - boolean this_present_process_ms_avg = true && this.is_set_process_ms_avg(); - boolean that_present_process_ms_avg = true && that.is_set_process_ms_avg(); - if (this_present_process_ms_avg || that_present_process_ms_avg) { - if (!(this_present_process_ms_avg && that_present_process_ms_avg)) - return false; - if (!this.process_ms_avg.equals(that.process_ms_avg)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_emitted = true && (is_set_emitted()); - builder.append(present_emitted); - if (present_emitted) - builder.append(emitted); - - boolean present_send_tps = true && (is_set_send_tps()); - builder.append(present_send_tps); - if (present_send_tps) - builder.append(send_tps); - - boolean present_recv_tps = true && (is_set_recv_tps()); - builder.append(present_recv_tps); - if (present_recv_tps) - builder.append(recv_tps); - - boolean present_acked = true && (is_set_acked()); - builder.append(present_acked); - if (present_acked) - builder.append(acked); - - boolean present_failed = true && (is_set_failed()); - builder.append(present_failed); - if (present_failed) - builder.append(failed); - - boolean present_process_ms_avg = true && (is_set_process_ms_avg()); - builder.append(present_process_ms_avg); - if (present_process_ms_avg) - builder.append(process_ms_avg); - - return builder.toHashCode(); - } - - public int compareTo(TaskStats other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TaskStats typedOther = (TaskStats)other; - - lastComparison = Boolean.valueOf(is_set_emitted()).compareTo(typedOther.is_set_emitted()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_emitted()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.emitted, typedOther.emitted); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_send_tps()).compareTo(typedOther.is_set_send_tps()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_send_tps()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.send_tps, typedOther.send_tps); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_recv_tps()).compareTo(typedOther.is_set_recv_tps()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_recv_tps()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.recv_tps, typedOther.recv_tps); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_acked()).compareTo(typedOther.is_set_acked()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_acked()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.acked, typedOther.acked); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_failed()).compareTo(typedOther.is_set_failed()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_failed()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.failed, typedOther.failed); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_process_ms_avg()).compareTo(typedOther.is_set_process_ms_avg()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_process_ms_avg()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.process_ms_avg, typedOther.process_ms_avg); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // EMITTED - if (field.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map45 = iprot.readMapBegin(); - this.emitted = new HashMap>(2*_map45.size); - for (int _i46 = 0; _i46 < _map45.size; ++_i46) - { - String _key47; // required - Map _val48; // required - _key47 = iprot.readString(); - { - org.apache.thrift.protocol.TMap _map49 = iprot.readMapBegin(); - _val48 = new HashMap(2*_map49.size); - for (int _i50 = 0; _i50 < _map49.size; ++_i50) - { - String _key51; // required - long _val52; // required - _key51 = iprot.readString(); - _val52 = iprot.readI64(); - _val48.put(_key51, _val52); - } - iprot.readMapEnd(); - } - this.emitted.put(_key47, _val48); - } - iprot.readMapEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // SEND_TPS - if (field.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map53 = iprot.readMapBegin(); - this.send_tps = new HashMap>(2*_map53.size); - for (int _i54 = 0; _i54 < _map53.size; ++_i54) - { - String _key55; // required - Map _val56; // required - _key55 = iprot.readString(); - { - org.apache.thrift.protocol.TMap _map57 = iprot.readMapBegin(); - _val56 = new HashMap(2*_map57.size); - for (int _i58 = 0; _i58 < _map57.size; ++_i58) - { - String _key59; // required - double _val60; // required - _key59 = iprot.readString(); - _val60 = iprot.readDouble(); - _val56.put(_key59, _val60); - } - iprot.readMapEnd(); - } - this.send_tps.put(_key55, _val56); - } - iprot.readMapEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // RECV_TPS - if (field.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map61 = iprot.readMapBegin(); - this.recv_tps = new HashMap>(2*_map61.size); - for (int _i62 = 0; _i62 < _map61.size; ++_i62) - { - String _key63; // required - Map _val64; // required - _key63 = iprot.readString(); - { - org.apache.thrift.protocol.TMap _map65 = iprot.readMapBegin(); - _val64 = new HashMap(2*_map65.size); - for (int _i66 = 0; _i66 < _map65.size; ++_i66) - { - GlobalStreamId _key67; // required - double _val68; // required - _key67 = new GlobalStreamId(); - _key67.read(iprot); - _val68 = iprot.readDouble(); - _val64.put(_key67, _val68); - } - iprot.readMapEnd(); - } - this.recv_tps.put(_key63, _val64); - } - iprot.readMapEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // ACKED - if (field.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map69 = iprot.readMapBegin(); - this.acked = new HashMap>(2*_map69.size); - for (int _i70 = 0; _i70 < _map69.size; ++_i70) - { - String _key71; // required - Map _val72; // required - _key71 = iprot.readString(); - { - org.apache.thrift.protocol.TMap _map73 = iprot.readMapBegin(); - _val72 = new HashMap(2*_map73.size); - for (int _i74 = 0; _i74 < _map73.size; ++_i74) - { - GlobalStreamId _key75; // required - long _val76; // required - _key75 = new GlobalStreamId(); - _key75.read(iprot); - _val76 = iprot.readI64(); - _val72.put(_key75, _val76); - } - iprot.readMapEnd(); - } - this.acked.put(_key71, _val72); - } - iprot.readMapEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 5: // FAILED - if (field.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map77 = iprot.readMapBegin(); - this.failed = new HashMap>(2*_map77.size); - for (int _i78 = 0; _i78 < _map77.size; ++_i78) - { - String _key79; // required - Map _val80; // required - _key79 = iprot.readString(); - { - org.apache.thrift.protocol.TMap _map81 = iprot.readMapBegin(); - _val80 = new HashMap(2*_map81.size); - for (int _i82 = 0; _i82 < _map81.size; ++_i82) - { - GlobalStreamId _key83; // required - long _val84; // required - _key83 = new GlobalStreamId(); - _key83.read(iprot); - _val84 = iprot.readI64(); - _val80.put(_key83, _val84); - } - iprot.readMapEnd(); - } - this.failed.put(_key79, _val80); - } - iprot.readMapEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 6: // PROCESS_MS_AVG - if (field.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map85 = iprot.readMapBegin(); - this.process_ms_avg = new HashMap>(2*_map85.size); - for (int _i86 = 0; _i86 < _map85.size; ++_i86) - { - String _key87; // required - Map _val88; // required - _key87 = iprot.readString(); - { - org.apache.thrift.protocol.TMap _map89 = iprot.readMapBegin(); - _val88 = new HashMap(2*_map89.size); - for (int _i90 = 0; _i90 < _map89.size; ++_i90) - { - GlobalStreamId _key91; // required - double _val92; // required - _key91 = new GlobalStreamId(); - _key91.read(iprot); - _val92 = iprot.readDouble(); - _val88.put(_key91, _val92); - } - iprot.readMapEnd(); - } - this.process_ms_avg.put(_key87, _val88); - } - iprot.readMapEnd(); - } - } 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.emitted != null) { - oprot.writeFieldBegin(EMITTED_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, this.emitted.size())); - for (Map.Entry> _iter93 : this.emitted.entrySet()) - { - oprot.writeString(_iter93.getKey()); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I64, _iter93.getValue().size())); - for (Map.Entry _iter94 : _iter93.getValue().entrySet()) - { - oprot.writeString(_iter94.getKey()); - oprot.writeI64(_iter94.getValue()); - } - oprot.writeMapEnd(); - } - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - if (this.send_tps != null) { - oprot.writeFieldBegin(SEND_TPS_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, this.send_tps.size())); - for (Map.Entry> _iter95 : this.send_tps.entrySet()) - { - oprot.writeString(_iter95.getKey()); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.DOUBLE, _iter95.getValue().size())); - for (Map.Entry _iter96 : _iter95.getValue().entrySet()) - { - oprot.writeString(_iter96.getKey()); - oprot.writeDouble(_iter96.getValue()); - } - oprot.writeMapEnd(); - } - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - if (this.recv_tps != null) { - oprot.writeFieldBegin(RECV_TPS_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, this.recv_tps.size())); - for (Map.Entry> _iter97 : this.recv_tps.entrySet()) - { - oprot.writeString(_iter97.getKey()); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.DOUBLE, _iter97.getValue().size())); - for (Map.Entry _iter98 : _iter97.getValue().entrySet()) - { - _iter98.getKey().write(oprot); - oprot.writeDouble(_iter98.getValue()); - } - oprot.writeMapEnd(); - } - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - if (this.acked != null) { - oprot.writeFieldBegin(ACKED_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, this.acked.size())); - for (Map.Entry> _iter99 : this.acked.entrySet()) - { - oprot.writeString(_iter99.getKey()); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.I64, _iter99.getValue().size())); - for (Map.Entry _iter100 : _iter99.getValue().entrySet()) - { - _iter100.getKey().write(oprot); - oprot.writeI64(_iter100.getValue()); - } - oprot.writeMapEnd(); - } - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - if (this.failed != null) { - oprot.writeFieldBegin(FAILED_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, this.failed.size())); - for (Map.Entry> _iter101 : this.failed.entrySet()) - { - oprot.writeString(_iter101.getKey()); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.I64, _iter101.getValue().size())); - for (Map.Entry _iter102 : _iter101.getValue().entrySet()) - { - _iter102.getKey().write(oprot); - oprot.writeI64(_iter102.getValue()); - } - oprot.writeMapEnd(); - } - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - if (this.process_ms_avg != null) { - oprot.writeFieldBegin(PROCESS_MS_AVG_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, this.process_ms_avg.size())); - for (Map.Entry> _iter103 : this.process_ms_avg.entrySet()) - { - oprot.writeString(_iter103.getKey()); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.DOUBLE, _iter103.getValue().size())); - for (Map.Entry _iter104 : _iter103.getValue().entrySet()) - { - _iter104.getKey().write(oprot); - oprot.writeDouble(_iter104.getValue()); - } - oprot.writeMapEnd(); - } - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TaskStats("); - boolean first = true; - - sb.append("emitted:"); - if (this.emitted == null) { - sb.append("null"); - } else { - sb.append(this.emitted); - } - first = false; - if (!first) sb.append(", "); - sb.append("send_tps:"); - if (this.send_tps == null) { - sb.append("null"); - } else { - sb.append(this.send_tps); - } - first = false; - if (!first) sb.append(", "); - sb.append("recv_tps:"); - if (this.recv_tps == null) { - sb.append("null"); - } else { - sb.append(this.recv_tps); - } - first = false; - if (!first) sb.append(", "); - sb.append("acked:"); - if (this.acked == null) { - sb.append("null"); - } else { - sb.append(this.acked); - } - first = false; - if (!first) sb.append(", "); - sb.append("failed:"); - if (this.failed == null) { - sb.append("null"); - } else { - sb.append(this.failed); - } - first = false; - if (!first) sb.append(", "); - sb.append("process_ms_avg:"); - if (this.process_ms_avg == null) { - sb.append("null"); - } else { - sb.append(this.process_ms_avg); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!is_set_emitted()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'emitted' is unset! Struct:" + toString()); - } - - if (!is_set_send_tps()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'send_tps' is unset! Struct:" + toString()); - } - - if (!is_set_recv_tps()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'recv_tps' is unset! Struct:" + toString()); - } - - if (!is_set_acked()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'acked' is unset! Struct:" + toString()); - } - - if (!is_set_failed()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'failed' is unset! Struct:" + toString()); - } - - if (!is_set_process_ms_avg()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'process_ms_avg' is unset! Struct:" + toString()); - } - - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - 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); - } - } - -} - +/** + * Autogenerated by Thrift Compiler (0.8.0) + * + * 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 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TaskStats implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TaskStats"); + + private static final org.apache.thrift.protocol.TField EMITTED_FIELD_DESC = new org.apache.thrift.protocol.TField("emitted", org.apache.thrift.protocol.TType.MAP, (short)1); + private static final org.apache.thrift.protocol.TField SEND_TPS_FIELD_DESC = new org.apache.thrift.protocol.TField("send_tps", org.apache.thrift.protocol.TType.MAP, (short)2); + private static final org.apache.thrift.protocol.TField RECV_TPS_FIELD_DESC = new org.apache.thrift.protocol.TField("recv_tps", org.apache.thrift.protocol.TType.MAP, (short)3); + private static final org.apache.thrift.protocol.TField ACKED_FIELD_DESC = new org.apache.thrift.protocol.TField("acked", org.apache.thrift.protocol.TType.MAP, (short)4); + private static final org.apache.thrift.protocol.TField FAILED_FIELD_DESC = new org.apache.thrift.protocol.TField("failed", org.apache.thrift.protocol.TType.MAP, (short)5); + private static final org.apache.thrift.protocol.TField PROCESS_MS_AVG_FIELD_DESC = new org.apache.thrift.protocol.TField("process_ms_avg", org.apache.thrift.protocol.TType.MAP, (short)6); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TaskStatsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TaskStatsTupleSchemeFactory()); + } + + private Map> emitted; // required + private Map> send_tps; // required + private Map> recv_tps; // required + private Map> acked; // required + private Map> failed; // required + private Map> process_ms_avg; // 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 { + EMITTED((short)1, "emitted"), + SEND_TPS((short)2, "send_tps"), + RECV_TPS((short)3, "recv_tps"), + ACKED((short)4, "acked"), + FAILED((short)5, "failed"), + PROCESS_MS_AVG((short)6, "process_ms_avg"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // EMITTED + return EMITTED; + case 2: // SEND_TPS + return SEND_TPS; + case 3: // RECV_TPS + return RECV_TPS; + case 4: // ACKED + return ACKED; + case 5: // FAILED + return FAILED; + case 6: // PROCESS_MS_AVG + return PROCESS_MS_AVG; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // 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); + tmpMap.put(_Fields.EMITTED, new org.apache.thrift.meta_data.FieldMetaData("emitted", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))))); + tmpMap.put(_Fields.SEND_TPS, new org.apache.thrift.meta_data.FieldMetaData("send_tps", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))))); + tmpMap.put(_Fields.RECV_TPS, new org.apache.thrift.meta_data.FieldMetaData("recv_tps", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, GlobalStreamId.class), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))))); + tmpMap.put(_Fields.ACKED, new org.apache.thrift.meta_data.FieldMetaData("acked", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, GlobalStreamId.class), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))))); + tmpMap.put(_Fields.FAILED, new org.apache.thrift.meta_data.FieldMetaData("failed", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, GlobalStreamId.class), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))))); + tmpMap.put(_Fields.PROCESS_MS_AVG, new org.apache.thrift.meta_data.FieldMetaData("process_ms_avg", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, GlobalStreamId.class), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TaskStats.class, metaDataMap); + } + + public TaskStats() { + } + + public TaskStats( + Map> emitted, + Map> send_tps, + Map> recv_tps, + Map> acked, + Map> failed, + Map> process_ms_avg) + { + this(); + this.emitted = emitted; + this.send_tps = send_tps; + this.recv_tps = recv_tps; + this.acked = acked; + this.failed = failed; + this.process_ms_avg = process_ms_avg; + } + + /** + * Performs a deep copy on other. + */ + public TaskStats(TaskStats other) { + if (other.is_set_emitted()) { + Map> __this__emitted = new HashMap>(); + for (Map.Entry> other_element : other.emitted.entrySet()) { + + String other_element_key = other_element.getKey(); + Map other_element_value = other_element.getValue(); + + String __this__emitted_copy_key = other_element_key; + + Map __this__emitted_copy_value = new HashMap(); + for (Map.Entry other_element_value_element : other_element_value.entrySet()) { + + String other_element_value_element_key = other_element_value_element.getKey(); + Long other_element_value_element_value = other_element_value_element.getValue(); + + String __this__emitted_copy_value_copy_key = other_element_value_element_key; + + Long __this__emitted_copy_value_copy_value = other_element_value_element_value; + + __this__emitted_copy_value.put(__this__emitted_copy_value_copy_key, __this__emitted_copy_value_copy_value); + } + + __this__emitted.put(__this__emitted_copy_key, __this__emitted_copy_value); + } + this.emitted = __this__emitted; + } + if (other.is_set_send_tps()) { + Map> __this__send_tps = new HashMap>(); + for (Map.Entry> other_element : other.send_tps.entrySet()) { + + String other_element_key = other_element.getKey(); + Map other_element_value = other_element.getValue(); + + String __this__send_tps_copy_key = other_element_key; + + Map __this__send_tps_copy_value = new HashMap(); + for (Map.Entry other_element_value_element : other_element_value.entrySet()) { + + String other_element_value_element_key = other_element_value_element.getKey(); + Double other_element_value_element_value = other_element_value_element.getValue(); + + String __this__send_tps_copy_value_copy_key = other_element_value_element_key; + + Double __this__send_tps_copy_value_copy_value = other_element_value_element_value; + + __this__send_tps_copy_value.put(__this__send_tps_copy_value_copy_key, __this__send_tps_copy_value_copy_value); + } + + __this__send_tps.put(__this__send_tps_copy_key, __this__send_tps_copy_value); + } + this.send_tps = __this__send_tps; + } + if (other.is_set_recv_tps()) { + Map> __this__recv_tps = new HashMap>(); + for (Map.Entry> other_element : other.recv_tps.entrySet()) { + + String other_element_key = other_element.getKey(); + Map other_element_value = other_element.getValue(); + + String __this__recv_tps_copy_key = other_element_key; + + Map __this__recv_tps_copy_value = new HashMap(); + for (Map.Entry other_element_value_element : other_element_value.entrySet()) { + + GlobalStreamId other_element_value_element_key = other_element_value_element.getKey(); + Double other_element_value_element_value = other_element_value_element.getValue(); + + GlobalStreamId __this__recv_tps_copy_value_copy_key = new GlobalStreamId(other_element_value_element_key); + + Double __this__recv_tps_copy_value_copy_value = other_element_value_element_value; + + __this__recv_tps_copy_value.put(__this__recv_tps_copy_value_copy_key, __this__recv_tps_copy_value_copy_value); + } + + __this__recv_tps.put(__this__recv_tps_copy_key, __this__recv_tps_copy_value); + } + this.recv_tps = __this__recv_tps; + } + if (other.is_set_acked()) { + Map> __this__acked = new HashMap>(); + for (Map.Entry> other_element : other.acked.entrySet()) { + + String other_element_key = other_element.getKey(); + Map other_element_value = other_element.getValue(); + + String __this__acked_copy_key = other_element_key; + + Map __this__acked_copy_value = new HashMap(); + for (Map.Entry other_element_value_element : other_element_value.entrySet()) { + + GlobalStreamId other_element_value_element_key = other_element_value_element.getKey(); + Long other_element_value_element_value = other_element_value_element.getValue(); + + GlobalStreamId __this__acked_copy_value_copy_key = new GlobalStreamId(other_element_value_element_key); + + Long __this__acked_copy_value_copy_value = other_element_value_element_value; + + __this__acked_copy_value.put(__this__acked_copy_value_copy_key, __this__acked_copy_value_copy_value); + } + + __this__acked.put(__this__acked_copy_key, __this__acked_copy_value); + } + this.acked = __this__acked; + } + if (other.is_set_failed()) { + Map> __this__failed = new HashMap>(); + for (Map.Entry> other_element : other.failed.entrySet()) { + + String other_element_key = other_element.getKey(); + Map other_element_value = other_element.getValue(); + + String __this__failed_copy_key = other_element_key; + + Map __this__failed_copy_value = new HashMap(); + for (Map.Entry other_element_value_element : other_element_value.entrySet()) { + + GlobalStreamId other_element_value_element_key = other_element_value_element.getKey(); + Long other_element_value_element_value = other_element_value_element.getValue(); + + GlobalStreamId __this__failed_copy_value_copy_key = new GlobalStreamId(other_element_value_element_key); + + Long __this__failed_copy_value_copy_value = other_element_value_element_value; + + __this__failed_copy_value.put(__this__failed_copy_value_copy_key, __this__failed_copy_value_copy_value); + } + + __this__failed.put(__this__failed_copy_key, __this__failed_copy_value); + } + this.failed = __this__failed; + } + if (other.is_set_process_ms_avg()) { + Map> __this__process_ms_avg = new HashMap>(); + for (Map.Entry> other_element : other.process_ms_avg.entrySet()) { + + String other_element_key = other_element.getKey(); + Map other_element_value = other_element.getValue(); + + String __this__process_ms_avg_copy_key = other_element_key; + + Map __this__process_ms_avg_copy_value = new HashMap(); + for (Map.Entry other_element_value_element : other_element_value.entrySet()) { + + GlobalStreamId other_element_value_element_key = other_element_value_element.getKey(); + Double other_element_value_element_value = other_element_value_element.getValue(); + + GlobalStreamId __this__process_ms_avg_copy_value_copy_key = new GlobalStreamId(other_element_value_element_key); + + Double __this__process_ms_avg_copy_value_copy_value = other_element_value_element_value; + + __this__process_ms_avg_copy_value.put(__this__process_ms_avg_copy_value_copy_key, __this__process_ms_avg_copy_value_copy_value); + } + + __this__process_ms_avg.put(__this__process_ms_avg_copy_key, __this__process_ms_avg_copy_value); + } + this.process_ms_avg = __this__process_ms_avg; + } + } + + public TaskStats deepCopy() { + return new TaskStats(this); + } + + @Override + public void clear() { + this.emitted = null; + this.send_tps = null; + this.recv_tps = null; + this.acked = null; + this.failed = null; + this.process_ms_avg = null; + } + + public int get_emitted_size() { + return (this.emitted == null) ? 0 : this.emitted.size(); + } + + public void put_to_emitted(String key, Map val) { + if (this.emitted == null) { + this.emitted = new HashMap>(); + } + this.emitted.put(key, val); + } + + public Map> get_emitted() { + return this.emitted; + } + + public void set_emitted(Map> emitted) { + this.emitted = emitted; + } + + public void unset_emitted() { + this.emitted = null; + } + + /** Returns true if field emitted is set (has been assigned a value) and false otherwise */ + public boolean is_set_emitted() { + return this.emitted != null; + } + + public void set_emitted_isSet(boolean value) { + if (!value) { + this.emitted = null; + } + } + + public int get_send_tps_size() { + return (this.send_tps == null) ? 0 : this.send_tps.size(); + } + + public void put_to_send_tps(String key, Map val) { + if (this.send_tps == null) { + this.send_tps = new HashMap>(); + } + this.send_tps.put(key, val); + } + + public Map> get_send_tps() { + return this.send_tps; + } + + public void set_send_tps(Map> send_tps) { + this.send_tps = send_tps; + } + + public void unset_send_tps() { + this.send_tps = null; + } + + /** Returns true if field send_tps is set (has been assigned a value) and false otherwise */ + public boolean is_set_send_tps() { + return this.send_tps != null; + } + + public void set_send_tps_isSet(boolean value) { + if (!value) { + this.send_tps = null; + } + } + + public int get_recv_tps_size() { + return (this.recv_tps == null) ? 0 : this.recv_tps.size(); + } + + public void put_to_recv_tps(String key, Map val) { + if (this.recv_tps == null) { + this.recv_tps = new HashMap>(); + } + this.recv_tps.put(key, val); + } + + public Map> get_recv_tps() { + return this.recv_tps; + } + + public void set_recv_tps(Map> recv_tps) { + this.recv_tps = recv_tps; + } + + public void unset_recv_tps() { + this.recv_tps = null; + } + + /** Returns true if field recv_tps is set (has been assigned a value) and false otherwise */ + public boolean is_set_recv_tps() { + return this.recv_tps != null; + } + + public void set_recv_tps_isSet(boolean value) { + if (!value) { + this.recv_tps = null; + } + } + + public int get_acked_size() { + return (this.acked == null) ? 0 : this.acked.size(); + } + + public void put_to_acked(String key, Map val) { + if (this.acked == null) { + this.acked = new HashMap>(); + } + this.acked.put(key, val); + } + + public Map> get_acked() { + return this.acked; + } + + public void set_acked(Map> acked) { + this.acked = acked; + } + + public void unset_acked() { + this.acked = null; + } + + /** Returns true if field acked is set (has been assigned a value) and false otherwise */ + public boolean is_set_acked() { + return this.acked != null; + } + + public void set_acked_isSet(boolean value) { + if (!value) { + this.acked = null; + } + } + + public int get_failed_size() { + return (this.failed == null) ? 0 : this.failed.size(); + } + + public void put_to_failed(String key, Map val) { + if (this.failed == null) { + this.failed = new HashMap>(); + } + this.failed.put(key, val); + } + + public Map> get_failed() { + return this.failed; + } + + public void set_failed(Map> failed) { + this.failed = failed; + } + + public void unset_failed() { + this.failed = null; + } + + /** Returns true if field failed is set (has been assigned a value) and false otherwise */ + public boolean is_set_failed() { + return this.failed != null; + } + + public void set_failed_isSet(boolean value) { + if (!value) { + this.failed = null; + } + } + + public int get_process_ms_avg_size() { + return (this.process_ms_avg == null) ? 0 : this.process_ms_avg.size(); + } + + public void put_to_process_ms_avg(String key, Map val) { + if (this.process_ms_avg == null) { + this.process_ms_avg = new HashMap>(); + } + this.process_ms_avg.put(key, val); + } + + public Map> get_process_ms_avg() { + return this.process_ms_avg; + } + + public void set_process_ms_avg(Map> process_ms_avg) { + this.process_ms_avg = process_ms_avg; + } + + public void unset_process_ms_avg() { + this.process_ms_avg = null; + } + + /** Returns true if field process_ms_avg is set (has been assigned a value) and false otherwise */ + public boolean is_set_process_ms_avg() { + return this.process_ms_avg != null; + } + + public void set_process_ms_avg_isSet(boolean value) { + if (!value) { + this.process_ms_avg = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case EMITTED: + if (value == null) { + unset_emitted(); + } else { + set_emitted((Map>)value); + } + break; + + case SEND_TPS: + if (value == null) { + unset_send_tps(); + } else { + set_send_tps((Map>)value); + } + break; + + case RECV_TPS: + if (value == null) { + unset_recv_tps(); + } else { + set_recv_tps((Map>)value); + } + break; + + case ACKED: + if (value == null) { + unset_acked(); + } else { + set_acked((Map>)value); + } + break; + + case FAILED: + if (value == null) { + unset_failed(); + } else { + set_failed((Map>)value); + } + break; + + case PROCESS_MS_AVG: + if (value == null) { + unset_process_ms_avg(); + } else { + set_process_ms_avg((Map>)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case EMITTED: + return get_emitted(); + + case SEND_TPS: + return get_send_tps(); + + case RECV_TPS: + return get_recv_tps(); + + case ACKED: + return get_acked(); + + case FAILED: + return get_failed(); + + case PROCESS_MS_AVG: + return get_process_ms_avg(); + + } + throw new 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(); + } + + switch (field) { + case EMITTED: + return is_set_emitted(); + case SEND_TPS: + return is_set_send_tps(); + case RECV_TPS: + return is_set_recv_tps(); + case ACKED: + return is_set_acked(); + case FAILED: + return is_set_failed(); + case PROCESS_MS_AVG: + return is_set_process_ms_avg(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TaskStats) + return this.equals((TaskStats)that); + return false; + } + + public boolean equals(TaskStats that) { + if (that == null) + return false; + + boolean this_present_emitted = true && this.is_set_emitted(); + boolean that_present_emitted = true && that.is_set_emitted(); + if (this_present_emitted || that_present_emitted) { + if (!(this_present_emitted && that_present_emitted)) + return false; + if (!this.emitted.equals(that.emitted)) + return false; + } + + boolean this_present_send_tps = true && this.is_set_send_tps(); + boolean that_present_send_tps = true && that.is_set_send_tps(); + if (this_present_send_tps || that_present_send_tps) { + if (!(this_present_send_tps && that_present_send_tps)) + return false; + if (!this.send_tps.equals(that.send_tps)) + return false; + } + + boolean this_present_recv_tps = true && this.is_set_recv_tps(); + boolean that_present_recv_tps = true && that.is_set_recv_tps(); + if (this_present_recv_tps || that_present_recv_tps) { + if (!(this_present_recv_tps && that_present_recv_tps)) + return false; + if (!this.recv_tps.equals(that.recv_tps)) + return false; + } + + boolean this_present_acked = true && this.is_set_acked(); + boolean that_present_acked = true && that.is_set_acked(); + if (this_present_acked || that_present_acked) { + if (!(this_present_acked && that_present_acked)) + return false; + if (!this.acked.equals(that.acked)) + return false; + } + + boolean this_present_failed = true && this.is_set_failed(); + boolean that_present_failed = true && that.is_set_failed(); + if (this_present_failed || that_present_failed) { + if (!(this_present_failed && that_present_failed)) + return false; + if (!this.failed.equals(that.failed)) + return false; + } + + boolean this_present_process_ms_avg = true && this.is_set_process_ms_avg(); + boolean that_present_process_ms_avg = true && that.is_set_process_ms_avg(); + if (this_present_process_ms_avg || that_present_process_ms_avg) { + if (!(this_present_process_ms_avg && that_present_process_ms_avg)) + return false; + if (!this.process_ms_avg.equals(that.process_ms_avg)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_emitted = true && (is_set_emitted()); + builder.append(present_emitted); + if (present_emitted) + builder.append(emitted); + + boolean present_send_tps = true && (is_set_send_tps()); + builder.append(present_send_tps); + if (present_send_tps) + builder.append(send_tps); + + boolean present_recv_tps = true && (is_set_recv_tps()); + builder.append(present_recv_tps); + if (present_recv_tps) + builder.append(recv_tps); + + boolean present_acked = true && (is_set_acked()); + builder.append(present_acked); + if (present_acked) + builder.append(acked); + + boolean present_failed = true && (is_set_failed()); + builder.append(present_failed); + if (present_failed) + builder.append(failed); + + boolean present_process_ms_avg = true && (is_set_process_ms_avg()); + builder.append(present_process_ms_avg); + if (present_process_ms_avg) + builder.append(process_ms_avg); + + return builder.toHashCode(); + } + + public int compareTo(TaskStats other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + TaskStats typedOther = (TaskStats)other; + + lastComparison = Boolean.valueOf(is_set_emitted()).compareTo(typedOther.is_set_emitted()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_emitted()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.emitted, typedOther.emitted); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_send_tps()).compareTo(typedOther.is_set_send_tps()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_send_tps()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.send_tps, typedOther.send_tps); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_recv_tps()).compareTo(typedOther.is_set_recv_tps()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_recv_tps()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.recv_tps, typedOther.recv_tps); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_acked()).compareTo(typedOther.is_set_acked()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_acked()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.acked, typedOther.acked); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_failed()).compareTo(typedOther.is_set_failed()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_failed()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.failed, typedOther.failed); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_process_ms_avg()).compareTo(typedOther.is_set_process_ms_avg()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_process_ms_avg()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.process_ms_avg, typedOther.process_ms_avg); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("TaskStats("); + boolean first = true; + + sb.append("emitted:"); + if (this.emitted == null) { + sb.append("null"); + } else { + sb.append(this.emitted); + } + first = false; + if (!first) sb.append(", "); + sb.append("send_tps:"); + if (this.send_tps == null) { + sb.append("null"); + } else { + sb.append(this.send_tps); + } + first = false; + if (!first) sb.append(", "); + sb.append("recv_tps:"); + if (this.recv_tps == null) { + sb.append("null"); + } else { + sb.append(this.recv_tps); + } + first = false; + if (!first) sb.append(", "); + sb.append("acked:"); + if (this.acked == null) { + sb.append("null"); + } else { + sb.append(this.acked); + } + first = false; + if (!first) sb.append(", "); + sb.append("failed:"); + if (this.failed == null) { + sb.append("null"); + } else { + sb.append(this.failed); + } + first = false; + if (!first) sb.append(", "); + sb.append("process_ms_avg:"); + if (this.process_ms_avg == null) { + sb.append("null"); + } else { + sb.append(this.process_ms_avg); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!is_set_emitted()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'emitted' is unset! Struct:" + toString()); + } + + if (!is_set_send_tps()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'send_tps' is unset! Struct:" + toString()); + } + + if (!is_set_recv_tps()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'recv_tps' is unset! Struct:" + toString()); + } + + if (!is_set_acked()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'acked' is unset! Struct:" + toString()); + } + + if (!is_set_failed()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'failed' is unset! Struct:" + toString()); + } + + if (!is_set_process_ms_avg()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'process_ms_avg' is unset! Struct:" + toString()); + } + + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + 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 TaskStatsStandardSchemeFactory implements SchemeFactory { + public TaskStatsStandardScheme getScheme() { + return new TaskStatsStandardScheme(); + } + } + + private static class TaskStatsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TaskStats 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: // EMITTED + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map90 = iprot.readMapBegin(); + struct.emitted = new HashMap>(2*_map90.size); + for (int _i91 = 0; _i91 < _map90.size; ++_i91) + { + String _key92; // required + Map _val93; // required + _key92 = iprot.readString(); + { + org.apache.thrift.protocol.TMap _map94 = iprot.readMapBegin(); + _val93 = new HashMap(2*_map94.size); + for (int _i95 = 0; _i95 < _map94.size; ++_i95) + { + String _key96; // required + long _val97; // required + _key96 = iprot.readString(); + _val97 = iprot.readI64(); + _val93.put(_key96, _val97); + } + iprot.readMapEnd(); + } + struct.emitted.put(_key92, _val93); + } + iprot.readMapEnd(); + } + struct.set_emitted_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // SEND_TPS + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map98 = iprot.readMapBegin(); + struct.send_tps = new HashMap>(2*_map98.size); + for (int _i99 = 0; _i99 < _map98.size; ++_i99) + { + String _key100; // required + Map _val101; // required + _key100 = iprot.readString(); + { + org.apache.thrift.protocol.TMap _map102 = iprot.readMapBegin(); + _val101 = new HashMap(2*_map102.size); + for (int _i103 = 0; _i103 < _map102.size; ++_i103) + { + String _key104; // required + double _val105; // required + _key104 = iprot.readString(); + _val105 = iprot.readDouble(); + _val101.put(_key104, _val105); + } + iprot.readMapEnd(); + } + struct.send_tps.put(_key100, _val101); + } + iprot.readMapEnd(); + } + struct.set_send_tps_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // RECV_TPS + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map106 = iprot.readMapBegin(); + struct.recv_tps = new HashMap>(2*_map106.size); + for (int _i107 = 0; _i107 < _map106.size; ++_i107) + { + String _key108; // required + Map _val109; // required + _key108 = iprot.readString(); + { + org.apache.thrift.protocol.TMap _map110 = iprot.readMapBegin(); + _val109 = new HashMap(2*_map110.size); + for (int _i111 = 0; _i111 < _map110.size; ++_i111) + { + GlobalStreamId _key112; // required + double _val113; // required + _key112 = new GlobalStreamId(); + _key112.read(iprot); + _val113 = iprot.readDouble(); + _val109.put(_key112, _val113); + } + iprot.readMapEnd(); + } + struct.recv_tps.put(_key108, _val109); + } + iprot.readMapEnd(); + } + struct.set_recv_tps_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // ACKED + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map114 = iprot.readMapBegin(); + struct.acked = new HashMap>(2*_map114.size); + for (int _i115 = 0; _i115 < _map114.size; ++_i115) + { + String _key116; // required + Map _val117; // required + _key116 = iprot.readString(); + { + org.apache.thrift.protocol.TMap _map118 = iprot.readMapBegin(); + _val117 = new HashMap(2*_map118.size); + for (int _i119 = 0; _i119 < _map118.size; ++_i119) + { + GlobalStreamId _key120; // required + long _val121; // required + _key120 = new GlobalStreamId(); + _key120.read(iprot); + _val121 = iprot.readI64(); + _val117.put(_key120, _val121); + } + iprot.readMapEnd(); + } + struct.acked.put(_key116, _val117); + } + iprot.readMapEnd(); + } + struct.set_acked_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // FAILED + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map122 = iprot.readMapBegin(); + struct.failed = new HashMap>(2*_map122.size); + for (int _i123 = 0; _i123 < _map122.size; ++_i123) + { + String _key124; // required + Map _val125; // required + _key124 = iprot.readString(); + { + org.apache.thrift.protocol.TMap _map126 = iprot.readMapBegin(); + _val125 = new HashMap(2*_map126.size); + for (int _i127 = 0; _i127 < _map126.size; ++_i127) + { + GlobalStreamId _key128; // required + long _val129; // required + _key128 = new GlobalStreamId(); + _key128.read(iprot); + _val129 = iprot.readI64(); + _val125.put(_key128, _val129); + } + iprot.readMapEnd(); + } + struct.failed.put(_key124, _val125); + } + iprot.readMapEnd(); + } + struct.set_failed_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // PROCESS_MS_AVG + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map130 = iprot.readMapBegin(); + struct.process_ms_avg = new HashMap>(2*_map130.size); + for (int _i131 = 0; _i131 < _map130.size; ++_i131) + { + String _key132; // required + Map _val133; // required + _key132 = iprot.readString(); + { + org.apache.thrift.protocol.TMap _map134 = iprot.readMapBegin(); + _val133 = new HashMap(2*_map134.size); + for (int _i135 = 0; _i135 < _map134.size; ++_i135) + { + GlobalStreamId _key136; // required + double _val137; // required + _key136 = new GlobalStreamId(); + _key136.read(iprot); + _val137 = iprot.readDouble(); + _val133.put(_key136, _val137); + } + iprot.readMapEnd(); + } + struct.process_ms_avg.put(_key132, _val133); + } + iprot.readMapEnd(); + } + struct.set_process_ms_avg_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, TaskStats struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.emitted != null) { + oprot.writeFieldBegin(EMITTED_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, struct.emitted.size())); + for (Map.Entry> _iter138 : struct.emitted.entrySet()) + { + oprot.writeString(_iter138.getKey()); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I64, _iter138.getValue().size())); + for (Map.Entry _iter139 : _iter138.getValue().entrySet()) + { + oprot.writeString(_iter139.getKey()); + oprot.writeI64(_iter139.getValue()); + } + oprot.writeMapEnd(); + } + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.send_tps != null) { + oprot.writeFieldBegin(SEND_TPS_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, struct.send_tps.size())); + for (Map.Entry> _iter140 : struct.send_tps.entrySet()) + { + oprot.writeString(_iter140.getKey()); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.DOUBLE, _iter140.getValue().size())); + for (Map.Entry _iter141 : _iter140.getValue().entrySet()) + { + oprot.writeString(_iter141.getKey()); + oprot.writeDouble(_iter141.getValue()); + } + oprot.writeMapEnd(); + } + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.recv_tps != null) { + oprot.writeFieldBegin(RECV_TPS_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, struct.recv_tps.size())); + for (Map.Entry> _iter142 : struct.recv_tps.entrySet()) + { + oprot.writeString(_iter142.getKey()); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.DOUBLE, _iter142.getValue().size())); + for (Map.Entry _iter143 : _iter142.getValue().entrySet()) + { + _iter143.getKey().write(oprot); + oprot.writeDouble(_iter143.getValue()); + } + oprot.writeMapEnd(); + } + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.acked != null) { + oprot.writeFieldBegin(ACKED_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, struct.acked.size())); + for (Map.Entry> _iter144 : struct.acked.entrySet()) + { + oprot.writeString(_iter144.getKey()); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.I64, _iter144.getValue().size())); + for (Map.Entry _iter145 : _iter144.getValue().entrySet()) + { + _iter145.getKey().write(oprot); + oprot.writeI64(_iter145.getValue()); + } + oprot.writeMapEnd(); + } + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.failed != null) { + oprot.writeFieldBegin(FAILED_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, struct.failed.size())); + for (Map.Entry> _iter146 : struct.failed.entrySet()) + { + oprot.writeString(_iter146.getKey()); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.I64, _iter146.getValue().size())); + for (Map.Entry _iter147 : _iter146.getValue().entrySet()) + { + _iter147.getKey().write(oprot); + oprot.writeI64(_iter147.getValue()); + } + oprot.writeMapEnd(); + } + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.process_ms_avg != null) { + oprot.writeFieldBegin(PROCESS_MS_AVG_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, struct.process_ms_avg.size())); + for (Map.Entry> _iter148 : struct.process_ms_avg.entrySet()) + { + oprot.writeString(_iter148.getKey()); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.DOUBLE, _iter148.getValue().size())); + for (Map.Entry _iter149 : _iter148.getValue().entrySet()) + { + _iter149.getKey().write(oprot); + oprot.writeDouble(_iter149.getValue()); + } + oprot.writeMapEnd(); + } + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TaskStatsTupleSchemeFactory implements SchemeFactory { + public TaskStatsTupleScheme getScheme() { + return new TaskStatsTupleScheme(); + } + } + + private static class TaskStatsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TaskStats struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + { + oprot.writeI32(struct.emitted.size()); + for (Map.Entry> _iter150 : struct.emitted.entrySet()) + { + oprot.writeString(_iter150.getKey()); + { + oprot.writeI32(_iter150.getValue().size()); + for (Map.Entry _iter151 : _iter150.getValue().entrySet()) + { + oprot.writeString(_iter151.getKey()); + oprot.writeI64(_iter151.getValue()); + } + } + } + } + { + oprot.writeI32(struct.send_tps.size()); + for (Map.Entry> _iter152 : struct.send_tps.entrySet()) + { + oprot.writeString(_iter152.getKey()); + { + oprot.writeI32(_iter152.getValue().size()); + for (Map.Entry _iter153 : _iter152.getValue().entrySet()) + { + oprot.writeString(_iter153.getKey()); + oprot.writeDouble(_iter153.getValue()); + } + } + } + } + { + oprot.writeI32(struct.recv_tps.size()); + for (Map.Entry> _iter154 : struct.recv_tps.entrySet()) + { + oprot.writeString(_iter154.getKey()); + { + oprot.writeI32(_iter154.getValue().size()); + for (Map.Entry _iter155 : _iter154.getValue().entrySet()) + { + _iter155.getKey().write(oprot); + oprot.writeDouble(_iter155.getValue()); + } + } + } + } + { + oprot.writeI32(struct.acked.size()); + for (Map.Entry> _iter156 : struct.acked.entrySet()) + { + oprot.writeString(_iter156.getKey()); + { + oprot.writeI32(_iter156.getValue().size()); + for (Map.Entry _iter157 : _iter156.getValue().entrySet()) + { + _iter157.getKey().write(oprot); + oprot.writeI64(_iter157.getValue()); + } + } + } + } + { + oprot.writeI32(struct.failed.size()); + for (Map.Entry> _iter158 : struct.failed.entrySet()) + { + oprot.writeString(_iter158.getKey()); + { + oprot.writeI32(_iter158.getValue().size()); + for (Map.Entry _iter159 : _iter158.getValue().entrySet()) + { + _iter159.getKey().write(oprot); + oprot.writeI64(_iter159.getValue()); + } + } + } + } + { + oprot.writeI32(struct.process_ms_avg.size()); + for (Map.Entry> _iter160 : struct.process_ms_avg.entrySet()) + { + oprot.writeString(_iter160.getKey()); + { + oprot.writeI32(_iter160.getValue().size()); + for (Map.Entry _iter161 : _iter160.getValue().entrySet()) + { + _iter161.getKey().write(oprot); + oprot.writeDouble(_iter161.getValue()); + } + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TaskStats struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + { + org.apache.thrift.protocol.TMap _map162 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, iprot.readI32()); + struct.emitted = new HashMap>(2*_map162.size); + for (int _i163 = 0; _i163 < _map162.size; ++_i163) + { + String _key164; // required + Map _val165; // required + _key164 = iprot.readString(); + { + org.apache.thrift.protocol.TMap _map166 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I64, iprot.readI32()); + _val165 = new HashMap(2*_map166.size); + for (int _i167 = 0; _i167 < _map166.size; ++_i167) + { + String _key168; // required + long _val169; // required + _key168 = iprot.readString(); + _val169 = iprot.readI64(); + _val165.put(_key168, _val169); + } + } + struct.emitted.put(_key164, _val165); + } + } + struct.set_emitted_isSet(true); + { + org.apache.thrift.protocol.TMap _map170 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, iprot.readI32()); + struct.send_tps = new HashMap>(2*_map170.size); + for (int _i171 = 0; _i171 < _map170.size; ++_i171) + { + String _key172; // required + Map _val173; // required + _key172 = iprot.readString(); + { + org.apache.thrift.protocol.TMap _map174 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.DOUBLE, iprot.readI32()); + _val173 = new HashMap(2*_map174.size); + for (int _i175 = 0; _i175 < _map174.size; ++_i175) + { + String _key176; // required + double _val177; // required + _key176 = iprot.readString(); + _val177 = iprot.readDouble(); + _val173.put(_key176, _val177); + } + } + struct.send_tps.put(_key172, _val173); + } + } + struct.set_send_tps_isSet(true); + { + org.apache.thrift.protocol.TMap _map178 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, iprot.readI32()); + struct.recv_tps = new HashMap>(2*_map178.size); + for (int _i179 = 0; _i179 < _map178.size; ++_i179) + { + String _key180; // required + Map _val181; // required + _key180 = iprot.readString(); + { + org.apache.thrift.protocol.TMap _map182 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.DOUBLE, iprot.readI32()); + _val181 = new HashMap(2*_map182.size); + for (int _i183 = 0; _i183 < _map182.size; ++_i183) + { + GlobalStreamId _key184; // required + double _val185; // required + _key184 = new GlobalStreamId(); + _key184.read(iprot); + _val185 = iprot.readDouble(); + _val181.put(_key184, _val185); + } + } + struct.recv_tps.put(_key180, _val181); + } + } + struct.set_recv_tps_isSet(true); + { + org.apache.thrift.protocol.TMap _map186 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, iprot.readI32()); + struct.acked = new HashMap>(2*_map186.size); + for (int _i187 = 0; _i187 < _map186.size; ++_i187) + { + String _key188; // required + Map _val189; // required + _key188 = iprot.readString(); + { + org.apache.thrift.protocol.TMap _map190 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.I64, iprot.readI32()); + _val189 = new HashMap(2*_map190.size); + for (int _i191 = 0; _i191 < _map190.size; ++_i191) + { + GlobalStreamId _key192; // required + long _val193; // required + _key192 = new GlobalStreamId(); + _key192.read(iprot); + _val193 = iprot.readI64(); + _val189.put(_key192, _val193); + } + } + struct.acked.put(_key188, _val189); + } + } + struct.set_acked_isSet(true); + { + org.apache.thrift.protocol.TMap _map194 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, iprot.readI32()); + struct.failed = new HashMap>(2*_map194.size); + for (int _i195 = 0; _i195 < _map194.size; ++_i195) + { + String _key196; // required + Map _val197; // required + _key196 = iprot.readString(); + { + org.apache.thrift.protocol.TMap _map198 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.I64, iprot.readI32()); + _val197 = new HashMap(2*_map198.size); + for (int _i199 = 0; _i199 < _map198.size; ++_i199) + { + GlobalStreamId _key200; // required + long _val201; // required + _key200 = new GlobalStreamId(); + _key200.read(iprot); + _val201 = iprot.readI64(); + _val197.put(_key200, _val201); + } + } + struct.failed.put(_key196, _val197); + } + } + struct.set_failed_isSet(true); + { + org.apache.thrift.protocol.TMap _map202 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, iprot.readI32()); + struct.process_ms_avg = new HashMap>(2*_map202.size); + for (int _i203 = 0; _i203 < _map202.size; ++_i203) + { + String _key204; // required + Map _val205; // required + _key204 = iprot.readString(); + { + org.apache.thrift.protocol.TMap _map206 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.DOUBLE, iprot.readI32()); + _val205 = new HashMap(2*_map206.size); + for (int _i207 = 0; _i207 < _map206.size; ++_i207) + { + GlobalStreamId _key208; // required + double _val209; // required + _key208 = new GlobalStreamId(); + _key208.read(iprot); + _val209 = iprot.readDouble(); + _val205.put(_key208, _val209); + } + } + struct.process_ms_avg.put(_key204, _val205); + } + } + struct.set_process_ms_avg_isSet(true); + } + } + +} + diff --git a/jstorm-client/src/main/java/backtype/storm/generated/TaskSummary.java b/jstorm-client/src/main/java/backtype/storm/generated/TaskSummary.java index 198f1e4a7..1b7fe5d3b 100644 --- a/jstorm-client/src/main/java/backtype/storm/generated/TaskSummary.java +++ b/jstorm-client/src/main/java/backtype/storm/generated/TaskSummary.java @@ -1,937 +1,1039 @@ -/** - * Autogenerated by Thrift Compiler (0.7.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - */ -package backtype.storm.generated; - -import org.apache.commons.lang.builder.HashCodeBuilder; -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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TaskSummary implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TaskSummary"); - - private static final org.apache.thrift.protocol.TField TASK_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("task_id", org.apache.thrift.protocol.TType.I32, (short)1); - private static final org.apache.thrift.protocol.TField COMPONENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("component_id", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField HOST_FIELD_DESC = new org.apache.thrift.protocol.TField("host", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final org.apache.thrift.protocol.TField PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("port", org.apache.thrift.protocol.TType.I32, (short)4); - private static final org.apache.thrift.protocol.TField UPTIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("uptime_secs", org.apache.thrift.protocol.TType.I32, (short)5); - private static final org.apache.thrift.protocol.TField ERRORS_FIELD_DESC = new org.apache.thrift.protocol.TField("errors", org.apache.thrift.protocol.TType.LIST, (short)6); - private static final org.apache.thrift.protocol.TField STATS_FIELD_DESC = new org.apache.thrift.protocol.TField("stats", org.apache.thrift.protocol.TType.STRUCT, (short)7); - - private int task_id; // required - private String component_id; // required - private String host; // required - private int port; // required - private int uptime_secs; // required - private List errors; // required - private TaskStats stats; // 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 { - TASK_ID((short)1, "task_id"), - COMPONENT_ID((short)2, "component_id"), - HOST((short)3, "host"), - PORT((short)4, "port"), - UPTIME_SECS((short)5, "uptime_secs"), - ERRORS((short)6, "errors"), - STATS((short)7, "stats"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // TASK_ID - return TASK_ID; - case 2: // COMPONENT_ID - return COMPONENT_ID; - case 3: // HOST - return HOST; - case 4: // PORT - return PORT; - case 5: // UPTIME_SECS - return UPTIME_SECS; - case 6: // ERRORS - return ERRORS; - case 7: // STATS - return STATS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __TASK_ID_ISSET_ID = 0; - private static final int __PORT_ISSET_ID = 1; - private static final int __UPTIME_SECS_ISSET_ID = 2; - private BitSet __isset_bit_vector = new BitSet(3); - - 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); - tmpMap.put(_Fields.TASK_ID, new org.apache.thrift.meta_data.FieldMetaData("task_id", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.COMPONENT_ID, new org.apache.thrift.meta_data.FieldMetaData("component_id", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.HOST, new org.apache.thrift.meta_data.FieldMetaData("host", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.PORT, new org.apache.thrift.meta_data.FieldMetaData("port", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.UPTIME_SECS, new org.apache.thrift.meta_data.FieldMetaData("uptime_secs", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.ERRORS, new org.apache.thrift.meta_data.FieldMetaData("errors", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ErrorInfo.class)))); - tmpMap.put(_Fields.STATS, new org.apache.thrift.meta_data.FieldMetaData("stats", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TaskStats.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TaskSummary.class, metaDataMap); - } - - public TaskSummary() { - } - - public TaskSummary( - int task_id, - String component_id, - String host, - int port, - int uptime_secs, - List errors) - { - this(); - this.task_id = task_id; - set_task_id_isSet(true); - this.component_id = component_id; - this.host = host; - this.port = port; - set_port_isSet(true); - this.uptime_secs = uptime_secs; - set_uptime_secs_isSet(true); - this.errors = errors; - } - - /** - * Performs a deep copy on other. - */ - public TaskSummary(TaskSummary other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); - this.task_id = other.task_id; - if (other.is_set_component_id()) { - this.component_id = other.component_id; - } - if (other.is_set_host()) { - this.host = other.host; - } - this.port = other.port; - this.uptime_secs = other.uptime_secs; - if (other.is_set_errors()) { - List __this__errors = new ArrayList(); - for (ErrorInfo other_element : other.errors) { - __this__errors.add(new ErrorInfo(other_element)); - } - this.errors = __this__errors; - } - if (other.is_set_stats()) { - this.stats = new TaskStats(other.stats); - } - } - - public TaskSummary deepCopy() { - return new TaskSummary(this); - } - - @Override - public void clear() { - set_task_id_isSet(false); - this.task_id = 0; - this.component_id = null; - this.host = null; - set_port_isSet(false); - this.port = 0; - set_uptime_secs_isSet(false); - this.uptime_secs = 0; - this.errors = null; - this.stats = null; - } - - public int get_task_id() { - return this.task_id; - } - - public void set_task_id(int task_id) { - this.task_id = task_id; - set_task_id_isSet(true); - } - - public void unset_task_id() { - __isset_bit_vector.clear(__TASK_ID_ISSET_ID); - } - - /** Returns true if field task_id is set (has been assigned a value) and false otherwise */ - public boolean is_set_task_id() { - return __isset_bit_vector.get(__TASK_ID_ISSET_ID); - } - - public void set_task_id_isSet(boolean value) { - __isset_bit_vector.set(__TASK_ID_ISSET_ID, value); - } - - public String get_component_id() { - return this.component_id; - } - - public void set_component_id(String component_id) { - this.component_id = component_id; - } - - public void unset_component_id() { - this.component_id = null; - } - - /** Returns true if field component_id is set (has been assigned a value) and false otherwise */ - public boolean is_set_component_id() { - return this.component_id != null; - } - - public void set_component_id_isSet(boolean value) { - if (!value) { - this.component_id = null; - } - } - - public String get_host() { - return this.host; - } - - public void set_host(String host) { - this.host = host; - } - - public void unset_host() { - this.host = null; - } - - /** Returns true if field host is set (has been assigned a value) and false otherwise */ - public boolean is_set_host() { - return this.host != null; - } - - public void set_host_isSet(boolean value) { - if (!value) { - this.host = null; - } - } - - public int get_port() { - return this.port; - } - - public void set_port(int port) { - this.port = port; - set_port_isSet(true); - } - - public void unset_port() { - __isset_bit_vector.clear(__PORT_ISSET_ID); - } - - /** Returns true if field port is set (has been assigned a value) and false otherwise */ - public boolean is_set_port() { - return __isset_bit_vector.get(__PORT_ISSET_ID); - } - - public void set_port_isSet(boolean value) { - __isset_bit_vector.set(__PORT_ISSET_ID, value); - } - - public int get_uptime_secs() { - return this.uptime_secs; - } - - public void set_uptime_secs(int uptime_secs) { - this.uptime_secs = uptime_secs; - set_uptime_secs_isSet(true); - } - - public void unset_uptime_secs() { - __isset_bit_vector.clear(__UPTIME_SECS_ISSET_ID); - } - - /** Returns true if field uptime_secs is set (has been assigned a value) and false otherwise */ - public boolean is_set_uptime_secs() { - return __isset_bit_vector.get(__UPTIME_SECS_ISSET_ID); - } - - public void set_uptime_secs_isSet(boolean value) { - __isset_bit_vector.set(__UPTIME_SECS_ISSET_ID, value); - } - - public int get_errors_size() { - return (this.errors == null) ? 0 : this.errors.size(); - } - - public java.util.Iterator get_errors_iterator() { - return (this.errors == null) ? null : this.errors.iterator(); - } - - public void add_to_errors(ErrorInfo elem) { - if (this.errors == null) { - this.errors = new ArrayList(); - } - this.errors.add(elem); - } - - public List get_errors() { - return this.errors; - } - - public void set_errors(List errors) { - this.errors = errors; - } - - public void unset_errors() { - this.errors = null; - } - - /** Returns true if field errors is set (has been assigned a value) and false otherwise */ - public boolean is_set_errors() { - return this.errors != null; - } - - public void set_errors_isSet(boolean value) { - if (!value) { - this.errors = null; - } - } - - public TaskStats get_stats() { - return this.stats; - } - - public void set_stats(TaskStats stats) { - this.stats = stats; - } - - public void unset_stats() { - this.stats = null; - } - - /** Returns true if field stats is set (has been assigned a value) and false otherwise */ - public boolean is_set_stats() { - return this.stats != null; - } - - public void set_stats_isSet(boolean value) { - if (!value) { - this.stats = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case TASK_ID: - if (value == null) { - unset_task_id(); - } else { - set_task_id((Integer)value); - } - break; - - case COMPONENT_ID: - if (value == null) { - unset_component_id(); - } else { - set_component_id((String)value); - } - break; - - case HOST: - if (value == null) { - unset_host(); - } else { - set_host((String)value); - } - break; - - case PORT: - if (value == null) { - unset_port(); - } else { - set_port((Integer)value); - } - break; - - case UPTIME_SECS: - if (value == null) { - unset_uptime_secs(); - } else { - set_uptime_secs((Integer)value); - } - break; - - case ERRORS: - if (value == null) { - unset_errors(); - } else { - set_errors((List)value); - } - break; - - case STATS: - if (value == null) { - unset_stats(); - } else { - set_stats((TaskStats)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case TASK_ID: - return Integer.valueOf(get_task_id()); - - case COMPONENT_ID: - return get_component_id(); - - case HOST: - return get_host(); - - case PORT: - return Integer.valueOf(get_port()); - - case UPTIME_SECS: - return Integer.valueOf(get_uptime_secs()); - - case ERRORS: - return get_errors(); - - case STATS: - return get_stats(); - - } - throw new 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(); - } - - switch (field) { - case TASK_ID: - return is_set_task_id(); - case COMPONENT_ID: - return is_set_component_id(); - case HOST: - return is_set_host(); - case PORT: - return is_set_port(); - case UPTIME_SECS: - return is_set_uptime_secs(); - case ERRORS: - return is_set_errors(); - case STATS: - return is_set_stats(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TaskSummary) - return this.equals((TaskSummary)that); - return false; - } - - public boolean equals(TaskSummary that) { - if (that == null) - return false; - - boolean this_present_task_id = true; - boolean that_present_task_id = true; - if (this_present_task_id || that_present_task_id) { - if (!(this_present_task_id && that_present_task_id)) - return false; - if (this.task_id != that.task_id) - return false; - } - - boolean this_present_component_id = true && this.is_set_component_id(); - boolean that_present_component_id = true && that.is_set_component_id(); - if (this_present_component_id || that_present_component_id) { - if (!(this_present_component_id && that_present_component_id)) - return false; - if (!this.component_id.equals(that.component_id)) - return false; - } - - boolean this_present_host = true && this.is_set_host(); - boolean that_present_host = true && that.is_set_host(); - if (this_present_host || that_present_host) { - if (!(this_present_host && that_present_host)) - return false; - if (!this.host.equals(that.host)) - return false; - } - - boolean this_present_port = true; - boolean that_present_port = true; - if (this_present_port || that_present_port) { - if (!(this_present_port && that_present_port)) - return false; - if (this.port != that.port) - return false; - } - - boolean this_present_uptime_secs = true; - boolean that_present_uptime_secs = true; - if (this_present_uptime_secs || that_present_uptime_secs) { - if (!(this_present_uptime_secs && that_present_uptime_secs)) - return false; - if (this.uptime_secs != that.uptime_secs) - return false; - } - - boolean this_present_errors = true && this.is_set_errors(); - boolean that_present_errors = true && that.is_set_errors(); - if (this_present_errors || that_present_errors) { - if (!(this_present_errors && that_present_errors)) - return false; - if (!this.errors.equals(that.errors)) - return false; - } - - boolean this_present_stats = true && this.is_set_stats(); - boolean that_present_stats = true && that.is_set_stats(); - if (this_present_stats || that_present_stats) { - if (!(this_present_stats && that_present_stats)) - return false; - if (!this.stats.equals(that.stats)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_task_id = true; - builder.append(present_task_id); - if (present_task_id) - builder.append(task_id); - - boolean present_component_id = true && (is_set_component_id()); - builder.append(present_component_id); - if (present_component_id) - builder.append(component_id); - - boolean present_host = true && (is_set_host()); - builder.append(present_host); - if (present_host) - builder.append(host); - - boolean present_port = true; - builder.append(present_port); - if (present_port) - builder.append(port); - - boolean present_uptime_secs = true; - builder.append(present_uptime_secs); - if (present_uptime_secs) - builder.append(uptime_secs); - - boolean present_errors = true && (is_set_errors()); - builder.append(present_errors); - if (present_errors) - builder.append(errors); - - boolean present_stats = true && (is_set_stats()); - builder.append(present_stats); - if (present_stats) - builder.append(stats); - - return builder.toHashCode(); - } - - public int compareTo(TaskSummary other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TaskSummary typedOther = (TaskSummary)other; - - lastComparison = Boolean.valueOf(is_set_task_id()).compareTo(typedOther.is_set_task_id()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_task_id()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.task_id, typedOther.task_id); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_component_id()).compareTo(typedOther.is_set_component_id()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_component_id()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.component_id, typedOther.component_id); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_host()).compareTo(typedOther.is_set_host()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_host()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.host, typedOther.host); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_port()).compareTo(typedOther.is_set_port()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_port()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.port, typedOther.port); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_uptime_secs()).compareTo(typedOther.is_set_uptime_secs()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_uptime_secs()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uptime_secs, typedOther.uptime_secs); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_errors()).compareTo(typedOther.is_set_errors()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_errors()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errors, typedOther.errors); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_stats()).compareTo(typedOther.is_set_stats()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_stats()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stats, typedOther.stats); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // TASK_ID - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.task_id = iprot.readI32(); - set_task_id_isSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // COMPONENT_ID - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.component_id = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // HOST - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.host = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // PORT - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.port = iprot.readI32(); - set_port_isSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 5: // UPTIME_SECS - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.uptime_secs = iprot.readI32(); - set_uptime_secs_isSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 6: // ERRORS - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list105 = iprot.readListBegin(); - this.errors = new ArrayList(_list105.size); - for (int _i106 = 0; _i106 < _list105.size; ++_i106) - { - ErrorInfo _elem107; // required - _elem107 = new ErrorInfo(); - _elem107.read(iprot); - this.errors.add(_elem107); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 7: // STATS - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.stats = new TaskStats(); - this.stats.read(iprot); - } 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(TASK_ID_FIELD_DESC); - oprot.writeI32(this.task_id); - oprot.writeFieldEnd(); - if (this.component_id != null) { - oprot.writeFieldBegin(COMPONENT_ID_FIELD_DESC); - oprot.writeString(this.component_id); - oprot.writeFieldEnd(); - } - if (this.host != null) { - oprot.writeFieldBegin(HOST_FIELD_DESC); - oprot.writeString(this.host); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(PORT_FIELD_DESC); - oprot.writeI32(this.port); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(UPTIME_SECS_FIELD_DESC); - oprot.writeI32(this.uptime_secs); - oprot.writeFieldEnd(); - if (this.errors != null) { - oprot.writeFieldBegin(ERRORS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.errors.size())); - for (ErrorInfo _iter108 : this.errors) - { - _iter108.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (this.stats != null) { - if (is_set_stats()) { - oprot.writeFieldBegin(STATS_FIELD_DESC); - this.stats.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TaskSummary("); - boolean first = true; - - sb.append("task_id:"); - sb.append(this.task_id); - first = false; - if (!first) sb.append(", "); - sb.append("component_id:"); - if (this.component_id == null) { - sb.append("null"); - } else { - sb.append(this.component_id); - } - first = false; - if (!first) sb.append(", "); - sb.append("host:"); - if (this.host == null) { - sb.append("null"); - } else { - sb.append(this.host); - } - first = false; - if (!first) sb.append(", "); - sb.append("port:"); - sb.append(this.port); - first = false; - if (!first) sb.append(", "); - sb.append("uptime_secs:"); - sb.append(this.uptime_secs); - first = false; - if (!first) sb.append(", "); - sb.append("errors:"); - if (this.errors == null) { - sb.append("null"); - } else { - sb.append(this.errors); - } - first = false; - if (is_set_stats()) { - if (!first) sb.append(", "); - sb.append("stats:"); - if (this.stats == null) { - sb.append("null"); - } else { - sb.append(this.stats); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!is_set_task_id()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'task_id' is unset! Struct:" + toString()); - } - - if (!is_set_component_id()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'component_id' is unset! Struct:" + toString()); - } - - if (!is_set_host()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'host' is unset! Struct:" + toString()); - } - - if (!is_set_port()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'port' is unset! Struct:" + toString()); - } - - if (!is_set_uptime_secs()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'uptime_secs' is unset! Struct:" + toString()); - } - - if (!is_set_errors()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'errors' is unset! Struct:" + toString()); - } - - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - 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); - 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); - } - } - -} - +/** + * Autogenerated by Thrift Compiler (0.8.0) + * + * 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 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TaskSummary implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TaskSummary"); + + private static final org.apache.thrift.protocol.TField TASK_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("task_id", org.apache.thrift.protocol.TType.I32, (short)1); + private static final org.apache.thrift.protocol.TField COMPONENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("component_id", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField HOST_FIELD_DESC = new org.apache.thrift.protocol.TField("host", org.apache.thrift.protocol.TType.STRING, (short)3); + private static final org.apache.thrift.protocol.TField PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("port", org.apache.thrift.protocol.TType.I32, (short)4); + private static final org.apache.thrift.protocol.TField UPTIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("uptime_secs", org.apache.thrift.protocol.TType.I32, (short)5); + private static final org.apache.thrift.protocol.TField ERRORS_FIELD_DESC = new org.apache.thrift.protocol.TField("errors", org.apache.thrift.protocol.TType.LIST, (short)6); + private static final org.apache.thrift.protocol.TField STATS_FIELD_DESC = new org.apache.thrift.protocol.TField("stats", org.apache.thrift.protocol.TType.STRUCT, (short)7); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TaskSummaryStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TaskSummaryTupleSchemeFactory()); + } + + private int task_id; // required + private String component_id; // required + private String host; // required + private int port; // required + private int uptime_secs; // required + private List errors; // required + private TaskStats stats; // 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 { + TASK_ID((short)1, "task_id"), + COMPONENT_ID((short)2, "component_id"), + HOST((short)3, "host"), + PORT((short)4, "port"), + UPTIME_SECS((short)5, "uptime_secs"), + ERRORS((short)6, "errors"), + STATS((short)7, "stats"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // TASK_ID + return TASK_ID; + case 2: // COMPONENT_ID + return COMPONENT_ID; + case 3: // HOST + return HOST; + case 4: // PORT + return PORT; + case 5: // UPTIME_SECS + return UPTIME_SECS; + case 6: // ERRORS + return ERRORS; + case 7: // STATS + return STATS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __TASK_ID_ISSET_ID = 0; + private static final int __PORT_ISSET_ID = 1; + private static final int __UPTIME_SECS_ISSET_ID = 2; + private BitSet __isset_bit_vector = new BitSet(3); + private _Fields optionals[] = {_Fields.STATS}; + 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); + tmpMap.put(_Fields.TASK_ID, new org.apache.thrift.meta_data.FieldMetaData("task_id", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.COMPONENT_ID, new org.apache.thrift.meta_data.FieldMetaData("component_id", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.HOST, new org.apache.thrift.meta_data.FieldMetaData("host", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.PORT, new org.apache.thrift.meta_data.FieldMetaData("port", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.UPTIME_SECS, new org.apache.thrift.meta_data.FieldMetaData("uptime_secs", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.ERRORS, new org.apache.thrift.meta_data.FieldMetaData("errors", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ErrorInfo.class)))); + tmpMap.put(_Fields.STATS, new org.apache.thrift.meta_data.FieldMetaData("stats", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TaskStats.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TaskSummary.class, metaDataMap); + } + + public TaskSummary() { + } + + public TaskSummary( + int task_id, + String component_id, + String host, + int port, + int uptime_secs, + List errors) + { + this(); + this.task_id = task_id; + set_task_id_isSet(true); + this.component_id = component_id; + this.host = host; + this.port = port; + set_port_isSet(true); + this.uptime_secs = uptime_secs; + set_uptime_secs_isSet(true); + this.errors = errors; + } + + /** + * Performs a deep copy on other. + */ + public TaskSummary(TaskSummary other) { + __isset_bit_vector.clear(); + __isset_bit_vector.or(other.__isset_bit_vector); + this.task_id = other.task_id; + if (other.is_set_component_id()) { + this.component_id = other.component_id; + } + if (other.is_set_host()) { + this.host = other.host; + } + this.port = other.port; + this.uptime_secs = other.uptime_secs; + if (other.is_set_errors()) { + List __this__errors = new ArrayList(); + for (ErrorInfo other_element : other.errors) { + __this__errors.add(new ErrorInfo(other_element)); + } + this.errors = __this__errors; + } + if (other.is_set_stats()) { + this.stats = new TaskStats(other.stats); + } + } + + public TaskSummary deepCopy() { + return new TaskSummary(this); + } + + @Override + public void clear() { + set_task_id_isSet(false); + this.task_id = 0; + this.component_id = null; + this.host = null; + set_port_isSet(false); + this.port = 0; + set_uptime_secs_isSet(false); + this.uptime_secs = 0; + this.errors = null; + this.stats = null; + } + + public int get_task_id() { + return this.task_id; + } + + public void set_task_id(int task_id) { + this.task_id = task_id; + set_task_id_isSet(true); + } + + public void unset_task_id() { + __isset_bit_vector.clear(__TASK_ID_ISSET_ID); + } + + /** Returns true if field task_id is set (has been assigned a value) and false otherwise */ + public boolean is_set_task_id() { + return __isset_bit_vector.get(__TASK_ID_ISSET_ID); + } + + public void set_task_id_isSet(boolean value) { + __isset_bit_vector.set(__TASK_ID_ISSET_ID, value); + } + + public String get_component_id() { + return this.component_id; + } + + public void set_component_id(String component_id) { + this.component_id = component_id; + } + + public void unset_component_id() { + this.component_id = null; + } + + /** Returns true if field component_id is set (has been assigned a value) and false otherwise */ + public boolean is_set_component_id() { + return this.component_id != null; + } + + public void set_component_id_isSet(boolean value) { + if (!value) { + this.component_id = null; + } + } + + public String get_host() { + return this.host; + } + + public void set_host(String host) { + this.host = host; + } + + public void unset_host() { + this.host = null; + } + + /** Returns true if field host is set (has been assigned a value) and false otherwise */ + public boolean is_set_host() { + return this.host != null; + } + + public void set_host_isSet(boolean value) { + if (!value) { + this.host = null; + } + } + + public int get_port() { + return this.port; + } + + public void set_port(int port) { + this.port = port; + set_port_isSet(true); + } + + public void unset_port() { + __isset_bit_vector.clear(__PORT_ISSET_ID); + } + + /** Returns true if field port is set (has been assigned a value) and false otherwise */ + public boolean is_set_port() { + return __isset_bit_vector.get(__PORT_ISSET_ID); + } + + public void set_port_isSet(boolean value) { + __isset_bit_vector.set(__PORT_ISSET_ID, value); + } + + public int get_uptime_secs() { + return this.uptime_secs; + } + + public void set_uptime_secs(int uptime_secs) { + this.uptime_secs = uptime_secs; + set_uptime_secs_isSet(true); + } + + public void unset_uptime_secs() { + __isset_bit_vector.clear(__UPTIME_SECS_ISSET_ID); + } + + /** Returns true if field uptime_secs is set (has been assigned a value) and false otherwise */ + public boolean is_set_uptime_secs() { + return __isset_bit_vector.get(__UPTIME_SECS_ISSET_ID); + } + + public void set_uptime_secs_isSet(boolean value) { + __isset_bit_vector.set(__UPTIME_SECS_ISSET_ID, value); + } + + public int get_errors_size() { + return (this.errors == null) ? 0 : this.errors.size(); + } + + public java.util.Iterator get_errors_iterator() { + return (this.errors == null) ? null : this.errors.iterator(); + } + + public void add_to_errors(ErrorInfo elem) { + if (this.errors == null) { + this.errors = new ArrayList(); + } + this.errors.add(elem); + } + + public List get_errors() { + return this.errors; + } + + public void set_errors(List errors) { + this.errors = errors; + } + + public void unset_errors() { + this.errors = null; + } + + /** Returns true if field errors is set (has been assigned a value) and false otherwise */ + public boolean is_set_errors() { + return this.errors != null; + } + + public void set_errors_isSet(boolean value) { + if (!value) { + this.errors = null; + } + } + + public TaskStats get_stats() { + return this.stats; + } + + public void set_stats(TaskStats stats) { + this.stats = stats; + } + + public void unset_stats() { + this.stats = null; + } + + /** Returns true if field stats is set (has been assigned a value) and false otherwise */ + public boolean is_set_stats() { + return this.stats != null; + } + + public void set_stats_isSet(boolean value) { + if (!value) { + this.stats = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TASK_ID: + if (value == null) { + unset_task_id(); + } else { + set_task_id((Integer)value); + } + break; + + case COMPONENT_ID: + if (value == null) { + unset_component_id(); + } else { + set_component_id((String)value); + } + break; + + case HOST: + if (value == null) { + unset_host(); + } else { + set_host((String)value); + } + break; + + case PORT: + if (value == null) { + unset_port(); + } else { + set_port((Integer)value); + } + break; + + case UPTIME_SECS: + if (value == null) { + unset_uptime_secs(); + } else { + set_uptime_secs((Integer)value); + } + break; + + case ERRORS: + if (value == null) { + unset_errors(); + } else { + set_errors((List)value); + } + break; + + case STATS: + if (value == null) { + unset_stats(); + } else { + set_stats((TaskStats)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TASK_ID: + return Integer.valueOf(get_task_id()); + + case COMPONENT_ID: + return get_component_id(); + + case HOST: + return get_host(); + + case PORT: + return Integer.valueOf(get_port()); + + case UPTIME_SECS: + return Integer.valueOf(get_uptime_secs()); + + case ERRORS: + return get_errors(); + + case STATS: + return get_stats(); + + } + throw new 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(); + } + + switch (field) { + case TASK_ID: + return is_set_task_id(); + case COMPONENT_ID: + return is_set_component_id(); + case HOST: + return is_set_host(); + case PORT: + return is_set_port(); + case UPTIME_SECS: + return is_set_uptime_secs(); + case ERRORS: + return is_set_errors(); + case STATS: + return is_set_stats(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TaskSummary) + return this.equals((TaskSummary)that); + return false; + } + + public boolean equals(TaskSummary that) { + if (that == null) + return false; + + boolean this_present_task_id = true; + boolean that_present_task_id = true; + if (this_present_task_id || that_present_task_id) { + if (!(this_present_task_id && that_present_task_id)) + return false; + if (this.task_id != that.task_id) + return false; + } + + boolean this_present_component_id = true && this.is_set_component_id(); + boolean that_present_component_id = true && that.is_set_component_id(); + if (this_present_component_id || that_present_component_id) { + if (!(this_present_component_id && that_present_component_id)) + return false; + if (!this.component_id.equals(that.component_id)) + return false; + } + + boolean this_present_host = true && this.is_set_host(); + boolean that_present_host = true && that.is_set_host(); + if (this_present_host || that_present_host) { + if (!(this_present_host && that_present_host)) + return false; + if (!this.host.equals(that.host)) + return false; + } + + boolean this_present_port = true; + boolean that_present_port = true; + if (this_present_port || that_present_port) { + if (!(this_present_port && that_present_port)) + return false; + if (this.port != that.port) + return false; + } + + boolean this_present_uptime_secs = true; + boolean that_present_uptime_secs = true; + if (this_present_uptime_secs || that_present_uptime_secs) { + if (!(this_present_uptime_secs && that_present_uptime_secs)) + return false; + if (this.uptime_secs != that.uptime_secs) + return false; + } + + boolean this_present_errors = true && this.is_set_errors(); + boolean that_present_errors = true && that.is_set_errors(); + if (this_present_errors || that_present_errors) { + if (!(this_present_errors && that_present_errors)) + return false; + if (!this.errors.equals(that.errors)) + return false; + } + + boolean this_present_stats = true && this.is_set_stats(); + boolean that_present_stats = true && that.is_set_stats(); + if (this_present_stats || that_present_stats) { + if (!(this_present_stats && that_present_stats)) + return false; + if (!this.stats.equals(that.stats)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_task_id = true; + builder.append(present_task_id); + if (present_task_id) + builder.append(task_id); + + boolean present_component_id = true && (is_set_component_id()); + builder.append(present_component_id); + if (present_component_id) + builder.append(component_id); + + boolean present_host = true && (is_set_host()); + builder.append(present_host); + if (present_host) + builder.append(host); + + boolean present_port = true; + builder.append(present_port); + if (present_port) + builder.append(port); + + boolean present_uptime_secs = true; + builder.append(present_uptime_secs); + if (present_uptime_secs) + builder.append(uptime_secs); + + boolean present_errors = true && (is_set_errors()); + builder.append(present_errors); + if (present_errors) + builder.append(errors); + + boolean present_stats = true && (is_set_stats()); + builder.append(present_stats); + if (present_stats) + builder.append(stats); + + return builder.toHashCode(); + } + + public int compareTo(TaskSummary other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + TaskSummary typedOther = (TaskSummary)other; + + lastComparison = Boolean.valueOf(is_set_task_id()).compareTo(typedOther.is_set_task_id()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_task_id()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.task_id, typedOther.task_id); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_component_id()).compareTo(typedOther.is_set_component_id()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_component_id()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.component_id, typedOther.component_id); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_host()).compareTo(typedOther.is_set_host()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_host()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.host, typedOther.host); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_port()).compareTo(typedOther.is_set_port()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_port()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.port, typedOther.port); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_uptime_secs()).compareTo(typedOther.is_set_uptime_secs()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_uptime_secs()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uptime_secs, typedOther.uptime_secs); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_errors()).compareTo(typedOther.is_set_errors()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_errors()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errors, typedOther.errors); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_stats()).compareTo(typedOther.is_set_stats()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_stats()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stats, typedOther.stats); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("TaskSummary("); + boolean first = true; + + sb.append("task_id:"); + sb.append(this.task_id); + first = false; + if (!first) sb.append(", "); + sb.append("component_id:"); + if (this.component_id == null) { + sb.append("null"); + } else { + sb.append(this.component_id); + } + first = false; + if (!first) sb.append(", "); + sb.append("host:"); + if (this.host == null) { + sb.append("null"); + } else { + sb.append(this.host); + } + first = false; + if (!first) sb.append(", "); + sb.append("port:"); + sb.append(this.port); + first = false; + if (!first) sb.append(", "); + sb.append("uptime_secs:"); + sb.append(this.uptime_secs); + first = false; + if (!first) sb.append(", "); + sb.append("errors:"); + if (this.errors == null) { + sb.append("null"); + } else { + sb.append(this.errors); + } + first = false; + if (is_set_stats()) { + if (!first) sb.append(", "); + sb.append("stats:"); + if (this.stats == null) { + sb.append("null"); + } else { + sb.append(this.stats); + } + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!is_set_task_id()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'task_id' is unset! Struct:" + toString()); + } + + if (!is_set_component_id()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'component_id' is unset! Struct:" + toString()); + } + + if (!is_set_host()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'host' is unset! Struct:" + toString()); + } + + if (!is_set_port()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'port' is unset! Struct:" + toString()); + } + + if (!is_set_uptime_secs()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'uptime_secs' is unset! Struct:" + toString()); + } + + if (!is_set_errors()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'errors' is unset! Struct:" + toString()); + } + + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + 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); + 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 TaskSummaryStandardSchemeFactory implements SchemeFactory { + public TaskSummaryStandardScheme getScheme() { + return new TaskSummaryStandardScheme(); + } + } + + private static class TaskSummaryStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TaskSummary 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: // TASK_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.task_id = iprot.readI32(); + struct.set_task_id_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // COMPONENT_ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.component_id = iprot.readString(); + struct.set_component_id_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // HOST + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.host = iprot.readString(); + struct.set_host_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // PORT + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.port = iprot.readI32(); + struct.set_port_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // UPTIME_SECS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.uptime_secs = iprot.readI32(); + struct.set_uptime_secs_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // ERRORS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list210 = iprot.readListBegin(); + struct.errors = new ArrayList(_list210.size); + for (int _i211 = 0; _i211 < _list210.size; ++_i211) + { + ErrorInfo _elem212; // required + _elem212 = new ErrorInfo(); + _elem212.read(iprot); + struct.errors.add(_elem212); + } + iprot.readListEnd(); + } + struct.set_errors_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 7: // STATS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.stats = new TaskStats(); + struct.stats.read(iprot); + struct.set_stats_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, TaskSummary struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(TASK_ID_FIELD_DESC); + oprot.writeI32(struct.task_id); + oprot.writeFieldEnd(); + if (struct.component_id != null) { + oprot.writeFieldBegin(COMPONENT_ID_FIELD_DESC); + oprot.writeString(struct.component_id); + oprot.writeFieldEnd(); + } + if (struct.host != null) { + oprot.writeFieldBegin(HOST_FIELD_DESC); + oprot.writeString(struct.host); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(PORT_FIELD_DESC); + oprot.writeI32(struct.port); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(UPTIME_SECS_FIELD_DESC); + oprot.writeI32(struct.uptime_secs); + oprot.writeFieldEnd(); + if (struct.errors != null) { + oprot.writeFieldBegin(ERRORS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.errors.size())); + for (ErrorInfo _iter213 : struct.errors) + { + _iter213.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.stats != null) { + if (struct.is_set_stats()) { + oprot.writeFieldBegin(STATS_FIELD_DESC); + struct.stats.write(oprot); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TaskSummaryTupleSchemeFactory implements SchemeFactory { + public TaskSummaryTupleScheme getScheme() { + return new TaskSummaryTupleScheme(); + } + } + + private static class TaskSummaryTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TaskSummary struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeI32(struct.task_id); + oprot.writeString(struct.component_id); + oprot.writeString(struct.host); + oprot.writeI32(struct.port); + oprot.writeI32(struct.uptime_secs); + { + oprot.writeI32(struct.errors.size()); + for (ErrorInfo _iter214 : struct.errors) + { + _iter214.write(oprot); + } + } + BitSet optionals = new BitSet(); + if (struct.is_set_stats()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.is_set_stats()) { + struct.stats.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TaskSummary struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.task_id = iprot.readI32(); + struct.set_task_id_isSet(true); + struct.component_id = iprot.readString(); + struct.set_component_id_isSet(true); + struct.host = iprot.readString(); + struct.set_host_isSet(true); + struct.port = iprot.readI32(); + struct.set_port_isSet(true); + struct.uptime_secs = iprot.readI32(); + struct.set_uptime_secs_isSet(true); + { + org.apache.thrift.protocol.TList _list215 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.errors = new ArrayList(_list215.size); + for (int _i216 = 0; _i216 < _list215.size; ++_i216) + { + ErrorInfo _elem217; // required + _elem217 = new ErrorInfo(); + _elem217.read(iprot); + struct.errors.add(_elem217); + } + } + struct.set_errors_isSet(true); + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.stats = new TaskStats(); + struct.stats.read(iprot); + struct.set_stats_isSet(true); + } + } + } + +} + diff --git a/jstorm-client/src/main/java/backtype/storm/generated/TopologyInfo.java b/jstorm-client/src/main/java/backtype/storm/generated/TopologyInfo.java index 5c5b8e93e..730a1b019 100644 --- a/jstorm-client/src/main/java/backtype/storm/generated/TopologyInfo.java +++ b/jstorm-client/src/main/java/backtype/storm/generated/TopologyInfo.java @@ -1,754 +1,838 @@ -/** - * Autogenerated by Thrift Compiler (0.7.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - */ -package backtype.storm.generated; - -import org.apache.commons.lang.builder.HashCodeBuilder; -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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TopologyInfo implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TopologyInfo"); - - private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField UPTIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("uptime_secs", org.apache.thrift.protocol.TType.I32, (short)3); - private static final org.apache.thrift.protocol.TField TASKS_FIELD_DESC = new org.apache.thrift.protocol.TField("tasks", org.apache.thrift.protocol.TType.LIST, (short)4); - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRING, (short)5); - - private String id; // required - private String name; // required - private int uptime_secs; // required - private List tasks; // required - private String status; // 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 { - ID((short)1, "id"), - NAME((short)2, "name"), - UPTIME_SECS((short)3, "uptime_secs"), - TASKS((short)4, "tasks"), - STATUS((short)5, "status"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // ID - return ID; - case 2: // NAME - return NAME; - case 3: // UPTIME_SECS - return UPTIME_SECS; - case 4: // TASKS - return TASKS; - case 5: // STATUS - return STATUS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __UPTIME_SECS_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - - 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); - tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.UPTIME_SECS, new org.apache.thrift.meta_data.FieldMetaData("uptime_secs", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.TASKS, new org.apache.thrift.meta_data.FieldMetaData("tasks", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TaskSummary.class)))); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TopologyInfo.class, metaDataMap); - } - - public TopologyInfo() { - } - - public TopologyInfo( - String id, - String name, - int uptime_secs, - List tasks, - String status) - { - this(); - this.id = id; - this.name = name; - this.uptime_secs = uptime_secs; - set_uptime_secs_isSet(true); - this.tasks = tasks; - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TopologyInfo(TopologyInfo other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); - if (other.is_set_id()) { - this.id = other.id; - } - if (other.is_set_name()) { - this.name = other.name; - } - this.uptime_secs = other.uptime_secs; - if (other.is_set_tasks()) { - List __this__tasks = new ArrayList(); - for (TaskSummary other_element : other.tasks) { - __this__tasks.add(new TaskSummary(other_element)); - } - this.tasks = __this__tasks; - } - if (other.is_set_status()) { - this.status = other.status; - } - } - - public TopologyInfo deepCopy() { - return new TopologyInfo(this); - } - - @Override - public void clear() { - this.id = null; - this.name = null; - set_uptime_secs_isSet(false); - this.uptime_secs = 0; - this.tasks = null; - this.status = null; - } - - public String get_id() { - return this.id; - } - - public void set_id(String id) { - this.id = id; - } - - public void unset_id() { - this.id = null; - } - - /** Returns true if field id is set (has been assigned a value) and false otherwise */ - public boolean is_set_id() { - return this.id != null; - } - - public void set_id_isSet(boolean value) { - if (!value) { - this.id = null; - } - } - - public String get_name() { - return this.name; - } - - public void set_name(String name) { - this.name = name; - } - - public void unset_name() { - this.name = null; - } - - /** Returns true if field name is set (has been assigned a value) and false otherwise */ - public boolean is_set_name() { - return this.name != null; - } - - public void set_name_isSet(boolean value) { - if (!value) { - this.name = null; - } - } - - public int get_uptime_secs() { - return this.uptime_secs; - } - - public void set_uptime_secs(int uptime_secs) { - this.uptime_secs = uptime_secs; - set_uptime_secs_isSet(true); - } - - public void unset_uptime_secs() { - __isset_bit_vector.clear(__UPTIME_SECS_ISSET_ID); - } - - /** Returns true if field uptime_secs is set (has been assigned a value) and false otherwise */ - public boolean is_set_uptime_secs() { - return __isset_bit_vector.get(__UPTIME_SECS_ISSET_ID); - } - - public void set_uptime_secs_isSet(boolean value) { - __isset_bit_vector.set(__UPTIME_SECS_ISSET_ID, value); - } - - public int get_tasks_size() { - return (this.tasks == null) ? 0 : this.tasks.size(); - } - - public java.util.Iterator get_tasks_iterator() { - return (this.tasks == null) ? null : this.tasks.iterator(); - } - - public void add_to_tasks(TaskSummary elem) { - if (this.tasks == null) { - this.tasks = new ArrayList(); - } - this.tasks.add(elem); - } - - public List get_tasks() { - return this.tasks; - } - - public void set_tasks(List tasks) { - this.tasks = tasks; - } - - public void unset_tasks() { - this.tasks = null; - } - - /** Returns true if field tasks is set (has been assigned a value) and false otherwise */ - public boolean is_set_tasks() { - return this.tasks != null; - } - - public void set_tasks_isSet(boolean value) { - if (!value) { - this.tasks = null; - } - } - - public String get_status() { - return this.status; - } - - public void set_status(String status) { - this.status = status; - } - - public void unset_status() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean is_set_status() { - return this.status != null; - } - - public void set_status_isSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case ID: - if (value == null) { - unset_id(); - } else { - set_id((String)value); - } - break; - - case NAME: - if (value == null) { - unset_name(); - } else { - set_name((String)value); - } - break; - - case UPTIME_SECS: - if (value == null) { - unset_uptime_secs(); - } else { - set_uptime_secs((Integer)value); - } - break; - - case TASKS: - if (value == null) { - unset_tasks(); - } else { - set_tasks((List)value); - } - break; - - case STATUS: - if (value == null) { - unset_status(); - } else { - set_status((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case ID: - return get_id(); - - case NAME: - return get_name(); - - case UPTIME_SECS: - return Integer.valueOf(get_uptime_secs()); - - case TASKS: - return get_tasks(); - - case STATUS: - return get_status(); - - } - throw new 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(); - } - - switch (field) { - case ID: - return is_set_id(); - case NAME: - return is_set_name(); - case UPTIME_SECS: - return is_set_uptime_secs(); - case TASKS: - return is_set_tasks(); - case STATUS: - return is_set_status(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TopologyInfo) - return this.equals((TopologyInfo)that); - return false; - } - - public boolean equals(TopologyInfo that) { - if (that == null) - return false; - - boolean this_present_id = true && this.is_set_id(); - boolean that_present_id = true && that.is_set_id(); - if (this_present_id || that_present_id) { - if (!(this_present_id && that_present_id)) - return false; - if (!this.id.equals(that.id)) - return false; - } - - boolean this_present_name = true && this.is_set_name(); - boolean that_present_name = true && that.is_set_name(); - if (this_present_name || that_present_name) { - if (!(this_present_name && that_present_name)) - return false; - if (!this.name.equals(that.name)) - return false; - } - - boolean this_present_uptime_secs = true; - boolean that_present_uptime_secs = true; - if (this_present_uptime_secs || that_present_uptime_secs) { - if (!(this_present_uptime_secs && that_present_uptime_secs)) - return false; - if (this.uptime_secs != that.uptime_secs) - return false; - } - - boolean this_present_tasks = true && this.is_set_tasks(); - boolean that_present_tasks = true && that.is_set_tasks(); - if (this_present_tasks || that_present_tasks) { - if (!(this_present_tasks && that_present_tasks)) - return false; - if (!this.tasks.equals(that.tasks)) - return false; - } - - boolean this_present_status = true && this.is_set_status(); - boolean that_present_status = true && that.is_set_status(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_id = true && (is_set_id()); - builder.append(present_id); - if (present_id) - builder.append(id); - - boolean present_name = true && (is_set_name()); - builder.append(present_name); - if (present_name) - builder.append(name); - - boolean present_uptime_secs = true; - builder.append(present_uptime_secs); - if (present_uptime_secs) - builder.append(uptime_secs); - - boolean present_tasks = true && (is_set_tasks()); - builder.append(present_tasks); - if (present_tasks) - builder.append(tasks); - - boolean present_status = true && (is_set_status()); - builder.append(present_status); - if (present_status) - builder.append(status); - - return builder.toHashCode(); - } - - public int compareTo(TopologyInfo other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TopologyInfo typedOther = (TopologyInfo)other; - - lastComparison = Boolean.valueOf(is_set_id()).compareTo(typedOther.is_set_id()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_id()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_name()).compareTo(typedOther.is_set_name()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_name()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_uptime_secs()).compareTo(typedOther.is_set_uptime_secs()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_uptime_secs()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uptime_secs, typedOther.uptime_secs); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_tasks()).compareTo(typedOther.is_set_tasks()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_tasks()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tasks, typedOther.tasks); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_status()).compareTo(typedOther.is_set_status()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_status()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // ID - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.id = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // NAME - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.name = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // UPTIME_SECS - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.uptime_secs = iprot.readI32(); - set_uptime_secs_isSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // TASKS - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list109 = iprot.readListBegin(); - this.tasks = new ArrayList(_list109.size); - for (int _i110 = 0; _i110 < _list109.size; ++_i110) - { - TaskSummary _elem111; // required - _elem111 = new TaskSummary(); - _elem111.read(iprot); - this.tasks.add(_elem111); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 5: // STATUS - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.status = 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.id != null) { - oprot.writeFieldBegin(ID_FIELD_DESC); - oprot.writeString(this.id); - oprot.writeFieldEnd(); - } - if (this.name != null) { - oprot.writeFieldBegin(NAME_FIELD_DESC); - oprot.writeString(this.name); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(UPTIME_SECS_FIELD_DESC); - oprot.writeI32(this.uptime_secs); - oprot.writeFieldEnd(); - if (this.tasks != null) { - oprot.writeFieldBegin(TASKS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.tasks.size())); - for (TaskSummary _iter112 : this.tasks) - { - _iter112.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (this.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - oprot.writeString(this.status); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TopologyInfo("); - boolean first = true; - - sb.append("id:"); - if (this.id == null) { - sb.append("null"); - } else { - sb.append(this.id); - } - first = false; - if (!first) sb.append(", "); - sb.append("name:"); - if (this.name == null) { - sb.append("null"); - } else { - sb.append(this.name); - } - first = false; - if (!first) sb.append(", "); - sb.append("uptime_secs:"); - sb.append(this.uptime_secs); - first = false; - if (!first) sb.append(", "); - sb.append("tasks:"); - if (this.tasks == null) { - sb.append("null"); - } else { - sb.append(this.tasks); - } - first = false; - if (!first) sb.append(", "); - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!is_set_id()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'id' is unset! Struct:" + toString()); - } - - if (!is_set_name()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'name' is unset! Struct:" + toString()); - } - - if (!is_set_uptime_secs()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'uptime_secs' is unset! Struct:" + toString()); - } - - if (!is_set_tasks()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'tasks' is unset! Struct:" + toString()); - } - - if (!is_set_status()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - 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); - 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); - } - } - -} - +/** + * Autogenerated by Thrift Compiler (0.8.0) + * + * 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 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TopologyInfo implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TopologyInfo"); + + private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField UPTIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("uptime_secs", org.apache.thrift.protocol.TType.I32, (short)3); + private static final org.apache.thrift.protocol.TField TASKS_FIELD_DESC = new org.apache.thrift.protocol.TField("tasks", org.apache.thrift.protocol.TType.LIST, (short)4); + private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRING, (short)5); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TopologyInfoStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TopologyInfoTupleSchemeFactory()); + } + + private String id; // required + private String name; // required + private int uptime_secs; // required + private List tasks; // required + private String status; // 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 { + ID((short)1, "id"), + NAME((short)2, "name"), + UPTIME_SECS((short)3, "uptime_secs"), + TASKS((short)4, "tasks"), + STATUS((short)5, "status"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // ID + return ID; + case 2: // NAME + return NAME; + case 3: // UPTIME_SECS + return UPTIME_SECS; + case 4: // TASKS + return TASKS; + case 5: // STATUS + return STATUS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __UPTIME_SECS_ISSET_ID = 0; + private BitSet __isset_bit_vector = new BitSet(1); + 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); + tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.UPTIME_SECS, new org.apache.thrift.meta_data.FieldMetaData("uptime_secs", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.TASKS, new org.apache.thrift.meta_data.FieldMetaData("tasks", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TaskSummary.class)))); + tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TopologyInfo.class, metaDataMap); + } + + public TopologyInfo() { + } + + public TopologyInfo( + String id, + String name, + int uptime_secs, + List tasks, + String status) + { + this(); + this.id = id; + this.name = name; + this.uptime_secs = uptime_secs; + set_uptime_secs_isSet(true); + this.tasks = tasks; + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TopologyInfo(TopologyInfo other) { + __isset_bit_vector.clear(); + __isset_bit_vector.or(other.__isset_bit_vector); + if (other.is_set_id()) { + this.id = other.id; + } + if (other.is_set_name()) { + this.name = other.name; + } + this.uptime_secs = other.uptime_secs; + if (other.is_set_tasks()) { + List __this__tasks = new ArrayList(); + for (TaskSummary other_element : other.tasks) { + __this__tasks.add(new TaskSummary(other_element)); + } + this.tasks = __this__tasks; + } + if (other.is_set_status()) { + this.status = other.status; + } + } + + public TopologyInfo deepCopy() { + return new TopologyInfo(this); + } + + @Override + public void clear() { + this.id = null; + this.name = null; + set_uptime_secs_isSet(false); + this.uptime_secs = 0; + this.tasks = null; + this.status = null; + } + + public String get_id() { + return this.id; + } + + public void set_id(String id) { + this.id = id; + } + + public void unset_id() { + this.id = null; + } + + /** Returns true if field id is set (has been assigned a value) and false otherwise */ + public boolean is_set_id() { + return this.id != null; + } + + public void set_id_isSet(boolean value) { + if (!value) { + this.id = null; + } + } + + public String get_name() { + return this.name; + } + + public void set_name(String name) { + this.name = name; + } + + public void unset_name() { + this.name = null; + } + + /** Returns true if field name is set (has been assigned a value) and false otherwise */ + public boolean is_set_name() { + return this.name != null; + } + + public void set_name_isSet(boolean value) { + if (!value) { + this.name = null; + } + } + + public int get_uptime_secs() { + return this.uptime_secs; + } + + public void set_uptime_secs(int uptime_secs) { + this.uptime_secs = uptime_secs; + set_uptime_secs_isSet(true); + } + + public void unset_uptime_secs() { + __isset_bit_vector.clear(__UPTIME_SECS_ISSET_ID); + } + + /** Returns true if field uptime_secs is set (has been assigned a value) and false otherwise */ + public boolean is_set_uptime_secs() { + return __isset_bit_vector.get(__UPTIME_SECS_ISSET_ID); + } + + public void set_uptime_secs_isSet(boolean value) { + __isset_bit_vector.set(__UPTIME_SECS_ISSET_ID, value); + } + + public int get_tasks_size() { + return (this.tasks == null) ? 0 : this.tasks.size(); + } + + public java.util.Iterator get_tasks_iterator() { + return (this.tasks == null) ? null : this.tasks.iterator(); + } + + public void add_to_tasks(TaskSummary elem) { + if (this.tasks == null) { + this.tasks = new ArrayList(); + } + this.tasks.add(elem); + } + + public List get_tasks() { + return this.tasks; + } + + public void set_tasks(List tasks) { + this.tasks = tasks; + } + + public void unset_tasks() { + this.tasks = null; + } + + /** Returns true if field tasks is set (has been assigned a value) and false otherwise */ + public boolean is_set_tasks() { + return this.tasks != null; + } + + public void set_tasks_isSet(boolean value) { + if (!value) { + this.tasks = null; + } + } + + public String get_status() { + return this.status; + } + + public void set_status(String status) { + this.status = status; + } + + public void unset_status() { + this.status = null; + } + + /** Returns true if field status is set (has been assigned a value) and false otherwise */ + public boolean is_set_status() { + return this.status != null; + } + + public void set_status_isSet(boolean value) { + if (!value) { + this.status = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case ID: + if (value == null) { + unset_id(); + } else { + set_id((String)value); + } + break; + + case NAME: + if (value == null) { + unset_name(); + } else { + set_name((String)value); + } + break; + + case UPTIME_SECS: + if (value == null) { + unset_uptime_secs(); + } else { + set_uptime_secs((Integer)value); + } + break; + + case TASKS: + if (value == null) { + unset_tasks(); + } else { + set_tasks((List)value); + } + break; + + case STATUS: + if (value == null) { + unset_status(); + } else { + set_status((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case ID: + return get_id(); + + case NAME: + return get_name(); + + case UPTIME_SECS: + return Integer.valueOf(get_uptime_secs()); + + case TASKS: + return get_tasks(); + + case STATUS: + return get_status(); + + } + throw new 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(); + } + + switch (field) { + case ID: + return is_set_id(); + case NAME: + return is_set_name(); + case UPTIME_SECS: + return is_set_uptime_secs(); + case TASKS: + return is_set_tasks(); + case STATUS: + return is_set_status(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TopologyInfo) + return this.equals((TopologyInfo)that); + return false; + } + + public boolean equals(TopologyInfo that) { + if (that == null) + return false; + + boolean this_present_id = true && this.is_set_id(); + boolean that_present_id = true && that.is_set_id(); + if (this_present_id || that_present_id) { + if (!(this_present_id && that_present_id)) + return false; + if (!this.id.equals(that.id)) + return false; + } + + boolean this_present_name = true && this.is_set_name(); + boolean that_present_name = true && that.is_set_name(); + if (this_present_name || that_present_name) { + if (!(this_present_name && that_present_name)) + return false; + if (!this.name.equals(that.name)) + return false; + } + + boolean this_present_uptime_secs = true; + boolean that_present_uptime_secs = true; + if (this_present_uptime_secs || that_present_uptime_secs) { + if (!(this_present_uptime_secs && that_present_uptime_secs)) + return false; + if (this.uptime_secs != that.uptime_secs) + return false; + } + + boolean this_present_tasks = true && this.is_set_tasks(); + boolean that_present_tasks = true && that.is_set_tasks(); + if (this_present_tasks || that_present_tasks) { + if (!(this_present_tasks && that_present_tasks)) + return false; + if (!this.tasks.equals(that.tasks)) + return false; + } + + boolean this_present_status = true && this.is_set_status(); + boolean that_present_status = true && that.is_set_status(); + if (this_present_status || that_present_status) { + if (!(this_present_status && that_present_status)) + return false; + if (!this.status.equals(that.status)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_id = true && (is_set_id()); + builder.append(present_id); + if (present_id) + builder.append(id); + + boolean present_name = true && (is_set_name()); + builder.append(present_name); + if (present_name) + builder.append(name); + + boolean present_uptime_secs = true; + builder.append(present_uptime_secs); + if (present_uptime_secs) + builder.append(uptime_secs); + + boolean present_tasks = true && (is_set_tasks()); + builder.append(present_tasks); + if (present_tasks) + builder.append(tasks); + + boolean present_status = true && (is_set_status()); + builder.append(present_status); + if (present_status) + builder.append(status); + + return builder.toHashCode(); + } + + public int compareTo(TopologyInfo other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + TopologyInfo typedOther = (TopologyInfo)other; + + lastComparison = Boolean.valueOf(is_set_id()).compareTo(typedOther.is_set_id()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_id()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_name()).compareTo(typedOther.is_set_name()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_name()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_uptime_secs()).compareTo(typedOther.is_set_uptime_secs()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_uptime_secs()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uptime_secs, typedOther.uptime_secs); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_tasks()).compareTo(typedOther.is_set_tasks()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_tasks()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tasks, typedOther.tasks); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_status()).compareTo(typedOther.is_set_status()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_status()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("TopologyInfo("); + boolean first = true; + + sb.append("id:"); + if (this.id == null) { + sb.append("null"); + } else { + sb.append(this.id); + } + first = false; + if (!first) sb.append(", "); + sb.append("name:"); + if (this.name == null) { + sb.append("null"); + } else { + sb.append(this.name); + } + first = false; + if (!first) sb.append(", "); + sb.append("uptime_secs:"); + sb.append(this.uptime_secs); + first = false; + if (!first) sb.append(", "); + sb.append("tasks:"); + if (this.tasks == null) { + sb.append("null"); + } else { + sb.append(this.tasks); + } + first = false; + if (!first) sb.append(", "); + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!is_set_id()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'id' is unset! Struct:" + toString()); + } + + if (!is_set_name()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'name' is unset! Struct:" + toString()); + } + + if (!is_set_uptime_secs()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'uptime_secs' is unset! Struct:" + toString()); + } + + if (!is_set_tasks()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'tasks' is unset! Struct:" + toString()); + } + + if (!is_set_status()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); + } + + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + 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); + 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 TopologyInfoStandardSchemeFactory implements SchemeFactory { + public TopologyInfoStandardScheme getScheme() { + return new TopologyInfoStandardScheme(); + } + } + + private static class TopologyInfoStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TopologyInfo 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: // ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.id = iprot.readString(); + struct.set_id_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.name = iprot.readString(); + struct.set_name_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // UPTIME_SECS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.uptime_secs = iprot.readI32(); + struct.set_uptime_secs_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // TASKS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list218 = iprot.readListBegin(); + struct.tasks = new ArrayList(_list218.size); + for (int _i219 = 0; _i219 < _list218.size; ++_i219) + { + TaskSummary _elem220; // required + _elem220 = new TaskSummary(); + _elem220.read(iprot); + struct.tasks.add(_elem220); + } + iprot.readListEnd(); + } + struct.set_tasks_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // STATUS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.status = iprot.readString(); + struct.set_status_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, TopologyInfo struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.id != null) { + oprot.writeFieldBegin(ID_FIELD_DESC); + oprot.writeString(struct.id); + oprot.writeFieldEnd(); + } + if (struct.name != null) { + oprot.writeFieldBegin(NAME_FIELD_DESC); + oprot.writeString(struct.name); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(UPTIME_SECS_FIELD_DESC); + oprot.writeI32(struct.uptime_secs); + oprot.writeFieldEnd(); + if (struct.tasks != null) { + oprot.writeFieldBegin(TASKS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.tasks.size())); + for (TaskSummary _iter221 : struct.tasks) + { + _iter221.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.status != null) { + oprot.writeFieldBegin(STATUS_FIELD_DESC); + oprot.writeString(struct.status); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TopologyInfoTupleSchemeFactory implements SchemeFactory { + public TopologyInfoTupleScheme getScheme() { + return new TopologyInfoTupleScheme(); + } + } + + private static class TopologyInfoTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TopologyInfo struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.id); + oprot.writeString(struct.name); + oprot.writeI32(struct.uptime_secs); + { + oprot.writeI32(struct.tasks.size()); + for (TaskSummary _iter222 : struct.tasks) + { + _iter222.write(oprot); + } + } + oprot.writeString(struct.status); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TopologyInfo struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.id = iprot.readString(); + struct.set_id_isSet(true); + struct.name = iprot.readString(); + struct.set_name_isSet(true); + struct.uptime_secs = iprot.readI32(); + struct.set_uptime_secs_isSet(true); + { + org.apache.thrift.protocol.TList _list223 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.tasks = new ArrayList(_list223.size); + for (int _i224 = 0; _i224 < _list223.size; ++_i224) + { + TaskSummary _elem225; // required + _elem225 = new TaskSummary(); + _elem225.read(iprot); + struct.tasks.add(_elem225); + } + } + struct.set_tasks_isSet(true); + struct.status = iprot.readString(); + struct.set_status_isSet(true); + } + } + +} + diff --git a/jstorm-client/src/main/java/backtype/storm/generated/TopologySummary.java b/jstorm-client/src/main/java/backtype/storm/generated/TopologySummary.java index 57445ed10..ca343e91d 100644 --- a/jstorm-client/src/main/java/backtype/storm/generated/TopologySummary.java +++ b/jstorm-client/src/main/java/backtype/storm/generated/TopologySummary.java @@ -1,803 +1,873 @@ -/** - * Autogenerated by Thrift Compiler (0.7.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - */ -package backtype.storm.generated; - -import org.apache.commons.lang.builder.HashCodeBuilder; -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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TopologySummary implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TopologySummary"); - - private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField NUM_TASKS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_tasks", org.apache.thrift.protocol.TType.I32, (short)3); - private static final org.apache.thrift.protocol.TField NUM_WORKERS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_workers", org.apache.thrift.protocol.TType.I32, (short)4); - private static final org.apache.thrift.protocol.TField UPTIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("uptime_secs", org.apache.thrift.protocol.TType.I32, (short)5); - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRING, (short)6); - - private String id; // required - private String name; // required - private int num_tasks; // required - private int num_workers; // required - private int uptime_secs; // required - private String status; // 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 { - ID((short)1, "id"), - NAME((short)2, "name"), - NUM_TASKS((short)3, "num_tasks"), - NUM_WORKERS((short)4, "num_workers"), - UPTIME_SECS((short)5, "uptime_secs"), - STATUS((short)6, "status"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // ID - return ID; - case 2: // NAME - return NAME; - case 3: // NUM_TASKS - return NUM_TASKS; - case 4: // NUM_WORKERS - return NUM_WORKERS; - case 5: // UPTIME_SECS - return UPTIME_SECS; - case 6: // STATUS - return STATUS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __NUM_TASKS_ISSET_ID = 0; - private static final int __NUM_WORKERS_ISSET_ID = 1; - private static final int __UPTIME_SECS_ISSET_ID = 2; - private BitSet __isset_bit_vector = new BitSet(3); - - 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); - tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.NUM_TASKS, new org.apache.thrift.meta_data.FieldMetaData("num_tasks", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.NUM_WORKERS, new org.apache.thrift.meta_data.FieldMetaData("num_workers", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.UPTIME_SECS, new org.apache.thrift.meta_data.FieldMetaData("uptime_secs", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TopologySummary.class, metaDataMap); - } - - public TopologySummary() { - } - - public TopologySummary( - String id, - String name, - int num_tasks, - int num_workers, - int uptime_secs, - String status) - { - this(); - this.id = id; - this.name = name; - this.num_tasks = num_tasks; - set_num_tasks_isSet(true); - this.num_workers = num_workers; - set_num_workers_isSet(true); - this.uptime_secs = uptime_secs; - set_uptime_secs_isSet(true); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TopologySummary(TopologySummary other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); - if (other.is_set_id()) { - this.id = other.id; - } - if (other.is_set_name()) { - this.name = other.name; - } - this.num_tasks = other.num_tasks; - this.num_workers = other.num_workers; - this.uptime_secs = other.uptime_secs; - if (other.is_set_status()) { - this.status = other.status; - } - } - - public TopologySummary deepCopy() { - return new TopologySummary(this); - } - - @Override - public void clear() { - this.id = null; - this.name = null; - set_num_tasks_isSet(false); - this.num_tasks = 0; - set_num_workers_isSet(false); - this.num_workers = 0; - set_uptime_secs_isSet(false); - this.uptime_secs = 0; - this.status = null; - } - - public String get_id() { - return this.id; - } - - public void set_id(String id) { - this.id = id; - } - - public void unset_id() { - this.id = null; - } - - /** Returns true if field id is set (has been assigned a value) and false otherwise */ - public boolean is_set_id() { - return this.id != null; - } - - public void set_id_isSet(boolean value) { - if (!value) { - this.id = null; - } - } - - public String get_name() { - return this.name; - } - - public void set_name(String name) { - this.name = name; - } - - public void unset_name() { - this.name = null; - } - - /** Returns true if field name is set (has been assigned a value) and false otherwise */ - public boolean is_set_name() { - return this.name != null; - } - - public void set_name_isSet(boolean value) { - if (!value) { - this.name = null; - } - } - - public int get_num_tasks() { - return this.num_tasks; - } - - public void set_num_tasks(int num_tasks) { - this.num_tasks = num_tasks; - set_num_tasks_isSet(true); - } - - public void unset_num_tasks() { - __isset_bit_vector.clear(__NUM_TASKS_ISSET_ID); - } - - /** Returns true if field num_tasks is set (has been assigned a value) and false otherwise */ - public boolean is_set_num_tasks() { - return __isset_bit_vector.get(__NUM_TASKS_ISSET_ID); - } - - public void set_num_tasks_isSet(boolean value) { - __isset_bit_vector.set(__NUM_TASKS_ISSET_ID, value); - } - - public int get_num_workers() { - return this.num_workers; - } - - public void set_num_workers(int num_workers) { - this.num_workers = num_workers; - set_num_workers_isSet(true); - } - - public void unset_num_workers() { - __isset_bit_vector.clear(__NUM_WORKERS_ISSET_ID); - } - - /** Returns true if field num_workers is set (has been assigned a value) and false otherwise */ - public boolean is_set_num_workers() { - return __isset_bit_vector.get(__NUM_WORKERS_ISSET_ID); - } - - public void set_num_workers_isSet(boolean value) { - __isset_bit_vector.set(__NUM_WORKERS_ISSET_ID, value); - } - - public int get_uptime_secs() { - return this.uptime_secs; - } - - public void set_uptime_secs(int uptime_secs) { - this.uptime_secs = uptime_secs; - set_uptime_secs_isSet(true); - } - - public void unset_uptime_secs() { - __isset_bit_vector.clear(__UPTIME_SECS_ISSET_ID); - } - - /** Returns true if field uptime_secs is set (has been assigned a value) and false otherwise */ - public boolean is_set_uptime_secs() { - return __isset_bit_vector.get(__UPTIME_SECS_ISSET_ID); - } - - public void set_uptime_secs_isSet(boolean value) { - __isset_bit_vector.set(__UPTIME_SECS_ISSET_ID, value); - } - - public String get_status() { - return this.status; - } - - public void set_status(String status) { - this.status = status; - } - - public void unset_status() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean is_set_status() { - return this.status != null; - } - - public void set_status_isSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case ID: - if (value == null) { - unset_id(); - } else { - set_id((String)value); - } - break; - - case NAME: - if (value == null) { - unset_name(); - } else { - set_name((String)value); - } - break; - - case NUM_TASKS: - if (value == null) { - unset_num_tasks(); - } else { - set_num_tasks((Integer)value); - } - break; - - case NUM_WORKERS: - if (value == null) { - unset_num_workers(); - } else { - set_num_workers((Integer)value); - } - break; - - case UPTIME_SECS: - if (value == null) { - unset_uptime_secs(); - } else { - set_uptime_secs((Integer)value); - } - break; - - case STATUS: - if (value == null) { - unset_status(); - } else { - set_status((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case ID: - return get_id(); - - case NAME: - return get_name(); - - case NUM_TASKS: - return Integer.valueOf(get_num_tasks()); - - case NUM_WORKERS: - return Integer.valueOf(get_num_workers()); - - case UPTIME_SECS: - return Integer.valueOf(get_uptime_secs()); - - case STATUS: - return get_status(); - - } - throw new 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(); - } - - switch (field) { - case ID: - return is_set_id(); - case NAME: - return is_set_name(); - case NUM_TASKS: - return is_set_num_tasks(); - case NUM_WORKERS: - return is_set_num_workers(); - case UPTIME_SECS: - return is_set_uptime_secs(); - case STATUS: - return is_set_status(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TopologySummary) - return this.equals((TopologySummary)that); - return false; - } - - public boolean equals(TopologySummary that) { - if (that == null) - return false; - - boolean this_present_id = true && this.is_set_id(); - boolean that_present_id = true && that.is_set_id(); - if (this_present_id || that_present_id) { - if (!(this_present_id && that_present_id)) - return false; - if (!this.id.equals(that.id)) - return false; - } - - boolean this_present_name = true && this.is_set_name(); - boolean that_present_name = true && that.is_set_name(); - if (this_present_name || that_present_name) { - if (!(this_present_name && that_present_name)) - return false; - if (!this.name.equals(that.name)) - return false; - } - - boolean this_present_num_tasks = true; - boolean that_present_num_tasks = true; - if (this_present_num_tasks || that_present_num_tasks) { - if (!(this_present_num_tasks && that_present_num_tasks)) - return false; - if (this.num_tasks != that.num_tasks) - return false; - } - - boolean this_present_num_workers = true; - boolean that_present_num_workers = true; - if (this_present_num_workers || that_present_num_workers) { - if (!(this_present_num_workers && that_present_num_workers)) - return false; - if (this.num_workers != that.num_workers) - return false; - } - - boolean this_present_uptime_secs = true; - boolean that_present_uptime_secs = true; - if (this_present_uptime_secs || that_present_uptime_secs) { - if (!(this_present_uptime_secs && that_present_uptime_secs)) - return false; - if (this.uptime_secs != that.uptime_secs) - return false; - } - - boolean this_present_status = true && this.is_set_status(); - boolean that_present_status = true && that.is_set_status(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_id = true && (is_set_id()); - builder.append(present_id); - if (present_id) - builder.append(id); - - boolean present_name = true && (is_set_name()); - builder.append(present_name); - if (present_name) - builder.append(name); - - boolean present_num_tasks = true; - builder.append(present_num_tasks); - if (present_num_tasks) - builder.append(num_tasks); - - boolean present_num_workers = true; - builder.append(present_num_workers); - if (present_num_workers) - builder.append(num_workers); - - boolean present_uptime_secs = true; - builder.append(present_uptime_secs); - if (present_uptime_secs) - builder.append(uptime_secs); - - boolean present_status = true && (is_set_status()); - builder.append(present_status); - if (present_status) - builder.append(status); - - return builder.toHashCode(); - } - - public int compareTo(TopologySummary other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TopologySummary typedOther = (TopologySummary)other; - - lastComparison = Boolean.valueOf(is_set_id()).compareTo(typedOther.is_set_id()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_id()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_name()).compareTo(typedOther.is_set_name()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_name()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_num_tasks()).compareTo(typedOther.is_set_num_tasks()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_num_tasks()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_tasks, typedOther.num_tasks); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_num_workers()).compareTo(typedOther.is_set_num_workers()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_num_workers()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_workers, typedOther.num_workers); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_uptime_secs()).compareTo(typedOther.is_set_uptime_secs()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_uptime_secs()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uptime_secs, typedOther.uptime_secs); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_status()).compareTo(typedOther.is_set_status()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_status()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // ID - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.id = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // NAME - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.name = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // NUM_TASKS - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.num_tasks = iprot.readI32(); - set_num_tasks_isSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // NUM_WORKERS - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.num_workers = iprot.readI32(); - set_num_workers_isSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 5: // UPTIME_SECS - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.uptime_secs = iprot.readI32(); - set_uptime_secs_isSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 6: // STATUS - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.status = 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.id != null) { - oprot.writeFieldBegin(ID_FIELD_DESC); - oprot.writeString(this.id); - oprot.writeFieldEnd(); - } - if (this.name != null) { - oprot.writeFieldBegin(NAME_FIELD_DESC); - oprot.writeString(this.name); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(NUM_TASKS_FIELD_DESC); - oprot.writeI32(this.num_tasks); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(NUM_WORKERS_FIELD_DESC); - oprot.writeI32(this.num_workers); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(UPTIME_SECS_FIELD_DESC); - oprot.writeI32(this.uptime_secs); - oprot.writeFieldEnd(); - if (this.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - oprot.writeString(this.status); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TopologySummary("); - boolean first = true; - - sb.append("id:"); - if (this.id == null) { - sb.append("null"); - } else { - sb.append(this.id); - } - first = false; - if (!first) sb.append(", "); - sb.append("name:"); - if (this.name == null) { - sb.append("null"); - } else { - sb.append(this.name); - } - first = false; - if (!first) sb.append(", "); - sb.append("num_tasks:"); - sb.append(this.num_tasks); - first = false; - if (!first) sb.append(", "); - sb.append("num_workers:"); - sb.append(this.num_workers); - first = false; - if (!first) sb.append(", "); - sb.append("uptime_secs:"); - sb.append(this.uptime_secs); - first = false; - if (!first) sb.append(", "); - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!is_set_id()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'id' is unset! Struct:" + toString()); - } - - if (!is_set_name()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'name' is unset! Struct:" + toString()); - } - - if (!is_set_num_tasks()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'num_tasks' is unset! Struct:" + toString()); - } - - if (!is_set_num_workers()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'num_workers' is unset! Struct:" + toString()); - } - - if (!is_set_uptime_secs()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'uptime_secs' is unset! Struct:" + toString()); - } - - if (!is_set_status()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - 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); - 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); - } - } - -} - +/** + * Autogenerated by Thrift Compiler (0.8.0) + * + * 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 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TopologySummary implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TopologySummary"); + + private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField NUM_TASKS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_tasks", org.apache.thrift.protocol.TType.I32, (short)3); + private static final org.apache.thrift.protocol.TField NUM_WORKERS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_workers", org.apache.thrift.protocol.TType.I32, (short)4); + private static final org.apache.thrift.protocol.TField UPTIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("uptime_secs", org.apache.thrift.protocol.TType.I32, (short)5); + private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRING, (short)6); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TopologySummaryStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TopologySummaryTupleSchemeFactory()); + } + + private String id; // required + private String name; // required + private int num_tasks; // required + private int num_workers; // required + private int uptime_secs; // required + private String status; // 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 { + ID((short)1, "id"), + NAME((short)2, "name"), + NUM_TASKS((short)3, "num_tasks"), + NUM_WORKERS((short)4, "num_workers"), + UPTIME_SECS((short)5, "uptime_secs"), + STATUS((short)6, "status"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // ID + return ID; + case 2: // NAME + return NAME; + case 3: // NUM_TASKS + return NUM_TASKS; + case 4: // NUM_WORKERS + return NUM_WORKERS; + case 5: // UPTIME_SECS + return UPTIME_SECS; + case 6: // STATUS + return STATUS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __NUM_TASKS_ISSET_ID = 0; + private static final int __NUM_WORKERS_ISSET_ID = 1; + private static final int __UPTIME_SECS_ISSET_ID = 2; + private BitSet __isset_bit_vector = new BitSet(3); + 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); + tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.NUM_TASKS, new org.apache.thrift.meta_data.FieldMetaData("num_tasks", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.NUM_WORKERS, new org.apache.thrift.meta_data.FieldMetaData("num_workers", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.UPTIME_SECS, new org.apache.thrift.meta_data.FieldMetaData("uptime_secs", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TopologySummary.class, metaDataMap); + } + + public TopologySummary() { + } + + public TopologySummary( + String id, + String name, + int num_tasks, + int num_workers, + int uptime_secs, + String status) + { + this(); + this.id = id; + this.name = name; + this.num_tasks = num_tasks; + set_num_tasks_isSet(true); + this.num_workers = num_workers; + set_num_workers_isSet(true); + this.uptime_secs = uptime_secs; + set_uptime_secs_isSet(true); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TopologySummary(TopologySummary other) { + __isset_bit_vector.clear(); + __isset_bit_vector.or(other.__isset_bit_vector); + if (other.is_set_id()) { + this.id = other.id; + } + if (other.is_set_name()) { + this.name = other.name; + } + this.num_tasks = other.num_tasks; + this.num_workers = other.num_workers; + this.uptime_secs = other.uptime_secs; + if (other.is_set_status()) { + this.status = other.status; + } + } + + public TopologySummary deepCopy() { + return new TopologySummary(this); + } + + @Override + public void clear() { + this.id = null; + this.name = null; + set_num_tasks_isSet(false); + this.num_tasks = 0; + set_num_workers_isSet(false); + this.num_workers = 0; + set_uptime_secs_isSet(false); + this.uptime_secs = 0; + this.status = null; + } + + public String get_id() { + return this.id; + } + + public void set_id(String id) { + this.id = id; + } + + public void unset_id() { + this.id = null; + } + + /** Returns true if field id is set (has been assigned a value) and false otherwise */ + public boolean is_set_id() { + return this.id != null; + } + + public void set_id_isSet(boolean value) { + if (!value) { + this.id = null; + } + } + + public String get_name() { + return this.name; + } + + public void set_name(String name) { + this.name = name; + } + + public void unset_name() { + this.name = null; + } + + /** Returns true if field name is set (has been assigned a value) and false otherwise */ + public boolean is_set_name() { + return this.name != null; + } + + public void set_name_isSet(boolean value) { + if (!value) { + this.name = null; + } + } + + public int get_num_tasks() { + return this.num_tasks; + } + + public void set_num_tasks(int num_tasks) { + this.num_tasks = num_tasks; + set_num_tasks_isSet(true); + } + + public void unset_num_tasks() { + __isset_bit_vector.clear(__NUM_TASKS_ISSET_ID); + } + + /** Returns true if field num_tasks is set (has been assigned a value) and false otherwise */ + public boolean is_set_num_tasks() { + return __isset_bit_vector.get(__NUM_TASKS_ISSET_ID); + } + + public void set_num_tasks_isSet(boolean value) { + __isset_bit_vector.set(__NUM_TASKS_ISSET_ID, value); + } + + public int get_num_workers() { + return this.num_workers; + } + + public void set_num_workers(int num_workers) { + this.num_workers = num_workers; + set_num_workers_isSet(true); + } + + public void unset_num_workers() { + __isset_bit_vector.clear(__NUM_WORKERS_ISSET_ID); + } + + /** Returns true if field num_workers is set (has been assigned a value) and false otherwise */ + public boolean is_set_num_workers() { + return __isset_bit_vector.get(__NUM_WORKERS_ISSET_ID); + } + + public void set_num_workers_isSet(boolean value) { + __isset_bit_vector.set(__NUM_WORKERS_ISSET_ID, value); + } + + public int get_uptime_secs() { + return this.uptime_secs; + } + + public void set_uptime_secs(int uptime_secs) { + this.uptime_secs = uptime_secs; + set_uptime_secs_isSet(true); + } + + public void unset_uptime_secs() { + __isset_bit_vector.clear(__UPTIME_SECS_ISSET_ID); + } + + /** Returns true if field uptime_secs is set (has been assigned a value) and false otherwise */ + public boolean is_set_uptime_secs() { + return __isset_bit_vector.get(__UPTIME_SECS_ISSET_ID); + } + + public void set_uptime_secs_isSet(boolean value) { + __isset_bit_vector.set(__UPTIME_SECS_ISSET_ID, value); + } + + public String get_status() { + return this.status; + } + + public void set_status(String status) { + this.status = status; + } + + public void unset_status() { + this.status = null; + } + + /** Returns true if field status is set (has been assigned a value) and false otherwise */ + public boolean is_set_status() { + return this.status != null; + } + + public void set_status_isSet(boolean value) { + if (!value) { + this.status = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case ID: + if (value == null) { + unset_id(); + } else { + set_id((String)value); + } + break; + + case NAME: + if (value == null) { + unset_name(); + } else { + set_name((String)value); + } + break; + + case NUM_TASKS: + if (value == null) { + unset_num_tasks(); + } else { + set_num_tasks((Integer)value); + } + break; + + case NUM_WORKERS: + if (value == null) { + unset_num_workers(); + } else { + set_num_workers((Integer)value); + } + break; + + case UPTIME_SECS: + if (value == null) { + unset_uptime_secs(); + } else { + set_uptime_secs((Integer)value); + } + break; + + case STATUS: + if (value == null) { + unset_status(); + } else { + set_status((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case ID: + return get_id(); + + case NAME: + return get_name(); + + case NUM_TASKS: + return Integer.valueOf(get_num_tasks()); + + case NUM_WORKERS: + return Integer.valueOf(get_num_workers()); + + case UPTIME_SECS: + return Integer.valueOf(get_uptime_secs()); + + case STATUS: + return get_status(); + + } + throw new 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(); + } + + switch (field) { + case ID: + return is_set_id(); + case NAME: + return is_set_name(); + case NUM_TASKS: + return is_set_num_tasks(); + case NUM_WORKERS: + return is_set_num_workers(); + case UPTIME_SECS: + return is_set_uptime_secs(); + case STATUS: + return is_set_status(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TopologySummary) + return this.equals((TopologySummary)that); + return false; + } + + public boolean equals(TopologySummary that) { + if (that == null) + return false; + + boolean this_present_id = true && this.is_set_id(); + boolean that_present_id = true && that.is_set_id(); + if (this_present_id || that_present_id) { + if (!(this_present_id && that_present_id)) + return false; + if (!this.id.equals(that.id)) + return false; + } + + boolean this_present_name = true && this.is_set_name(); + boolean that_present_name = true && that.is_set_name(); + if (this_present_name || that_present_name) { + if (!(this_present_name && that_present_name)) + return false; + if (!this.name.equals(that.name)) + return false; + } + + boolean this_present_num_tasks = true; + boolean that_present_num_tasks = true; + if (this_present_num_tasks || that_present_num_tasks) { + if (!(this_present_num_tasks && that_present_num_tasks)) + return false; + if (this.num_tasks != that.num_tasks) + return false; + } + + boolean this_present_num_workers = true; + boolean that_present_num_workers = true; + if (this_present_num_workers || that_present_num_workers) { + if (!(this_present_num_workers && that_present_num_workers)) + return false; + if (this.num_workers != that.num_workers) + return false; + } + + boolean this_present_uptime_secs = true; + boolean that_present_uptime_secs = true; + if (this_present_uptime_secs || that_present_uptime_secs) { + if (!(this_present_uptime_secs && that_present_uptime_secs)) + return false; + if (this.uptime_secs != that.uptime_secs) + return false; + } + + boolean this_present_status = true && this.is_set_status(); + boolean that_present_status = true && that.is_set_status(); + if (this_present_status || that_present_status) { + if (!(this_present_status && that_present_status)) + return false; + if (!this.status.equals(that.status)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_id = true && (is_set_id()); + builder.append(present_id); + if (present_id) + builder.append(id); + + boolean present_name = true && (is_set_name()); + builder.append(present_name); + if (present_name) + builder.append(name); + + boolean present_num_tasks = true; + builder.append(present_num_tasks); + if (present_num_tasks) + builder.append(num_tasks); + + boolean present_num_workers = true; + builder.append(present_num_workers); + if (present_num_workers) + builder.append(num_workers); + + boolean present_uptime_secs = true; + builder.append(present_uptime_secs); + if (present_uptime_secs) + builder.append(uptime_secs); + + boolean present_status = true && (is_set_status()); + builder.append(present_status); + if (present_status) + builder.append(status); + + return builder.toHashCode(); + } + + public int compareTo(TopologySummary other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + TopologySummary typedOther = (TopologySummary)other; + + lastComparison = Boolean.valueOf(is_set_id()).compareTo(typedOther.is_set_id()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_id()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_name()).compareTo(typedOther.is_set_name()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_name()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_num_tasks()).compareTo(typedOther.is_set_num_tasks()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_num_tasks()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_tasks, typedOther.num_tasks); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_num_workers()).compareTo(typedOther.is_set_num_workers()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_num_workers()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_workers, typedOther.num_workers); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_uptime_secs()).compareTo(typedOther.is_set_uptime_secs()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_uptime_secs()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uptime_secs, typedOther.uptime_secs); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_status()).compareTo(typedOther.is_set_status()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_status()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("TopologySummary("); + boolean first = true; + + sb.append("id:"); + if (this.id == null) { + sb.append("null"); + } else { + sb.append(this.id); + } + first = false; + if (!first) sb.append(", "); + sb.append("name:"); + if (this.name == null) { + sb.append("null"); + } else { + sb.append(this.name); + } + first = false; + if (!first) sb.append(", "); + sb.append("num_tasks:"); + sb.append(this.num_tasks); + first = false; + if (!first) sb.append(", "); + sb.append("num_workers:"); + sb.append(this.num_workers); + first = false; + if (!first) sb.append(", "); + sb.append("uptime_secs:"); + sb.append(this.uptime_secs); + first = false; + if (!first) sb.append(", "); + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!is_set_id()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'id' is unset! Struct:" + toString()); + } + + if (!is_set_name()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'name' is unset! Struct:" + toString()); + } + + if (!is_set_num_tasks()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'num_tasks' is unset! Struct:" + toString()); + } + + if (!is_set_num_workers()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'num_workers' is unset! Struct:" + toString()); + } + + if (!is_set_uptime_secs()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'uptime_secs' is unset! Struct:" + toString()); + } + + if (!is_set_status()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); + } + + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + 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); + 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 TopologySummaryStandardSchemeFactory implements SchemeFactory { + public TopologySummaryStandardScheme getScheme() { + return new TopologySummaryStandardScheme(); + } + } + + private static class TopologySummaryStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TopologySummary 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: // ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.id = iprot.readString(); + struct.set_id_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.name = iprot.readString(); + struct.set_name_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // NUM_TASKS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.num_tasks = iprot.readI32(); + struct.set_num_tasks_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // NUM_WORKERS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.num_workers = iprot.readI32(); + struct.set_num_workers_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // UPTIME_SECS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.uptime_secs = iprot.readI32(); + struct.set_uptime_secs_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // STATUS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.status = iprot.readString(); + struct.set_status_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, TopologySummary struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.id != null) { + oprot.writeFieldBegin(ID_FIELD_DESC); + oprot.writeString(struct.id); + oprot.writeFieldEnd(); + } + if (struct.name != null) { + oprot.writeFieldBegin(NAME_FIELD_DESC); + oprot.writeString(struct.name); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(NUM_TASKS_FIELD_DESC); + oprot.writeI32(struct.num_tasks); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(NUM_WORKERS_FIELD_DESC); + oprot.writeI32(struct.num_workers); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(UPTIME_SECS_FIELD_DESC); + oprot.writeI32(struct.uptime_secs); + oprot.writeFieldEnd(); + if (struct.status != null) { + oprot.writeFieldBegin(STATUS_FIELD_DESC); + oprot.writeString(struct.status); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TopologySummaryTupleSchemeFactory implements SchemeFactory { + public TopologySummaryTupleScheme getScheme() { + return new TopologySummaryTupleScheme(); + } + } + + private static class TopologySummaryTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TopologySummary struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.id); + oprot.writeString(struct.name); + oprot.writeI32(struct.num_tasks); + oprot.writeI32(struct.num_workers); + oprot.writeI32(struct.uptime_secs); + oprot.writeString(struct.status); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TopologySummary struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.id = iprot.readString(); + struct.set_id_isSet(true); + struct.name = iprot.readString(); + struct.set_name_isSet(true); + struct.num_tasks = iprot.readI32(); + struct.set_num_tasks_isSet(true); + struct.num_workers = iprot.readI32(); + struct.set_num_workers_isSet(true); + struct.uptime_secs = iprot.readI32(); + struct.set_uptime_secs_isSet(true); + struct.status = iprot.readString(); + struct.set_status_isSet(true); + } + } + +} + diff --git a/jstorm-client/src/main/java/backtype/storm/generated/WorkerSummary.java b/jstorm-client/src/main/java/backtype/storm/generated/WorkerSummary.java index ab03d4f74..00f583aec 100644 --- a/jstorm-client/src/main/java/backtype/storm/generated/WorkerSummary.java +++ b/jstorm-client/src/main/java/backtype/storm/generated/WorkerSummary.java @@ -1,560 +1,636 @@ -/** - * Autogenerated by Thrift Compiler (0.7.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - */ -package backtype.storm.generated; - -import org.apache.commons.lang.builder.HashCodeBuilder; -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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class WorkerSummary implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("WorkerSummary"); - - private static final org.apache.thrift.protocol.TField PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("port", org.apache.thrift.protocol.TType.I32, (short)1); - private static final org.apache.thrift.protocol.TField TOPOLOGY_FIELD_DESC = new org.apache.thrift.protocol.TField("topology", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField TASKS_FIELD_DESC = new org.apache.thrift.protocol.TField("tasks", org.apache.thrift.protocol.TType.LIST, (short)3); - - private int port; // required - private String topology; // required - private List tasks; // 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 { - PORT((short)1, "port"), - TOPOLOGY((short)2, "topology"), - TASKS((short)3, "tasks"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // PORT - return PORT; - case 2: // TOPOLOGY - return TOPOLOGY; - case 3: // TASKS - return TASKS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new 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) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __PORT_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - - 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); - tmpMap.put(_Fields.PORT, new org.apache.thrift.meta_data.FieldMetaData("port", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.TOPOLOGY, new org.apache.thrift.meta_data.FieldMetaData("topology", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.TASKS, new org.apache.thrift.meta_data.FieldMetaData("tasks", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TaskSummary.class)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(WorkerSummary.class, metaDataMap); - } - - public WorkerSummary() { - } - - public WorkerSummary( - int port, - String topology, - List tasks) - { - this(); - this.port = port; - set_port_isSet(true); - this.topology = topology; - this.tasks = tasks; - } - - /** - * Performs a deep copy on other. - */ - public WorkerSummary(WorkerSummary other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); - this.port = other.port; - if (other.is_set_topology()) { - this.topology = other.topology; - } - if (other.is_set_tasks()) { - List __this__tasks = new ArrayList(); - for (TaskSummary other_element : other.tasks) { - __this__tasks.add(new TaskSummary(other_element)); - } - this.tasks = __this__tasks; - } - } - - public WorkerSummary deepCopy() { - return new WorkerSummary(this); - } - - @Override - public void clear() { - set_port_isSet(false); - this.port = 0; - this.topology = null; - this.tasks = null; - } - - public int get_port() { - return this.port; - } - - public void set_port(int port) { - this.port = port; - set_port_isSet(true); - } - - public void unset_port() { - __isset_bit_vector.clear(__PORT_ISSET_ID); - } - - /** Returns true if field port is set (has been assigned a value) and false otherwise */ - public boolean is_set_port() { - return __isset_bit_vector.get(__PORT_ISSET_ID); - } - - public void set_port_isSet(boolean value) { - __isset_bit_vector.set(__PORT_ISSET_ID, value); - } - - public String get_topology() { - return this.topology; - } - - public void set_topology(String topology) { - this.topology = topology; - } - - public void unset_topology() { - this.topology = null; - } - - /** Returns true if field topology is set (has been assigned a value) and false otherwise */ - public boolean is_set_topology() { - return this.topology != null; - } - - public void set_topology_isSet(boolean value) { - if (!value) { - this.topology = null; - } - } - - public int get_tasks_size() { - return (this.tasks == null) ? 0 : this.tasks.size(); - } - - public java.util.Iterator get_tasks_iterator() { - return (this.tasks == null) ? null : this.tasks.iterator(); - } - - public void add_to_tasks(TaskSummary elem) { - if (this.tasks == null) { - this.tasks = new ArrayList(); - } - this.tasks.add(elem); - } - - public List get_tasks() { - return this.tasks; - } - - public void set_tasks(List tasks) { - this.tasks = tasks; - } - - public void unset_tasks() { - this.tasks = null; - } - - /** Returns true if field tasks is set (has been assigned a value) and false otherwise */ - public boolean is_set_tasks() { - return this.tasks != null; - } - - public void set_tasks_isSet(boolean value) { - if (!value) { - this.tasks = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case PORT: - if (value == null) { - unset_port(); - } else { - set_port((Integer)value); - } - break; - - case TOPOLOGY: - if (value == null) { - unset_topology(); - } else { - set_topology((String)value); - } - break; - - case TASKS: - if (value == null) { - unset_tasks(); - } else { - set_tasks((List)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case PORT: - return Integer.valueOf(get_port()); - - case TOPOLOGY: - return get_topology(); - - case TASKS: - return get_tasks(); - - } - throw new 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(); - } - - switch (field) { - case PORT: - return is_set_port(); - case TOPOLOGY: - return is_set_topology(); - case TASKS: - return is_set_tasks(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof WorkerSummary) - return this.equals((WorkerSummary)that); - return false; - } - - public boolean equals(WorkerSummary that) { - if (that == null) - return false; - - boolean this_present_port = true; - boolean that_present_port = true; - if (this_present_port || that_present_port) { - if (!(this_present_port && that_present_port)) - return false; - if (this.port != that.port) - return false; - } - - boolean this_present_topology = true && this.is_set_topology(); - boolean that_present_topology = true && that.is_set_topology(); - if (this_present_topology || that_present_topology) { - if (!(this_present_topology && that_present_topology)) - return false; - if (!this.topology.equals(that.topology)) - return false; - } - - boolean this_present_tasks = true && this.is_set_tasks(); - boolean that_present_tasks = true && that.is_set_tasks(); - if (this_present_tasks || that_present_tasks) { - if (!(this_present_tasks && that_present_tasks)) - return false; - if (!this.tasks.equals(that.tasks)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_port = true; - builder.append(present_port); - if (present_port) - builder.append(port); - - boolean present_topology = true && (is_set_topology()); - builder.append(present_topology); - if (present_topology) - builder.append(topology); - - boolean present_tasks = true && (is_set_tasks()); - builder.append(present_tasks); - if (present_tasks) - builder.append(tasks); - - return builder.toHashCode(); - } - - public int compareTo(WorkerSummary other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - WorkerSummary typedOther = (WorkerSummary)other; - - lastComparison = Boolean.valueOf(is_set_port()).compareTo(typedOther.is_set_port()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_port()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.port, typedOther.port); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_topology()).compareTo(typedOther.is_set_topology()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_topology()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.topology, typedOther.topology); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(is_set_tasks()).compareTo(typedOther.is_set_tasks()); - if (lastComparison != 0) { - return lastComparison; - } - if (is_set_tasks()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tasks, typedOther.tasks); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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: // PORT - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.port = iprot.readI32(); - set_port_isSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // TOPOLOGY - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.topology = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // TASKS - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list113 = iprot.readListBegin(); - this.tasks = new ArrayList(_list113.size); - for (int _i114 = 0; _i114 < _list113.size; ++_i114) - { - TaskSummary _elem115; // required - _elem115 = new TaskSummary(); - _elem115.read(iprot); - this.tasks.add(_elem115); - } - 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(PORT_FIELD_DESC); - oprot.writeI32(this.port); - oprot.writeFieldEnd(); - if (this.topology != null) { - oprot.writeFieldBegin(TOPOLOGY_FIELD_DESC); - oprot.writeString(this.topology); - oprot.writeFieldEnd(); - } - if (this.tasks != null) { - oprot.writeFieldBegin(TASKS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.tasks.size())); - for (TaskSummary _iter116 : this.tasks) - { - _iter116.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("WorkerSummary("); - boolean first = true; - - sb.append("port:"); - sb.append(this.port); - first = false; - if (!first) sb.append(", "); - sb.append("topology:"); - if (this.topology == null) { - sb.append("null"); - } else { - sb.append(this.topology); - } - first = false; - if (!first) sb.append(", "); - sb.append("tasks:"); - if (this.tasks == null) { - sb.append("null"); - } else { - sb.append(this.tasks); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!is_set_port()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'port' is unset! Struct:" + toString()); - } - - if (!is_set_topology()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'topology' is unset! Struct:" + toString()); - } - - if (!is_set_tasks()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'tasks' is unset! Struct:" + toString()); - } - - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - 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); - 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); - } - } - -} - +/** + * Autogenerated by Thrift Compiler (0.8.0) + * + * 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 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class WorkerSummary implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("WorkerSummary"); + + private static final org.apache.thrift.protocol.TField PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("port", org.apache.thrift.protocol.TType.I32, (short)1); + private static final org.apache.thrift.protocol.TField TOPOLOGY_FIELD_DESC = new org.apache.thrift.protocol.TField("topology", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField TASKS_FIELD_DESC = new org.apache.thrift.protocol.TField("tasks", org.apache.thrift.protocol.TType.LIST, (short)3); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new WorkerSummaryStandardSchemeFactory()); + schemes.put(TupleScheme.class, new WorkerSummaryTupleSchemeFactory()); + } + + private int port; // required + private String topology; // required + private List tasks; // 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 { + PORT((short)1, "port"), + TOPOLOGY((short)2, "topology"), + TASKS((short)3, "tasks"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // PORT + return PORT; + case 2: // TOPOLOGY + return TOPOLOGY; + case 3: // TASKS + return TASKS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new 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) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __PORT_ISSET_ID = 0; + private BitSet __isset_bit_vector = new BitSet(1); + 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); + tmpMap.put(_Fields.PORT, new org.apache.thrift.meta_data.FieldMetaData("port", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.TOPOLOGY, new org.apache.thrift.meta_data.FieldMetaData("topology", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.TASKS, new org.apache.thrift.meta_data.FieldMetaData("tasks", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TaskSummary.class)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(WorkerSummary.class, metaDataMap); + } + + public WorkerSummary() { + } + + public WorkerSummary( + int port, + String topology, + List tasks) + { + this(); + this.port = port; + set_port_isSet(true); + this.topology = topology; + this.tasks = tasks; + } + + /** + * Performs a deep copy on other. + */ + public WorkerSummary(WorkerSummary other) { + __isset_bit_vector.clear(); + __isset_bit_vector.or(other.__isset_bit_vector); + this.port = other.port; + if (other.is_set_topology()) { + this.topology = other.topology; + } + if (other.is_set_tasks()) { + List __this__tasks = new ArrayList(); + for (TaskSummary other_element : other.tasks) { + __this__tasks.add(new TaskSummary(other_element)); + } + this.tasks = __this__tasks; + } + } + + public WorkerSummary deepCopy() { + return new WorkerSummary(this); + } + + @Override + public void clear() { + set_port_isSet(false); + this.port = 0; + this.topology = null; + this.tasks = null; + } + + public int get_port() { + return this.port; + } + + public void set_port(int port) { + this.port = port; + set_port_isSet(true); + } + + public void unset_port() { + __isset_bit_vector.clear(__PORT_ISSET_ID); + } + + /** Returns true if field port is set (has been assigned a value) and false otherwise */ + public boolean is_set_port() { + return __isset_bit_vector.get(__PORT_ISSET_ID); + } + + public void set_port_isSet(boolean value) { + __isset_bit_vector.set(__PORT_ISSET_ID, value); + } + + public String get_topology() { + return this.topology; + } + + public void set_topology(String topology) { + this.topology = topology; + } + + public void unset_topology() { + this.topology = null; + } + + /** Returns true if field topology is set (has been assigned a value) and false otherwise */ + public boolean is_set_topology() { + return this.topology != null; + } + + public void set_topology_isSet(boolean value) { + if (!value) { + this.topology = null; + } + } + + public int get_tasks_size() { + return (this.tasks == null) ? 0 : this.tasks.size(); + } + + public java.util.Iterator get_tasks_iterator() { + return (this.tasks == null) ? null : this.tasks.iterator(); + } + + public void add_to_tasks(TaskSummary elem) { + if (this.tasks == null) { + this.tasks = new ArrayList(); + } + this.tasks.add(elem); + } + + public List get_tasks() { + return this.tasks; + } + + public void set_tasks(List tasks) { + this.tasks = tasks; + } + + public void unset_tasks() { + this.tasks = null; + } + + /** Returns true if field tasks is set (has been assigned a value) and false otherwise */ + public boolean is_set_tasks() { + return this.tasks != null; + } + + public void set_tasks_isSet(boolean value) { + if (!value) { + this.tasks = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case PORT: + if (value == null) { + unset_port(); + } else { + set_port((Integer)value); + } + break; + + case TOPOLOGY: + if (value == null) { + unset_topology(); + } else { + set_topology((String)value); + } + break; + + case TASKS: + if (value == null) { + unset_tasks(); + } else { + set_tasks((List)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case PORT: + return Integer.valueOf(get_port()); + + case TOPOLOGY: + return get_topology(); + + case TASKS: + return get_tasks(); + + } + throw new 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(); + } + + switch (field) { + case PORT: + return is_set_port(); + case TOPOLOGY: + return is_set_topology(); + case TASKS: + return is_set_tasks(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof WorkerSummary) + return this.equals((WorkerSummary)that); + return false; + } + + public boolean equals(WorkerSummary that) { + if (that == null) + return false; + + boolean this_present_port = true; + boolean that_present_port = true; + if (this_present_port || that_present_port) { + if (!(this_present_port && that_present_port)) + return false; + if (this.port != that.port) + return false; + } + + boolean this_present_topology = true && this.is_set_topology(); + boolean that_present_topology = true && that.is_set_topology(); + if (this_present_topology || that_present_topology) { + if (!(this_present_topology && that_present_topology)) + return false; + if (!this.topology.equals(that.topology)) + return false; + } + + boolean this_present_tasks = true && this.is_set_tasks(); + boolean that_present_tasks = true && that.is_set_tasks(); + if (this_present_tasks || that_present_tasks) { + if (!(this_present_tasks && that_present_tasks)) + return false; + if (!this.tasks.equals(that.tasks)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_port = true; + builder.append(present_port); + if (present_port) + builder.append(port); + + boolean present_topology = true && (is_set_topology()); + builder.append(present_topology); + if (present_topology) + builder.append(topology); + + boolean present_tasks = true && (is_set_tasks()); + builder.append(present_tasks); + if (present_tasks) + builder.append(tasks); + + return builder.toHashCode(); + } + + public int compareTo(WorkerSummary other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + WorkerSummary typedOther = (WorkerSummary)other; + + lastComparison = Boolean.valueOf(is_set_port()).compareTo(typedOther.is_set_port()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_port()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.port, typedOther.port); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_topology()).compareTo(typedOther.is_set_topology()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_topology()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.topology, typedOther.topology); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(is_set_tasks()).compareTo(typedOther.is_set_tasks()); + if (lastComparison != 0) { + return lastComparison; + } + if (is_set_tasks()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tasks, typedOther.tasks); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("WorkerSummary("); + boolean first = true; + + sb.append("port:"); + sb.append(this.port); + first = false; + if (!first) sb.append(", "); + sb.append("topology:"); + if (this.topology == null) { + sb.append("null"); + } else { + sb.append(this.topology); + } + first = false; + if (!first) sb.append(", "); + sb.append("tasks:"); + if (this.tasks == null) { + sb.append("null"); + } else { + sb.append(this.tasks); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!is_set_port()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'port' is unset! Struct:" + toString()); + } + + if (!is_set_topology()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'topology' is unset! Struct:" + toString()); + } + + if (!is_set_tasks()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'tasks' is unset! Struct:" + toString()); + } + + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + 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); + 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 WorkerSummaryStandardSchemeFactory implements SchemeFactory { + public WorkerSummaryStandardScheme getScheme() { + return new WorkerSummaryStandardScheme(); + } + } + + private static class WorkerSummaryStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, WorkerSummary 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: // PORT + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.port = iprot.readI32(); + struct.set_port_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // TOPOLOGY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.topology = iprot.readString(); + struct.set_topology_isSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // TASKS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list226 = iprot.readListBegin(); + struct.tasks = new ArrayList(_list226.size); + for (int _i227 = 0; _i227 < _list226.size; ++_i227) + { + TaskSummary _elem228; // required + _elem228 = new TaskSummary(); + _elem228.read(iprot); + struct.tasks.add(_elem228); + } + iprot.readListEnd(); + } + struct.set_tasks_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, WorkerSummary struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(PORT_FIELD_DESC); + oprot.writeI32(struct.port); + oprot.writeFieldEnd(); + if (struct.topology != null) { + oprot.writeFieldBegin(TOPOLOGY_FIELD_DESC); + oprot.writeString(struct.topology); + oprot.writeFieldEnd(); + } + if (struct.tasks != null) { + oprot.writeFieldBegin(TASKS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.tasks.size())); + for (TaskSummary _iter229 : struct.tasks) + { + _iter229.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class WorkerSummaryTupleSchemeFactory implements SchemeFactory { + public WorkerSummaryTupleScheme getScheme() { + return new WorkerSummaryTupleScheme(); + } + } + + private static class WorkerSummaryTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, WorkerSummary struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeI32(struct.port); + oprot.writeString(struct.topology); + { + oprot.writeI32(struct.tasks.size()); + for (TaskSummary _iter230 : struct.tasks) + { + _iter230.write(oprot); + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, WorkerSummary struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.port = iprot.readI32(); + struct.set_port_isSet(true); + struct.topology = iprot.readString(); + struct.set_topology_isSet(true); + { + org.apache.thrift.protocol.TList _list231 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.tasks = new ArrayList(_list231.size); + for (int _i232 = 0; _i232 < _list231.size; ++_i232) + { + TaskSummary _elem233; // required + _elem233 = new TaskSummary(); + _elem233.read(iprot); + struct.tasks.add(_elem233); + } + } + struct.set_tasks_isSet(true); + } + } + +} + diff --git a/jstorm-client/src/main/py/storm/DistributedRPC-remote b/jstorm-client/src/main/py/storm/DistributedRPC-remote index 9b7ebd84e..488c37ffb 100644 --- a/jstorm-client/src/main/py/storm/DistributedRPC-remote +++ b/jstorm-client/src/main/py/storm/DistributedRPC-remote @@ -1,85 +1,88 @@ -#!/usr/bin/env python -# -# Autogenerated by Thrift Compiler (0.7.0) -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# - -import sys -import pprint -from urlparse import urlparse -from thrift.transport import TTransport -from thrift.transport import TSocket -from thrift.transport import THttpClient -from thrift.protocol import TBinaryProtocol - -import DistributedRPC -from ttypes import * - -if len(sys.argv) <= 1 or sys.argv[1] == '--help': - print '' - print 'Usage: ' + sys.argv[0] + ' [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]' - print '' - print 'Functions:' - print ' string execute(string functionName, string funcArgs)' - print '' - sys.exit(0) - -pp = pprint.PrettyPrinter(indent = 2) -host = 'localhost' -port = 9090 -uri = '' -framed = False -http = False -argi = 1 - -if sys.argv[argi] == '-h': - parts = sys.argv[argi+1].split(':') - host = parts[0] - port = int(parts[1]) - argi += 2 - -if sys.argv[argi] == '-u': - url = urlparse(sys.argv[argi+1]) - parts = url[1].split(':') - host = parts[0] - if len(parts) > 1: - port = int(parts[1]) - else: - port = 80 - uri = url[2] - if url[4]: - uri += '?%s' % url[4] - http = True - argi += 2 - -if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed': - framed = True - argi += 1 - -cmd = sys.argv[argi] -args = sys.argv[argi+1:] - -if http: - transport = THttpClient.THttpClient(host, port, uri) -else: - socket = TSocket.TSocket(host, port) - if framed: - transport = TTransport.TFramedTransport(socket) - else: - transport = TTransport.TBufferedTransport(socket) -protocol = TBinaryProtocol.TBinaryProtocol(transport) -client = DistributedRPC.Client(protocol) -transport.open() - -if cmd == 'execute': - if len(args) != 2: - print 'execute requires 2 args' - sys.exit(1) - pp.pprint(client.execute(args[0],args[1],)) - -else: - print 'Unrecognized method %s' % cmd - sys.exit(1) - -transport.close() +#!/usr/bin/env python +# +# Autogenerated by Thrift Compiler (0.8.0) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# +# options string: py:utf8strings +# + +import sys +import pprint +from urlparse import urlparse +from thrift.transport import TTransport +from thrift.transport import TSocket +from thrift.transport import THttpClient +from thrift.protocol import TBinaryProtocol + +import DistributedRPC +from ttypes import * + +if len(sys.argv) <= 1 or sys.argv[1] == '--help': + print '' + print 'Usage: ' + sys.argv[0] + ' [-h host[:port]] [-u url] [-f[ramed]] function [arg1 [arg2...]]' + print '' + print 'Functions:' + print ' string execute(string functionName, string funcArgs)' + print '' + sys.exit(0) + +pp = pprint.PrettyPrinter(indent = 2) +host = 'localhost' +port = 9090 +uri = '' +framed = False +http = False +argi = 1 + +if sys.argv[argi] == '-h': + parts = sys.argv[argi+1].split(':') + host = parts[0] + if len(parts) > 1: + port = int(parts[1]) + argi += 2 + +if sys.argv[argi] == '-u': + url = urlparse(sys.argv[argi+1]) + parts = url[1].split(':') + host = parts[0] + if len(parts) > 1: + port = int(parts[1]) + else: + port = 80 + uri = url[2] + if url[4]: + uri += '?%s' % url[4] + http = True + argi += 2 + +if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed': + framed = True + argi += 1 + +cmd = sys.argv[argi] +args = sys.argv[argi+1:] + +if http: + transport = THttpClient.THttpClient(host, port, uri) +else: + socket = TSocket.TSocket(host, port) + if framed: + transport = TTransport.TFramedTransport(socket) + else: + transport = TTransport.TBufferedTransport(socket) +protocol = TBinaryProtocol.TBinaryProtocol(transport) +client = DistributedRPC.Client(protocol) +transport.open() + +if cmd == 'execute': + if len(args) != 2: + print 'execute requires 2 args' + sys.exit(1) + pp.pprint(client.execute(args[0],args[1],)) + +else: + print 'Unrecognized method %s' % cmd + sys.exit(1) + +transport.close() diff --git a/jstorm-client/src/main/py/storm/DistributedRPC.py b/jstorm-client/src/main/py/storm/DistributedRPC.py index 373d4eda5..b38d3209f 100644 --- a/jstorm-client/src/main/py/storm/DistributedRPC.py +++ b/jstorm-client/src/main/py/storm/DistributedRPC.py @@ -1,250 +1,252 @@ -# -# Autogenerated by Thrift Compiler (0.7.0) -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# - -from thrift.Thrift import * -from ttypes import * -from thrift.Thrift import TProcessor -from thrift.transport import TTransport -from thrift.protocol import TBinaryProtocol, TProtocol -try: - from thrift.protocol import fastbinary -except: - fastbinary = None - - -class Iface: - def execute(self, functionName, funcArgs): - """ - Parameters: - - functionName - - funcArgs - """ - pass - - -class Client(Iface): - def __init__(self, iprot, oprot=None): - self._iprot = self._oprot = iprot - if oprot is not None: - self._oprot = oprot - self._seqid = 0 - - def execute(self, functionName, funcArgs): - """ - Parameters: - - functionName - - funcArgs - """ - self.send_execute(functionName, funcArgs) - return self.recv_execute() - - def send_execute(self, functionName, funcArgs): - self._oprot.writeMessageBegin('execute', TMessageType.CALL, self._seqid) - args = execute_args() - args.functionName = functionName - args.funcArgs = funcArgs - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_execute(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() - raise x - result = execute_result() - result.read(self._iprot) - self._iprot.readMessageEnd() - if result.success is not None: - return result.success - if result.e is not None: - raise result.e - raise TApplicationException(TApplicationException.MISSING_RESULT, "execute failed: unknown result"); - - -class Processor(Iface, TProcessor): - def __init__(self, handler): - self._handler = handler - self._processMap = {} - self._processMap["execute"] = Processor.process_execute - - def process(self, iprot, oprot): - (name, type, seqid) = iprot.readMessageBegin() - if name not in self._processMap: - iprot.skip(TType.STRUCT) - iprot.readMessageEnd() - x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name)) - oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid) - x.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - return - else: - self._processMap[name](self, seqid, iprot, oprot) - return True - - def process_execute(self, seqid, iprot, oprot): - args = execute_args() - args.read(iprot) - iprot.readMessageEnd() - result = execute_result() - try: - result.success = self._handler.execute(args.functionName, args.funcArgs) - except DRPCExecutionException, e: - result.e = e - oprot.writeMessageBegin("execute", TMessageType.REPLY, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - -# HELPER FUNCTIONS AND STRUCTURES - -class execute_args: - """ - Attributes: - - functionName - - funcArgs - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRING, 'functionName', None, None, ), # 1 - (2, TType.STRING, 'funcArgs', None, None, ), # 2 - ) - - def __init__(self, functionName=None, funcArgs=None,): - self.functionName = functionName - self.funcArgs = funcArgs - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRING: - self.functionName = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRING: - self.funcArgs = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('execute_args') - if self.functionName is not None: - oprot.writeFieldBegin('functionName', TType.STRING, 1) - oprot.writeString(self.functionName.encode('utf-8')) - oprot.writeFieldEnd() - if self.funcArgs is not None: - oprot.writeFieldBegin('funcArgs', TType.STRING, 2) - oprot.writeString(self.funcArgs.encode('utf-8')) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class execute_result: - """ - Attributes: - - success - - e - """ - - thrift_spec = ( - (0, TType.STRING, 'success', None, None, ), # 0 - (1, TType.STRUCT, 'e', (DRPCExecutionException, DRPCExecutionException.thrift_spec), None, ), # 1 - ) - - def __init__(self, success=None, e=None,): - self.success = success - self.e = e - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 0: - if ftype == TType.STRING: - self.success = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - elif fid == 1: - if ftype == TType.STRUCT: - self.e = DRPCExecutionException() - self.e.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('execute_result') - if self.success is not None: - oprot.writeFieldBegin('success', TType.STRING, 0) - oprot.writeString(self.success.encode('utf-8')) - oprot.writeFieldEnd() - if self.e is not None: - oprot.writeFieldBegin('e', TType.STRUCT, 1) - self.e.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) +# +# Autogenerated by Thrift Compiler (0.8.0) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# +# options string: py:utf8strings +# + +from thrift.Thrift import TType, TMessageType, TException +from ttypes import * +from thrift.Thrift import TProcessor +from thrift.transport import TTransport +from thrift.protocol import TBinaryProtocol, TProtocol +try: + from thrift.protocol import fastbinary +except: + fastbinary = None + + +class Iface: + def execute(self, functionName, funcArgs): + """ + Parameters: + - functionName + - funcArgs + """ + pass + + +class Client(Iface): + def __init__(self, iprot, oprot=None): + self._iprot = self._oprot = iprot + if oprot is not None: + self._oprot = oprot + self._seqid = 0 + + def execute(self, functionName, funcArgs): + """ + Parameters: + - functionName + - funcArgs + """ + self.send_execute(functionName, funcArgs) + return self.recv_execute() + + def send_execute(self, functionName, funcArgs): + self._oprot.writeMessageBegin('execute', TMessageType.CALL, self._seqid) + args = execute_args() + args.functionName = functionName + args.funcArgs = funcArgs + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_execute(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = execute_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.e is not None: + raise result.e + raise TApplicationException(TApplicationException.MISSING_RESULT, "execute failed: unknown result"); + + +class Processor(Iface, TProcessor): + def __init__(self, handler): + self._handler = handler + self._processMap = {} + self._processMap["execute"] = Processor.process_execute + + def process(self, iprot, oprot): + (name, type, seqid) = iprot.readMessageBegin() + if name not in self._processMap: + iprot.skip(TType.STRUCT) + iprot.readMessageEnd() + x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name)) + oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid) + x.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + return + else: + self._processMap[name](self, seqid, iprot, oprot) + return True + + def process_execute(self, seqid, iprot, oprot): + args = execute_args() + args.read(iprot) + iprot.readMessageEnd() + result = execute_result() + try: + result.success = self._handler.execute(args.functionName, args.funcArgs) + except DRPCExecutionException, e: + result.e = e + oprot.writeMessageBegin("execute", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + +# HELPER FUNCTIONS AND STRUCTURES + +class execute_args: + """ + Attributes: + - functionName + - funcArgs + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'functionName', None, None, ), # 1 + (2, TType.STRING, 'funcArgs', None, None, ), # 2 + ) + + def __init__(self, functionName=None, funcArgs=None,): + self.functionName = functionName + self.funcArgs = funcArgs + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.functionName = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.funcArgs = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('execute_args') + if self.functionName is not None: + oprot.writeFieldBegin('functionName', TType.STRING, 1) + oprot.writeString(self.functionName.encode('utf-8')) + oprot.writeFieldEnd() + if self.funcArgs is not None: + oprot.writeFieldBegin('funcArgs', TType.STRING, 2) + oprot.writeString(self.funcArgs.encode('utf-8')) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class execute_result: + """ + Attributes: + - success + - e + """ + + thrift_spec = ( + (0, TType.STRING, 'success', None, None, ), # 0 + (1, TType.STRUCT, 'e', (DRPCExecutionException, DRPCExecutionException.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, e=None,): + self.success = success + self.e = e + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.STRING: + self.success = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.e = DRPCExecutionException() + self.e.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('execute_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.STRING, 0) + oprot.writeString(self.success.encode('utf-8')) + oprot.writeFieldEnd() + if self.e is not None: + oprot.writeFieldBegin('e', TType.STRUCT, 1) + self.e.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) diff --git a/jstorm-client/src/main/py/storm/DistributedRPCInvocations-remote b/jstorm-client/src/main/py/storm/DistributedRPCInvocations-remote index 5235dfee9..e53db163c 100644 --- a/jstorm-client/src/main/py/storm/DistributedRPCInvocations-remote +++ b/jstorm-client/src/main/py/storm/DistributedRPCInvocations-remote @@ -1,99 +1,102 @@ -#!/usr/bin/env python -# -# Autogenerated by Thrift Compiler (0.7.0) -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# - -import sys -import pprint -from urlparse import urlparse -from thrift.transport import TTransport -from thrift.transport import TSocket -from thrift.transport import THttpClient -from thrift.protocol import TBinaryProtocol - -import DistributedRPCInvocations -from ttypes import * - -if len(sys.argv) <= 1 or sys.argv[1] == '--help': - print '' - print 'Usage: ' + sys.argv[0] + ' [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]' - print '' - print 'Functions:' - print ' void result(string id, string result)' - print ' DRPCRequest fetchRequest(string functionName)' - print ' void failRequest(string id)' - print '' - sys.exit(0) - -pp = pprint.PrettyPrinter(indent = 2) -host = 'localhost' -port = 9090 -uri = '' -framed = False -http = False -argi = 1 - -if sys.argv[argi] == '-h': - parts = sys.argv[argi+1].split(':') - host = parts[0] - port = int(parts[1]) - argi += 2 - -if sys.argv[argi] == '-u': - url = urlparse(sys.argv[argi+1]) - parts = url[1].split(':') - host = parts[0] - if len(parts) > 1: - port = int(parts[1]) - else: - port = 80 - uri = url[2] - if url[4]: - uri += '?%s' % url[4] - http = True - argi += 2 - -if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed': - framed = True - argi += 1 - -cmd = sys.argv[argi] -args = sys.argv[argi+1:] - -if http: - transport = THttpClient.THttpClient(host, port, uri) -else: - socket = TSocket.TSocket(host, port) - if framed: - transport = TTransport.TFramedTransport(socket) - else: - transport = TTransport.TBufferedTransport(socket) -protocol = TBinaryProtocol.TBinaryProtocol(transport) -client = DistributedRPCInvocations.Client(protocol) -transport.open() - -if cmd == 'result': - if len(args) != 2: - print 'result requires 2 args' - sys.exit(1) - pp.pprint(client.result(args[0],args[1],)) - -elif cmd == 'fetchRequest': - if len(args) != 1: - print 'fetchRequest requires 1 args' - sys.exit(1) - pp.pprint(client.fetchRequest(args[0],)) - -elif cmd == 'failRequest': - if len(args) != 1: - print 'failRequest requires 1 args' - sys.exit(1) - pp.pprint(client.failRequest(args[0],)) - -else: - print 'Unrecognized method %s' % cmd - sys.exit(1) - -transport.close() +#!/usr/bin/env python +# +# Autogenerated by Thrift Compiler (0.8.0) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# +# options string: py:utf8strings +# + +import sys +import pprint +from urlparse import urlparse +from thrift.transport import TTransport +from thrift.transport import TSocket +from thrift.transport import THttpClient +from thrift.protocol import TBinaryProtocol + +import DistributedRPCInvocations +from ttypes import * + +if len(sys.argv) <= 1 or sys.argv[1] == '--help': + print '' + print 'Usage: ' + sys.argv[0] + ' [-h host[:port]] [-u url] [-f[ramed]] function [arg1 [arg2...]]' + print '' + print 'Functions:' + print ' void result(string id, string result)' + print ' DRPCRequest fetchRequest(string functionName)' + print ' void failRequest(string id)' + print '' + sys.exit(0) + +pp = pprint.PrettyPrinter(indent = 2) +host = 'localhost' +port = 9090 +uri = '' +framed = False +http = False +argi = 1 + +if sys.argv[argi] == '-h': + parts = sys.argv[argi+1].split(':') + host = parts[0] + if len(parts) > 1: + port = int(parts[1]) + argi += 2 + +if sys.argv[argi] == '-u': + url = urlparse(sys.argv[argi+1]) + parts = url[1].split(':') + host = parts[0] + if len(parts) > 1: + port = int(parts[1]) + else: + port = 80 + uri = url[2] + if url[4]: + uri += '?%s' % url[4] + http = True + argi += 2 + +if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed': + framed = True + argi += 1 + +cmd = sys.argv[argi] +args = sys.argv[argi+1:] + +if http: + transport = THttpClient.THttpClient(host, port, uri) +else: + socket = TSocket.TSocket(host, port) + if framed: + transport = TTransport.TFramedTransport(socket) + else: + transport = TTransport.TBufferedTransport(socket) +protocol = TBinaryProtocol.TBinaryProtocol(transport) +client = DistributedRPCInvocations.Client(protocol) +transport.open() + +if cmd == 'result': + if len(args) != 2: + print 'result requires 2 args' + sys.exit(1) + pp.pprint(client.result(args[0],args[1],)) + +elif cmd == 'fetchRequest': + if len(args) != 1: + print 'fetchRequest requires 1 args' + sys.exit(1) + pp.pprint(client.fetchRequest(args[0],)) + +elif cmd == 'failRequest': + if len(args) != 1: + print 'failRequest requires 1 args' + sys.exit(1) + pp.pprint(client.failRequest(args[0],)) + +else: + print 'Unrecognized method %s' % cmd + sys.exit(1) + +transport.close() diff --git a/jstorm-client/src/main/py/storm/DistributedRPCInvocations.py b/jstorm-client/src/main/py/storm/DistributedRPCInvocations.py index 15797b280..162853d70 100644 --- a/jstorm-client/src/main/py/storm/DistributedRPCInvocations.py +++ b/jstorm-client/src/main/py/storm/DistributedRPCInvocations.py @@ -1,531 +1,533 @@ -# -# Autogenerated by Thrift Compiler (0.7.0) -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# - -from thrift.Thrift import * -from ttypes import * -from thrift.Thrift import TProcessor -from thrift.transport import TTransport -from thrift.protocol import TBinaryProtocol, TProtocol -try: - from thrift.protocol import fastbinary -except: - fastbinary = None - - -class Iface: - def result(self, id, result): - """ - Parameters: - - id - - result - """ - pass - - def fetchRequest(self, functionName): - """ - Parameters: - - functionName - """ - pass - - def failRequest(self, id): - """ - Parameters: - - id - """ - pass - - -class Client(Iface): - def __init__(self, iprot, oprot=None): - self._iprot = self._oprot = iprot - if oprot is not None: - self._oprot = oprot - self._seqid = 0 - - def result(self, id, result): - """ - Parameters: - - id - - result - """ - self.send_result(id, result) - self.recv_result() - - def send_result(self, id, result): - self._oprot.writeMessageBegin('result', TMessageType.CALL, self._seqid) - args = result_args() - args.id = id - args.result = result - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_result(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() - raise x - result = result_result() - result.read(self._iprot) - self._iprot.readMessageEnd() - return - - def fetchRequest(self, functionName): - """ - Parameters: - - functionName - """ - self.send_fetchRequest(functionName) - return self.recv_fetchRequest() - - def send_fetchRequest(self, functionName): - self._oprot.writeMessageBegin('fetchRequest', TMessageType.CALL, self._seqid) - args = fetchRequest_args() - args.functionName = functionName - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_fetchRequest(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() - raise x - result = fetchRequest_result() - result.read(self._iprot) - self._iprot.readMessageEnd() - if result.success is not None: - return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "fetchRequest failed: unknown result"); - - def failRequest(self, id): - """ - Parameters: - - id - """ - self.send_failRequest(id) - self.recv_failRequest() - - def send_failRequest(self, id): - self._oprot.writeMessageBegin('failRequest', TMessageType.CALL, self._seqid) - args = failRequest_args() - args.id = id - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_failRequest(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() - raise x - result = failRequest_result() - result.read(self._iprot) - self._iprot.readMessageEnd() - return - - -class Processor(Iface, TProcessor): - def __init__(self, handler): - self._handler = handler - self._processMap = {} - self._processMap["result"] = Processor.process_result - self._processMap["fetchRequest"] = Processor.process_fetchRequest - self._processMap["failRequest"] = Processor.process_failRequest - - def process(self, iprot, oprot): - (name, type, seqid) = iprot.readMessageBegin() - if name not in self._processMap: - iprot.skip(TType.STRUCT) - iprot.readMessageEnd() - x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name)) - oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid) - x.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - return - else: - self._processMap[name](self, seqid, iprot, oprot) - return True - - def process_result(self, seqid, iprot, oprot): - args = result_args() - args.read(iprot) - iprot.readMessageEnd() - result = result_result() - self._handler.result(args.id, args.result) - oprot.writeMessageBegin("result", TMessageType.REPLY, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_fetchRequest(self, seqid, iprot, oprot): - args = fetchRequest_args() - args.read(iprot) - iprot.readMessageEnd() - result = fetchRequest_result() - result.success = self._handler.fetchRequest(args.functionName) - oprot.writeMessageBegin("fetchRequest", TMessageType.REPLY, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_failRequest(self, seqid, iprot, oprot): - args = failRequest_args() - args.read(iprot) - iprot.readMessageEnd() - result = failRequest_result() - self._handler.failRequest(args.id) - oprot.writeMessageBegin("failRequest", TMessageType.REPLY, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - -# HELPER FUNCTIONS AND STRUCTURES - -class result_args: - """ - Attributes: - - id - - result - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRING, 'id', None, None, ), # 1 - (2, TType.STRING, 'result', None, None, ), # 2 - ) - - def __init__(self, id=None, result=None,): - self.id = id - self.result = result - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRING: - self.id = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRING: - self.result = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('result_args') - if self.id is not None: - oprot.writeFieldBegin('id', TType.STRING, 1) - oprot.writeString(self.id.encode('utf-8')) - oprot.writeFieldEnd() - if self.result is not None: - oprot.writeFieldBegin('result', TType.STRING, 2) - oprot.writeString(self.result.encode('utf-8')) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class result_result: - - thrift_spec = ( - ) - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('result_result') - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class fetchRequest_args: - """ - Attributes: - - functionName - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRING, 'functionName', None, None, ), # 1 - ) - - def __init__(self, functionName=None,): - self.functionName = functionName - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRING: - self.functionName = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('fetchRequest_args') - if self.functionName is not None: - oprot.writeFieldBegin('functionName', TType.STRING, 1) - oprot.writeString(self.functionName.encode('utf-8')) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class fetchRequest_result: - """ - Attributes: - - success - """ - - thrift_spec = ( - (0, TType.STRUCT, 'success', (DRPCRequest, DRPCRequest.thrift_spec), None, ), # 0 - ) - - def __init__(self, success=None,): - self.success = success - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 0: - if ftype == TType.STRUCT: - self.success = DRPCRequest() - self.success.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('fetchRequest_result') - if self.success is not None: - oprot.writeFieldBegin('success', TType.STRUCT, 0) - self.success.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class failRequest_args: - """ - Attributes: - - id - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRING, 'id', None, None, ), # 1 - ) - - def __init__(self, id=None,): - self.id = id - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRING: - self.id = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('failRequest_args') - if self.id is not None: - oprot.writeFieldBegin('id', TType.STRING, 1) - oprot.writeString(self.id.encode('utf-8')) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class failRequest_result: - - thrift_spec = ( - ) - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('failRequest_result') - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) +# +# Autogenerated by Thrift Compiler (0.8.0) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# +# options string: py:utf8strings +# + +from thrift.Thrift import TType, TMessageType, TException +from ttypes import * +from thrift.Thrift import TProcessor +from thrift.transport import TTransport +from thrift.protocol import TBinaryProtocol, TProtocol +try: + from thrift.protocol import fastbinary +except: + fastbinary = None + + +class Iface: + def result(self, id, result): + """ + Parameters: + - id + - result + """ + pass + + def fetchRequest(self, functionName): + """ + Parameters: + - functionName + """ + pass + + def failRequest(self, id): + """ + Parameters: + - id + """ + pass + + +class Client(Iface): + def __init__(self, iprot, oprot=None): + self._iprot = self._oprot = iprot + if oprot is not None: + self._oprot = oprot + self._seqid = 0 + + def result(self, id, result): + """ + Parameters: + - id + - result + """ + self.send_result(id, result) + self.recv_result() + + def send_result(self, id, result): + self._oprot.writeMessageBegin('result', TMessageType.CALL, self._seqid) + args = result_args() + args.id = id + args.result = result + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_result(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = result_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + return + + def fetchRequest(self, functionName): + """ + Parameters: + - functionName + """ + self.send_fetchRequest(functionName) + return self.recv_fetchRequest() + + def send_fetchRequest(self, functionName): + self._oprot.writeMessageBegin('fetchRequest', TMessageType.CALL, self._seqid) + args = fetchRequest_args() + args.functionName = functionName + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_fetchRequest(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = fetchRequest_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "fetchRequest failed: unknown result"); + + def failRequest(self, id): + """ + Parameters: + - id + """ + self.send_failRequest(id) + self.recv_failRequest() + + def send_failRequest(self, id): + self._oprot.writeMessageBegin('failRequest', TMessageType.CALL, self._seqid) + args = failRequest_args() + args.id = id + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_failRequest(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = failRequest_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + return + + +class Processor(Iface, TProcessor): + def __init__(self, handler): + self._handler = handler + self._processMap = {} + self._processMap["result"] = Processor.process_result + self._processMap["fetchRequest"] = Processor.process_fetchRequest + self._processMap["failRequest"] = Processor.process_failRequest + + def process(self, iprot, oprot): + (name, type, seqid) = iprot.readMessageBegin() + if name not in self._processMap: + iprot.skip(TType.STRUCT) + iprot.readMessageEnd() + x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name)) + oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid) + x.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + return + else: + self._processMap[name](self, seqid, iprot, oprot) + return True + + def process_result(self, seqid, iprot, oprot): + args = result_args() + args.read(iprot) + iprot.readMessageEnd() + result = result_result() + self._handler.result(args.id, args.result) + oprot.writeMessageBegin("result", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_fetchRequest(self, seqid, iprot, oprot): + args = fetchRequest_args() + args.read(iprot) + iprot.readMessageEnd() + result = fetchRequest_result() + result.success = self._handler.fetchRequest(args.functionName) + oprot.writeMessageBegin("fetchRequest", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_failRequest(self, seqid, iprot, oprot): + args = failRequest_args() + args.read(iprot) + iprot.readMessageEnd() + result = failRequest_result() + self._handler.failRequest(args.id) + oprot.writeMessageBegin("failRequest", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + +# HELPER FUNCTIONS AND STRUCTURES + +class result_args: + """ + Attributes: + - id + - result + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'id', None, None, ), # 1 + (2, TType.STRING, 'result', None, None, ), # 2 + ) + + def __init__(self, id=None, result=None,): + self.id = id + self.result = result + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.id = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.result = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('result_args') + if self.id is not None: + oprot.writeFieldBegin('id', TType.STRING, 1) + oprot.writeString(self.id.encode('utf-8')) + oprot.writeFieldEnd() + if self.result is not None: + oprot.writeFieldBegin('result', TType.STRING, 2) + oprot.writeString(self.result.encode('utf-8')) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class result_result: + + thrift_spec = ( + ) + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('result_result') + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class fetchRequest_args: + """ + Attributes: + - functionName + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'functionName', None, None, ), # 1 + ) + + def __init__(self, functionName=None,): + self.functionName = functionName + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.functionName = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('fetchRequest_args') + if self.functionName is not None: + oprot.writeFieldBegin('functionName', TType.STRING, 1) + oprot.writeString(self.functionName.encode('utf-8')) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class fetchRequest_result: + """ + Attributes: + - success + """ + + thrift_spec = ( + (0, TType.STRUCT, 'success', (DRPCRequest, DRPCRequest.thrift_spec), None, ), # 0 + ) + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.STRUCT: + self.success = DRPCRequest() + self.success.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('fetchRequest_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.STRUCT, 0) + self.success.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class failRequest_args: + """ + Attributes: + - id + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'id', None, None, ), # 1 + ) + + def __init__(self, id=None,): + self.id = id + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.id = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('failRequest_args') + if self.id is not None: + oprot.writeFieldBegin('id', TType.STRING, 1) + oprot.writeString(self.id.encode('utf-8')) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class failRequest_result: + + thrift_spec = ( + ) + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('failRequest_result') + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) diff --git a/jstorm-client/src/main/py/storm/Nimbus-remote b/jstorm-client/src/main/py/storm/Nimbus-remote index dad54adc9..05e25253b 100644 --- a/jstorm-client/src/main/py/storm/Nimbus-remote +++ b/jstorm-client/src/main/py/storm/Nimbus-remote @@ -1,190 +1,193 @@ -#!/usr/bin/env python -# -# Autogenerated by Thrift Compiler (0.7.0) -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# - -import sys -import pprint -from urlparse import urlparse -from thrift.transport import TTransport -from thrift.transport import TSocket -from thrift.transport import THttpClient -from thrift.protocol import TBinaryProtocol - -import Nimbus -from ttypes import * - -if len(sys.argv) <= 1 or sys.argv[1] == '--help': - print '' - print 'Usage: ' + sys.argv[0] + ' [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]' - print '' - print 'Functions:' - print ' void submitTopology(string name, string uploadedJarLocation, string jsonConf, StormTopology topology)' - print ' void killTopology(string name)' - print ' void killTopologyWithOpts(string name, KillOptions options)' - print ' void activate(string name)' - print ' void deactivate(string name)' - print ' void rebalance(string name, RebalanceOptions options)' - print ' string beginFileUpload()' - print ' void uploadChunk(string location, string chunk)' - print ' void finishFileUpload(string location)' - print ' string beginFileDownload(string file)' - print ' string downloadChunk(string id)' - print ' ClusterSummary getClusterInfo()' - print ' TopologyInfo getTopologyInfo(string id)' - print ' SupervisorWorkers getSupervisorWorkers(string host)' - print ' string getTopologyConf(string id)' - print ' StormTopology getTopology(string id)' - print '' - sys.exit(0) - -pp = pprint.PrettyPrinter(indent = 2) -host = 'localhost' -port = 9090 -uri = '' -framed = False -http = False -argi = 1 - -if sys.argv[argi] == '-h': - parts = sys.argv[argi+1].split(':') - host = parts[0] - port = int(parts[1]) - argi += 2 - -if sys.argv[argi] == '-u': - url = urlparse(sys.argv[argi+1]) - parts = url[1].split(':') - host = parts[0] - if len(parts) > 1: - port = int(parts[1]) - else: - port = 80 - uri = url[2] - if url[4]: - uri += '?%s' % url[4] - http = True - argi += 2 - -if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed': - framed = True - argi += 1 - -cmd = sys.argv[argi] -args = sys.argv[argi+1:] - -if http: - transport = THttpClient.THttpClient(host, port, uri) -else: - socket = TSocket.TSocket(host, port) - if framed: - transport = TTransport.TFramedTransport(socket) - else: - transport = TTransport.TBufferedTransport(socket) -protocol = TBinaryProtocol.TBinaryProtocol(transport) -client = Nimbus.Client(protocol) -transport.open() - -if cmd == 'submitTopology': - if len(args) != 4: - print 'submitTopology requires 4 args' - sys.exit(1) - pp.pprint(client.submitTopology(args[0],args[1],args[2],eval(args[3]),)) - -elif cmd == 'killTopology': - if len(args) != 1: - print 'killTopology requires 1 args' - sys.exit(1) - pp.pprint(client.killTopology(args[0],)) - -elif cmd == 'killTopologyWithOpts': - if len(args) != 2: - print 'killTopologyWithOpts requires 2 args' - sys.exit(1) - pp.pprint(client.killTopologyWithOpts(args[0],eval(args[1]),)) - -elif cmd == 'activate': - if len(args) != 1: - print 'activate requires 1 args' - sys.exit(1) - pp.pprint(client.activate(args[0],)) - -elif cmd == 'deactivate': - if len(args) != 1: - print 'deactivate requires 1 args' - sys.exit(1) - pp.pprint(client.deactivate(args[0],)) - -elif cmd == 'rebalance': - if len(args) != 2: - print 'rebalance requires 2 args' - sys.exit(1) - pp.pprint(client.rebalance(args[0],eval(args[1]),)) - -elif cmd == 'beginFileUpload': - if len(args) != 0: - print 'beginFileUpload requires 0 args' - sys.exit(1) - pp.pprint(client.beginFileUpload()) - -elif cmd == 'uploadChunk': - if len(args) != 2: - print 'uploadChunk requires 2 args' - sys.exit(1) - pp.pprint(client.uploadChunk(args[0],args[1],)) - -elif cmd == 'finishFileUpload': - if len(args) != 1: - print 'finishFileUpload requires 1 args' - sys.exit(1) - pp.pprint(client.finishFileUpload(args[0],)) - -elif cmd == 'beginFileDownload': - if len(args) != 1: - print 'beginFileDownload requires 1 args' - sys.exit(1) - pp.pprint(client.beginFileDownload(args[0],)) - -elif cmd == 'downloadChunk': - if len(args) != 1: - print 'downloadChunk requires 1 args' - sys.exit(1) - pp.pprint(client.downloadChunk(args[0],)) - -elif cmd == 'getClusterInfo': - if len(args) != 0: - print 'getClusterInfo requires 0 args' - sys.exit(1) - pp.pprint(client.getClusterInfo()) - -elif cmd == 'getTopologyInfo': - if len(args) != 1: - print 'getTopologyInfo requires 1 args' - sys.exit(1) - pp.pprint(client.getTopologyInfo(args[0],)) - -elif cmd == 'getSupervisorWorkers': - if len(args) != 1: - print 'getSupervisorWorkers requires 1 args' - sys.exit(1) - pp.pprint(client.getSupervisorWorkers(args[0],)) - -elif cmd == 'getTopologyConf': - if len(args) != 1: - print 'getTopologyConf requires 1 args' - sys.exit(1) - pp.pprint(client.getTopologyConf(args[0],)) - -elif cmd == 'getTopology': - if len(args) != 1: - print 'getTopology requires 1 args' - sys.exit(1) - pp.pprint(client.getTopology(args[0],)) - -else: - print 'Unrecognized method %s' % cmd - sys.exit(1) - -transport.close() +#!/usr/bin/env python +# +# Autogenerated by Thrift Compiler (0.8.0) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# +# options string: py:utf8strings +# + +import sys +import pprint +from urlparse import urlparse +from thrift.transport import TTransport +from thrift.transport import TSocket +from thrift.transport import THttpClient +from thrift.protocol import TBinaryProtocol + +import Nimbus +from ttypes import * + +if len(sys.argv) <= 1 or sys.argv[1] == '--help': + print '' + print 'Usage: ' + sys.argv[0] + ' [-h host[:port]] [-u url] [-f[ramed]] function [arg1 [arg2...]]' + print '' + print 'Functions:' + print ' void submitTopology(string name, string uploadedJarLocation, string jsonConf, StormTopology topology)' + print ' void killTopology(string name)' + print ' void killTopologyWithOpts(string name, KillOptions options)' + print ' void activate(string name)' + print ' void deactivate(string name)' + print ' void rebalance(string name, RebalanceOptions options)' + print ' string beginFileUpload()' + print ' void uploadChunk(string location, string chunk)' + print ' void finishFileUpload(string location)' + print ' string beginFileDownload(string file)' + print ' string downloadChunk(string id)' + print ' ClusterSummary getClusterInfo()' + print ' TopologyInfo getTopologyInfo(string id)' + print ' SupervisorWorkers getSupervisorWorkers(string host)' + print ' string getTopologyConf(string id)' + print ' StormTopology getTopology(string id)' + print '' + sys.exit(0) + +pp = pprint.PrettyPrinter(indent = 2) +host = 'localhost' +port = 9090 +uri = '' +framed = False +http = False +argi = 1 + +if sys.argv[argi] == '-h': + parts = sys.argv[argi+1].split(':') + host = parts[0] + if len(parts) > 1: + port = int(parts[1]) + argi += 2 + +if sys.argv[argi] == '-u': + url = urlparse(sys.argv[argi+1]) + parts = url[1].split(':') + host = parts[0] + if len(parts) > 1: + port = int(parts[1]) + else: + port = 80 + uri = url[2] + if url[4]: + uri += '?%s' % url[4] + http = True + argi += 2 + +if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed': + framed = True + argi += 1 + +cmd = sys.argv[argi] +args = sys.argv[argi+1:] + +if http: + transport = THttpClient.THttpClient(host, port, uri) +else: + socket = TSocket.TSocket(host, port) + if framed: + transport = TTransport.TFramedTransport(socket) + else: + transport = TTransport.TBufferedTransport(socket) +protocol = TBinaryProtocol.TBinaryProtocol(transport) +client = Nimbus.Client(protocol) +transport.open() + +if cmd == 'submitTopology': + if len(args) != 4: + print 'submitTopology requires 4 args' + sys.exit(1) + pp.pprint(client.submitTopology(args[0],args[1],args[2],eval(args[3]),)) + +elif cmd == 'killTopology': + if len(args) != 1: + print 'killTopology requires 1 args' + sys.exit(1) + pp.pprint(client.killTopology(args[0],)) + +elif cmd == 'killTopologyWithOpts': + if len(args) != 2: + print 'killTopologyWithOpts requires 2 args' + sys.exit(1) + pp.pprint(client.killTopologyWithOpts(args[0],eval(args[1]),)) + +elif cmd == 'activate': + if len(args) != 1: + print 'activate requires 1 args' + sys.exit(1) + pp.pprint(client.activate(args[0],)) + +elif cmd == 'deactivate': + if len(args) != 1: + print 'deactivate requires 1 args' + sys.exit(1) + pp.pprint(client.deactivate(args[0],)) + +elif cmd == 'rebalance': + if len(args) != 2: + print 'rebalance requires 2 args' + sys.exit(1) + pp.pprint(client.rebalance(args[0],eval(args[1]),)) + +elif cmd == 'beginFileUpload': + if len(args) != 0: + print 'beginFileUpload requires 0 args' + sys.exit(1) + pp.pprint(client.beginFileUpload()) + +elif cmd == 'uploadChunk': + if len(args) != 2: + print 'uploadChunk requires 2 args' + sys.exit(1) + pp.pprint(client.uploadChunk(args[0],args[1],)) + +elif cmd == 'finishFileUpload': + if len(args) != 1: + print 'finishFileUpload requires 1 args' + sys.exit(1) + pp.pprint(client.finishFileUpload(args[0],)) + +elif cmd == 'beginFileDownload': + if len(args) != 1: + print 'beginFileDownload requires 1 args' + sys.exit(1) + pp.pprint(client.beginFileDownload(args[0],)) + +elif cmd == 'downloadChunk': + if len(args) != 1: + print 'downloadChunk requires 1 args' + sys.exit(1) + pp.pprint(client.downloadChunk(args[0],)) + +elif cmd == 'getClusterInfo': + if len(args) != 0: + print 'getClusterInfo requires 0 args' + sys.exit(1) + pp.pprint(client.getClusterInfo()) + +elif cmd == 'getTopologyInfo': + if len(args) != 1: + print 'getTopologyInfo requires 1 args' + sys.exit(1) + pp.pprint(client.getTopologyInfo(args[0],)) + +elif cmd == 'getSupervisorWorkers': + if len(args) != 1: + print 'getSupervisorWorkers requires 1 args' + sys.exit(1) + pp.pprint(client.getSupervisorWorkers(args[0],)) + +elif cmd == 'getTopologyConf': + if len(args) != 1: + print 'getTopologyConf requires 1 args' + sys.exit(1) + pp.pprint(client.getTopologyConf(args[0],)) + +elif cmd == 'getTopology': + if len(args) != 1: + print 'getTopology requires 1 args' + sys.exit(1) + pp.pprint(client.getTopology(args[0],)) + +else: + print 'Unrecognized method %s' % cmd + sys.exit(1) + +transport.close() diff --git a/jstorm-client/src/main/py/storm/Nimbus.py b/jstorm-client/src/main/py/storm/Nimbus.py index 32c325e51..605263e8e 100644 --- a/jstorm-client/src/main/py/storm/Nimbus.py +++ b/jstorm-client/src/main/py/storm/Nimbus.py @@ -1,2861 +1,2863 @@ -# -# Autogenerated by Thrift Compiler (0.7.0) -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# - -from thrift.Thrift import * -from ttypes import * -from thrift.Thrift import TProcessor -from thrift.transport import TTransport -from thrift.protocol import TBinaryProtocol, TProtocol -try: - from thrift.protocol import fastbinary -except: - fastbinary = None - - -class Iface: - def submitTopology(self, name, uploadedJarLocation, jsonConf, topology): - """ - Parameters: - - name - - uploadedJarLocation - - jsonConf - - topology - """ - pass - - def killTopology(self, name): - """ - Parameters: - - name - """ - pass - - def killTopologyWithOpts(self, name, options): - """ - Parameters: - - name - - options - """ - pass - - def activate(self, name): - """ - Parameters: - - name - """ - pass - - def deactivate(self, name): - """ - Parameters: - - name - """ - pass - - def rebalance(self, name, options): - """ - Parameters: - - name - - options - """ - pass - - def beginFileUpload(self, ): - pass - - def uploadChunk(self, location, chunk): - """ - Parameters: - - location - - chunk - """ - pass - - def finishFileUpload(self, location): - """ - Parameters: - - location - """ - pass - - def beginFileDownload(self, file): - """ - Parameters: - - file - """ - pass - - def downloadChunk(self, id): - """ - Parameters: - - id - """ - pass - - def getClusterInfo(self, ): - pass - - def getTopologyInfo(self, id): - """ - Parameters: - - id - """ - pass - - def getSupervisorWorkers(self, host): - """ - Parameters: - - host - """ - pass - - def getTopologyConf(self, id): - """ - Parameters: - - id - """ - pass - - def getTopology(self, id): - """ - Parameters: - - id - """ - pass - - -class Client(Iface): - def __init__(self, iprot, oprot=None): - self._iprot = self._oprot = iprot - if oprot is not None: - self._oprot = oprot - self._seqid = 0 - - def submitTopology(self, name, uploadedJarLocation, jsonConf, topology): - """ - Parameters: - - name - - uploadedJarLocation - - jsonConf - - topology - """ - self.send_submitTopology(name, uploadedJarLocation, jsonConf, topology) - self.recv_submitTopology() - - def send_submitTopology(self, name, uploadedJarLocation, jsonConf, topology): - self._oprot.writeMessageBegin('submitTopology', TMessageType.CALL, self._seqid) - args = submitTopology_args() - args.name = name - args.uploadedJarLocation = uploadedJarLocation - args.jsonConf = jsonConf - args.topology = topology - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_submitTopology(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() - raise x - result = submitTopology_result() - result.read(self._iprot) - self._iprot.readMessageEnd() - if result.e is not None: - raise result.e - if result.ite is not None: - raise result.ite - return - - def killTopology(self, name): - """ - Parameters: - - name - """ - self.send_killTopology(name) - self.recv_killTopology() - - def send_killTopology(self, name): - self._oprot.writeMessageBegin('killTopology', TMessageType.CALL, self._seqid) - args = killTopology_args() - args.name = name - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_killTopology(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() - raise x - result = killTopology_result() - result.read(self._iprot) - self._iprot.readMessageEnd() - if result.e is not None: - raise result.e - return - - def killTopologyWithOpts(self, name, options): - """ - Parameters: - - name - - options - """ - self.send_killTopologyWithOpts(name, options) - self.recv_killTopologyWithOpts() - - def send_killTopologyWithOpts(self, name, options): - self._oprot.writeMessageBegin('killTopologyWithOpts', TMessageType.CALL, self._seqid) - args = killTopologyWithOpts_args() - args.name = name - args.options = options - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_killTopologyWithOpts(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() - raise x - result = killTopologyWithOpts_result() - result.read(self._iprot) - self._iprot.readMessageEnd() - if result.e is not None: - raise result.e - return - - def activate(self, name): - """ - Parameters: - - name - """ - self.send_activate(name) - self.recv_activate() - - def send_activate(self, name): - self._oprot.writeMessageBegin('activate', TMessageType.CALL, self._seqid) - args = activate_args() - args.name = name - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_activate(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() - raise x - result = activate_result() - result.read(self._iprot) - self._iprot.readMessageEnd() - if result.e is not None: - raise result.e - return - - def deactivate(self, name): - """ - Parameters: - - name - """ - self.send_deactivate(name) - self.recv_deactivate() - - def send_deactivate(self, name): - self._oprot.writeMessageBegin('deactivate', TMessageType.CALL, self._seqid) - args = deactivate_args() - args.name = name - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_deactivate(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() - raise x - result = deactivate_result() - result.read(self._iprot) - self._iprot.readMessageEnd() - if result.e is not None: - raise result.e - return - - def rebalance(self, name, options): - """ - Parameters: - - name - - options - """ - self.send_rebalance(name, options) - self.recv_rebalance() - - def send_rebalance(self, name, options): - self._oprot.writeMessageBegin('rebalance', TMessageType.CALL, self._seqid) - args = rebalance_args() - args.name = name - args.options = options - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_rebalance(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() - raise x - result = rebalance_result() - result.read(self._iprot) - self._iprot.readMessageEnd() - if result.e is not None: - raise result.e - return - - def beginFileUpload(self, ): - self.send_beginFileUpload() - return self.recv_beginFileUpload() - - def send_beginFileUpload(self, ): - self._oprot.writeMessageBegin('beginFileUpload', TMessageType.CALL, self._seqid) - args = beginFileUpload_args() - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_beginFileUpload(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() - raise x - result = beginFileUpload_result() - result.read(self._iprot) - self._iprot.readMessageEnd() - if result.success is not None: - return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "beginFileUpload failed: unknown result"); - - def uploadChunk(self, location, chunk): - """ - Parameters: - - location - - chunk - """ - self.send_uploadChunk(location, chunk) - self.recv_uploadChunk() - - def send_uploadChunk(self, location, chunk): - self._oprot.writeMessageBegin('uploadChunk', TMessageType.CALL, self._seqid) - args = uploadChunk_args() - args.location = location - args.chunk = chunk - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_uploadChunk(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() - raise x - result = uploadChunk_result() - result.read(self._iprot) - self._iprot.readMessageEnd() - return - - def finishFileUpload(self, location): - """ - Parameters: - - location - """ - self.send_finishFileUpload(location) - self.recv_finishFileUpload() - - def send_finishFileUpload(self, location): - self._oprot.writeMessageBegin('finishFileUpload', TMessageType.CALL, self._seqid) - args = finishFileUpload_args() - args.location = location - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_finishFileUpload(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() - raise x - result = finishFileUpload_result() - result.read(self._iprot) - self._iprot.readMessageEnd() - return - - def beginFileDownload(self, file): - """ - Parameters: - - file - """ - self.send_beginFileDownload(file) - return self.recv_beginFileDownload() - - def send_beginFileDownload(self, file): - self._oprot.writeMessageBegin('beginFileDownload', TMessageType.CALL, self._seqid) - args = beginFileDownload_args() - args.file = file - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_beginFileDownload(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() - raise x - result = beginFileDownload_result() - result.read(self._iprot) - self._iprot.readMessageEnd() - if result.success is not None: - return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "beginFileDownload failed: unknown result"); - - def downloadChunk(self, id): - """ - Parameters: - - id - """ - self.send_downloadChunk(id) - return self.recv_downloadChunk() - - def send_downloadChunk(self, id): - self._oprot.writeMessageBegin('downloadChunk', TMessageType.CALL, self._seqid) - args = downloadChunk_args() - args.id = id - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_downloadChunk(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() - raise x - result = downloadChunk_result() - result.read(self._iprot) - self._iprot.readMessageEnd() - if result.success is not None: - return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "downloadChunk failed: unknown result"); - - def getClusterInfo(self, ): - self.send_getClusterInfo() - return self.recv_getClusterInfo() - - def send_getClusterInfo(self, ): - self._oprot.writeMessageBegin('getClusterInfo', TMessageType.CALL, self._seqid) - args = getClusterInfo_args() - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_getClusterInfo(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() - raise x - result = getClusterInfo_result() - result.read(self._iprot) - self._iprot.readMessageEnd() - if result.success is not None: - return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "getClusterInfo failed: unknown result"); - - def getTopologyInfo(self, id): - """ - Parameters: - - id - """ - self.send_getTopologyInfo(id) - return self.recv_getTopologyInfo() - - def send_getTopologyInfo(self, id): - self._oprot.writeMessageBegin('getTopologyInfo', TMessageType.CALL, self._seqid) - args = getTopologyInfo_args() - args.id = id - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_getTopologyInfo(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() - raise x - result = getTopologyInfo_result() - result.read(self._iprot) - self._iprot.readMessageEnd() - if result.success is not None: - return result.success - if result.e is not None: - raise result.e - raise TApplicationException(TApplicationException.MISSING_RESULT, "getTopologyInfo failed: unknown result"); - - def getSupervisorWorkers(self, host): - """ - Parameters: - - host - """ - self.send_getSupervisorWorkers(host) - return self.recv_getSupervisorWorkers() - - def send_getSupervisorWorkers(self, host): - self._oprot.writeMessageBegin('getSupervisorWorkers', TMessageType.CALL, self._seqid) - args = getSupervisorWorkers_args() - args.host = host - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_getSupervisorWorkers(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() - raise x - result = getSupervisorWorkers_result() - result.read(self._iprot) - self._iprot.readMessageEnd() - if result.success is not None: - return result.success - if result.e is not None: - raise result.e - raise TApplicationException(TApplicationException.MISSING_RESULT, "getSupervisorWorkers failed: unknown result"); - - def getTopologyConf(self, id): - """ - Parameters: - - id - """ - self.send_getTopologyConf(id) - return self.recv_getTopologyConf() - - def send_getTopologyConf(self, id): - self._oprot.writeMessageBegin('getTopologyConf', TMessageType.CALL, self._seqid) - args = getTopologyConf_args() - args.id = id - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_getTopologyConf(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() - raise x - result = getTopologyConf_result() - result.read(self._iprot) - self._iprot.readMessageEnd() - if result.success is not None: - return result.success - if result.e is not None: - raise result.e - raise TApplicationException(TApplicationException.MISSING_RESULT, "getTopologyConf failed: unknown result"); - - def getTopology(self, id): - """ - Parameters: - - id - """ - self.send_getTopology(id) - return self.recv_getTopology() - - def send_getTopology(self, id): - self._oprot.writeMessageBegin('getTopology', TMessageType.CALL, self._seqid) - args = getTopology_args() - args.id = id - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_getTopology(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() - raise x - result = getTopology_result() - result.read(self._iprot) - self._iprot.readMessageEnd() - if result.success is not None: - return result.success - if result.e is not None: - raise result.e - raise TApplicationException(TApplicationException.MISSING_RESULT, "getTopology failed: unknown result"); - - -class Processor(Iface, TProcessor): - def __init__(self, handler): - self._handler = handler - self._processMap = {} - self._processMap["submitTopology"] = Processor.process_submitTopology - self._processMap["killTopology"] = Processor.process_killTopology - self._processMap["killTopologyWithOpts"] = Processor.process_killTopologyWithOpts - self._processMap["activate"] = Processor.process_activate - self._processMap["deactivate"] = Processor.process_deactivate - self._processMap["rebalance"] = Processor.process_rebalance - self._processMap["beginFileUpload"] = Processor.process_beginFileUpload - self._processMap["uploadChunk"] = Processor.process_uploadChunk - self._processMap["finishFileUpload"] = Processor.process_finishFileUpload - self._processMap["beginFileDownload"] = Processor.process_beginFileDownload - self._processMap["downloadChunk"] = Processor.process_downloadChunk - self._processMap["getClusterInfo"] = Processor.process_getClusterInfo - self._processMap["getTopologyInfo"] = Processor.process_getTopologyInfo - self._processMap["getSupervisorWorkers"] = Processor.process_getSupervisorWorkers - self._processMap["getTopologyConf"] = Processor.process_getTopologyConf - self._processMap["getTopology"] = Processor.process_getTopology - - def process(self, iprot, oprot): - (name, type, seqid) = iprot.readMessageBegin() - if name not in self._processMap: - iprot.skip(TType.STRUCT) - iprot.readMessageEnd() - x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name)) - oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid) - x.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - return - else: - self._processMap[name](self, seqid, iprot, oprot) - return True - - def process_submitTopology(self, seqid, iprot, oprot): - args = submitTopology_args() - args.read(iprot) - iprot.readMessageEnd() - result = submitTopology_result() - try: - self._handler.submitTopology(args.name, args.uploadedJarLocation, args.jsonConf, args.topology) - except AlreadyAliveException, e: - result.e = e - except InvalidTopologyException, ite: - result.ite = ite - oprot.writeMessageBegin("submitTopology", TMessageType.REPLY, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_killTopology(self, seqid, iprot, oprot): - args = killTopology_args() - args.read(iprot) - iprot.readMessageEnd() - result = killTopology_result() - try: - self._handler.killTopology(args.name) - except NotAliveException, e: - result.e = e - oprot.writeMessageBegin("killTopology", TMessageType.REPLY, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_killTopologyWithOpts(self, seqid, iprot, oprot): - args = killTopologyWithOpts_args() - args.read(iprot) - iprot.readMessageEnd() - result = killTopologyWithOpts_result() - try: - self._handler.killTopologyWithOpts(args.name, args.options) - except NotAliveException, e: - result.e = e - oprot.writeMessageBegin("killTopologyWithOpts", TMessageType.REPLY, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_activate(self, seqid, iprot, oprot): - args = activate_args() - args.read(iprot) - iprot.readMessageEnd() - result = activate_result() - try: - self._handler.activate(args.name) - except NotAliveException, e: - result.e = e - oprot.writeMessageBegin("activate", TMessageType.REPLY, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_deactivate(self, seqid, iprot, oprot): - args = deactivate_args() - args.read(iprot) - iprot.readMessageEnd() - result = deactivate_result() - try: - self._handler.deactivate(args.name) - except NotAliveException, e: - result.e = e - oprot.writeMessageBegin("deactivate", TMessageType.REPLY, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_rebalance(self, seqid, iprot, oprot): - args = rebalance_args() - args.read(iprot) - iprot.readMessageEnd() - result = rebalance_result() - try: - self._handler.rebalance(args.name, args.options) - except NotAliveException, e: - result.e = e - oprot.writeMessageBegin("rebalance", TMessageType.REPLY, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_beginFileUpload(self, seqid, iprot, oprot): - args = beginFileUpload_args() - args.read(iprot) - iprot.readMessageEnd() - result = beginFileUpload_result() - result.success = self._handler.beginFileUpload() - oprot.writeMessageBegin("beginFileUpload", TMessageType.REPLY, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_uploadChunk(self, seqid, iprot, oprot): - args = uploadChunk_args() - args.read(iprot) - iprot.readMessageEnd() - result = uploadChunk_result() - self._handler.uploadChunk(args.location, args.chunk) - oprot.writeMessageBegin("uploadChunk", TMessageType.REPLY, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_finishFileUpload(self, seqid, iprot, oprot): - args = finishFileUpload_args() - args.read(iprot) - iprot.readMessageEnd() - result = finishFileUpload_result() - self._handler.finishFileUpload(args.location) - oprot.writeMessageBegin("finishFileUpload", TMessageType.REPLY, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_beginFileDownload(self, seqid, iprot, oprot): - args = beginFileDownload_args() - args.read(iprot) - iprot.readMessageEnd() - result = beginFileDownload_result() - result.success = self._handler.beginFileDownload(args.file) - oprot.writeMessageBegin("beginFileDownload", TMessageType.REPLY, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_downloadChunk(self, seqid, iprot, oprot): - args = downloadChunk_args() - args.read(iprot) - iprot.readMessageEnd() - result = downloadChunk_result() - result.success = self._handler.downloadChunk(args.id) - oprot.writeMessageBegin("downloadChunk", TMessageType.REPLY, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_getClusterInfo(self, seqid, iprot, oprot): - args = getClusterInfo_args() - args.read(iprot) - iprot.readMessageEnd() - result = getClusterInfo_result() - result.success = self._handler.getClusterInfo() - oprot.writeMessageBegin("getClusterInfo", TMessageType.REPLY, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_getTopologyInfo(self, seqid, iprot, oprot): - args = getTopologyInfo_args() - args.read(iprot) - iprot.readMessageEnd() - result = getTopologyInfo_result() - try: - result.success = self._handler.getTopologyInfo(args.id) - except NotAliveException, e: - result.e = e - oprot.writeMessageBegin("getTopologyInfo", TMessageType.REPLY, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_getSupervisorWorkers(self, seqid, iprot, oprot): - args = getSupervisorWorkers_args() - args.read(iprot) - iprot.readMessageEnd() - result = getSupervisorWorkers_result() - try: - result.success = self._handler.getSupervisorWorkers(args.host) - except NotAliveException, e: - result.e = e - oprot.writeMessageBegin("getSupervisorWorkers", TMessageType.REPLY, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_getTopologyConf(self, seqid, iprot, oprot): - args = getTopologyConf_args() - args.read(iprot) - iprot.readMessageEnd() - result = getTopologyConf_result() - try: - result.success = self._handler.getTopologyConf(args.id) - except NotAliveException, e: - result.e = e - oprot.writeMessageBegin("getTopologyConf", TMessageType.REPLY, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_getTopology(self, seqid, iprot, oprot): - args = getTopology_args() - args.read(iprot) - iprot.readMessageEnd() - result = getTopology_result() - try: - result.success = self._handler.getTopology(args.id) - except NotAliveException, e: - result.e = e - oprot.writeMessageBegin("getTopology", TMessageType.REPLY, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - -# HELPER FUNCTIONS AND STRUCTURES - -class submitTopology_args: - """ - Attributes: - - name - - uploadedJarLocation - - jsonConf - - topology - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRING, 'name', None, None, ), # 1 - (2, TType.STRING, 'uploadedJarLocation', None, None, ), # 2 - (3, TType.STRING, 'jsonConf', None, None, ), # 3 - (4, TType.STRUCT, 'topology', (StormTopology, StormTopology.thrift_spec), None, ), # 4 - ) - - def __init__(self, name=None, uploadedJarLocation=None, jsonConf=None, topology=None,): - self.name = name - self.uploadedJarLocation = uploadedJarLocation - self.jsonConf = jsonConf - self.topology = topology - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRING: - self.name = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRING: - self.uploadedJarLocation = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.STRING: - self.jsonConf = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - elif fid == 4: - if ftype == TType.STRUCT: - self.topology = StormTopology() - self.topology.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('submitTopology_args') - if self.name is not None: - oprot.writeFieldBegin('name', TType.STRING, 1) - oprot.writeString(self.name.encode('utf-8')) - oprot.writeFieldEnd() - if self.uploadedJarLocation is not None: - oprot.writeFieldBegin('uploadedJarLocation', TType.STRING, 2) - oprot.writeString(self.uploadedJarLocation.encode('utf-8')) - oprot.writeFieldEnd() - if self.jsonConf is not None: - oprot.writeFieldBegin('jsonConf', TType.STRING, 3) - oprot.writeString(self.jsonConf.encode('utf-8')) - oprot.writeFieldEnd() - if self.topology is not None: - oprot.writeFieldBegin('topology', TType.STRUCT, 4) - self.topology.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class submitTopology_result: - """ - Attributes: - - e - - ite - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'e', (AlreadyAliveException, AlreadyAliveException.thrift_spec), None, ), # 1 - (2, TType.STRUCT, 'ite', (InvalidTopologyException, InvalidTopologyException.thrift_spec), None, ), # 2 - ) - - def __init__(self, e=None, ite=None,): - self.e = e - self.ite = ite - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRUCT: - self.e = AlreadyAliveException() - self.e.read(iprot) - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRUCT: - self.ite = InvalidTopologyException() - self.ite.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('submitTopology_result') - if self.e is not None: - oprot.writeFieldBegin('e', TType.STRUCT, 1) - self.e.write(oprot) - oprot.writeFieldEnd() - if self.ite is not None: - oprot.writeFieldBegin('ite', TType.STRUCT, 2) - self.ite.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class killTopology_args: - """ - Attributes: - - name - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRING, 'name', None, None, ), # 1 - ) - - def __init__(self, name=None,): - self.name = name - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRING: - self.name = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('killTopology_args') - if self.name is not None: - oprot.writeFieldBegin('name', TType.STRING, 1) - oprot.writeString(self.name.encode('utf-8')) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class killTopology_result: - """ - Attributes: - - e - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'e', (NotAliveException, NotAliveException.thrift_spec), None, ), # 1 - ) - - def __init__(self, e=None,): - self.e = e - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRUCT: - self.e = NotAliveException() - self.e.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('killTopology_result') - if self.e is not None: - oprot.writeFieldBegin('e', TType.STRUCT, 1) - self.e.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class killTopologyWithOpts_args: - """ - Attributes: - - name - - options - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRING, 'name', None, None, ), # 1 - (2, TType.STRUCT, 'options', (KillOptions, KillOptions.thrift_spec), None, ), # 2 - ) - - def __init__(self, name=None, options=None,): - self.name = name - self.options = options - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRING: - self.name = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRUCT: - self.options = KillOptions() - self.options.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('killTopologyWithOpts_args') - if self.name is not None: - oprot.writeFieldBegin('name', TType.STRING, 1) - oprot.writeString(self.name.encode('utf-8')) - oprot.writeFieldEnd() - if self.options is not None: - oprot.writeFieldBegin('options', TType.STRUCT, 2) - self.options.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class killTopologyWithOpts_result: - """ - Attributes: - - e - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'e', (NotAliveException, NotAliveException.thrift_spec), None, ), # 1 - ) - - def __init__(self, e=None,): - self.e = e - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRUCT: - self.e = NotAliveException() - self.e.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('killTopologyWithOpts_result') - if self.e is not None: - oprot.writeFieldBegin('e', TType.STRUCT, 1) - self.e.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class activate_args: - """ - Attributes: - - name - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRING, 'name', None, None, ), # 1 - ) - - def __init__(self, name=None,): - self.name = name - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRING: - self.name = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('activate_args') - if self.name is not None: - oprot.writeFieldBegin('name', TType.STRING, 1) - oprot.writeString(self.name.encode('utf-8')) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class activate_result: - """ - Attributes: - - e - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'e', (NotAliveException, NotAliveException.thrift_spec), None, ), # 1 - ) - - def __init__(self, e=None,): - self.e = e - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRUCT: - self.e = NotAliveException() - self.e.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('activate_result') - if self.e is not None: - oprot.writeFieldBegin('e', TType.STRUCT, 1) - self.e.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class deactivate_args: - """ - Attributes: - - name - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRING, 'name', None, None, ), # 1 - ) - - def __init__(self, name=None,): - self.name = name - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRING: - self.name = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('deactivate_args') - if self.name is not None: - oprot.writeFieldBegin('name', TType.STRING, 1) - oprot.writeString(self.name.encode('utf-8')) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class deactivate_result: - """ - Attributes: - - e - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'e', (NotAliveException, NotAliveException.thrift_spec), None, ), # 1 - ) - - def __init__(self, e=None,): - self.e = e - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRUCT: - self.e = NotAliveException() - self.e.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('deactivate_result') - if self.e is not None: - oprot.writeFieldBegin('e', TType.STRUCT, 1) - self.e.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class rebalance_args: - """ - Attributes: - - name - - options - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRING, 'name', None, None, ), # 1 - (2, TType.STRUCT, 'options', (RebalanceOptions, RebalanceOptions.thrift_spec), None, ), # 2 - ) - - def __init__(self, name=None, options=None,): - self.name = name - self.options = options - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRING: - self.name = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRUCT: - self.options = RebalanceOptions() - self.options.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('rebalance_args') - if self.name is not None: - oprot.writeFieldBegin('name', TType.STRING, 1) - oprot.writeString(self.name.encode('utf-8')) - oprot.writeFieldEnd() - if self.options is not None: - oprot.writeFieldBegin('options', TType.STRUCT, 2) - self.options.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class rebalance_result: - """ - Attributes: - - e - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'e', (NotAliveException, NotAliveException.thrift_spec), None, ), # 1 - ) - - def __init__(self, e=None,): - self.e = e - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRUCT: - self.e = NotAliveException() - self.e.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('rebalance_result') - if self.e is not None: - oprot.writeFieldBegin('e', TType.STRUCT, 1) - self.e.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class beginFileUpload_args: - - thrift_spec = ( - ) - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('beginFileUpload_args') - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class beginFileUpload_result: - """ - Attributes: - - success - """ - - thrift_spec = ( - (0, TType.STRING, 'success', None, None, ), # 0 - ) - - def __init__(self, success=None,): - self.success = success - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 0: - if ftype == TType.STRING: - self.success = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('beginFileUpload_result') - if self.success is not None: - oprot.writeFieldBegin('success', TType.STRING, 0) - oprot.writeString(self.success.encode('utf-8')) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class uploadChunk_args: - """ - Attributes: - - location - - chunk - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRING, 'location', None, None, ), # 1 - (2, TType.STRING, 'chunk', None, None, ), # 2 - ) - - def __init__(self, location=None, chunk=None,): - self.location = location - self.chunk = chunk - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRING: - self.location = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRING: - self.chunk = iprot.readString(); - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('uploadChunk_args') - if self.location is not None: - oprot.writeFieldBegin('location', TType.STRING, 1) - oprot.writeString(self.location.encode('utf-8')) - oprot.writeFieldEnd() - if self.chunk is not None: - oprot.writeFieldBegin('chunk', TType.STRING, 2) - oprot.writeString(self.chunk) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class uploadChunk_result: - - thrift_spec = ( - ) - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('uploadChunk_result') - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class finishFileUpload_args: - """ - Attributes: - - location - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRING, 'location', None, None, ), # 1 - ) - - def __init__(self, location=None,): - self.location = location - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRING: - self.location = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('finishFileUpload_args') - if self.location is not None: - oprot.writeFieldBegin('location', TType.STRING, 1) - oprot.writeString(self.location.encode('utf-8')) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class finishFileUpload_result: - - thrift_spec = ( - ) - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('finishFileUpload_result') - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class beginFileDownload_args: - """ - Attributes: - - file - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRING, 'file', None, None, ), # 1 - ) - - def __init__(self, file=None,): - self.file = file - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRING: - self.file = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('beginFileDownload_args') - if self.file is not None: - oprot.writeFieldBegin('file', TType.STRING, 1) - oprot.writeString(self.file.encode('utf-8')) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class beginFileDownload_result: - """ - Attributes: - - success - """ - - thrift_spec = ( - (0, TType.STRING, 'success', None, None, ), # 0 - ) - - def __init__(self, success=None,): - self.success = success - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 0: - if ftype == TType.STRING: - self.success = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('beginFileDownload_result') - if self.success is not None: - oprot.writeFieldBegin('success', TType.STRING, 0) - oprot.writeString(self.success.encode('utf-8')) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class downloadChunk_args: - """ - Attributes: - - id - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRING, 'id', None, None, ), # 1 - ) - - def __init__(self, id=None,): - self.id = id - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRING: - self.id = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('downloadChunk_args') - if self.id is not None: - oprot.writeFieldBegin('id', TType.STRING, 1) - oprot.writeString(self.id.encode('utf-8')) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class downloadChunk_result: - """ - Attributes: - - success - """ - - thrift_spec = ( - (0, TType.STRING, 'success', None, None, ), # 0 - ) - - def __init__(self, success=None,): - self.success = success - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 0: - if ftype == TType.STRING: - self.success = iprot.readString(); - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('downloadChunk_result') - if self.success is not None: - oprot.writeFieldBegin('success', TType.STRING, 0) - oprot.writeString(self.success) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class getClusterInfo_args: - - thrift_spec = ( - ) - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('getClusterInfo_args') - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class getClusterInfo_result: - """ - Attributes: - - success - """ - - thrift_spec = ( - (0, TType.STRUCT, 'success', (ClusterSummary, ClusterSummary.thrift_spec), None, ), # 0 - ) - - def __init__(self, success=None,): - self.success = success - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 0: - if ftype == TType.STRUCT: - self.success = ClusterSummary() - self.success.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('getClusterInfo_result') - if self.success is not None: - oprot.writeFieldBegin('success', TType.STRUCT, 0) - self.success.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class getTopologyInfo_args: - """ - Attributes: - - id - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRING, 'id', None, None, ), # 1 - ) - - def __init__(self, id=None,): - self.id = id - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRING: - self.id = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('getTopologyInfo_args') - if self.id is not None: - oprot.writeFieldBegin('id', TType.STRING, 1) - oprot.writeString(self.id.encode('utf-8')) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class getTopologyInfo_result: - """ - Attributes: - - success - - e - """ - - thrift_spec = ( - (0, TType.STRUCT, 'success', (TopologyInfo, TopologyInfo.thrift_spec), None, ), # 0 - (1, TType.STRUCT, 'e', (NotAliveException, NotAliveException.thrift_spec), None, ), # 1 - ) - - def __init__(self, success=None, e=None,): - self.success = success - self.e = e - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 0: - if ftype == TType.STRUCT: - self.success = TopologyInfo() - self.success.read(iprot) - else: - iprot.skip(ftype) - elif fid == 1: - if ftype == TType.STRUCT: - self.e = NotAliveException() - self.e.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('getTopologyInfo_result') - if self.success is not None: - oprot.writeFieldBegin('success', TType.STRUCT, 0) - self.success.write(oprot) - oprot.writeFieldEnd() - if self.e is not None: - oprot.writeFieldBegin('e', TType.STRUCT, 1) - self.e.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class getSupervisorWorkers_args: - """ - Attributes: - - host - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRING, 'host', None, None, ), # 1 - ) - - def __init__(self, host=None,): - self.host = host - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRING: - self.host = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('getSupervisorWorkers_args') - if self.host is not None: - oprot.writeFieldBegin('host', TType.STRING, 1) - oprot.writeString(self.host.encode('utf-8')) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class getSupervisorWorkers_result: - """ - Attributes: - - success - - e - """ - - thrift_spec = ( - (0, TType.STRUCT, 'success', (SupervisorWorkers, SupervisorWorkers.thrift_spec), None, ), # 0 - (1, TType.STRUCT, 'e', (NotAliveException, NotAliveException.thrift_spec), None, ), # 1 - ) - - def __init__(self, success=None, e=None,): - self.success = success - self.e = e - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 0: - if ftype == TType.STRUCT: - self.success = SupervisorWorkers() - self.success.read(iprot) - else: - iprot.skip(ftype) - elif fid == 1: - if ftype == TType.STRUCT: - self.e = NotAliveException() - self.e.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('getSupervisorWorkers_result') - if self.success is not None: - oprot.writeFieldBegin('success', TType.STRUCT, 0) - self.success.write(oprot) - oprot.writeFieldEnd() - if self.e is not None: - oprot.writeFieldBegin('e', TType.STRUCT, 1) - self.e.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class getTopologyConf_args: - """ - Attributes: - - id - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRING, 'id', None, None, ), # 1 - ) - - def __init__(self, id=None,): - self.id = id - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRING: - self.id = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('getTopologyConf_args') - if self.id is not None: - oprot.writeFieldBegin('id', TType.STRING, 1) - oprot.writeString(self.id.encode('utf-8')) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class getTopologyConf_result: - """ - Attributes: - - success - - e - """ - - thrift_spec = ( - (0, TType.STRING, 'success', None, None, ), # 0 - (1, TType.STRUCT, 'e', (NotAliveException, NotAliveException.thrift_spec), None, ), # 1 - ) - - def __init__(self, success=None, e=None,): - self.success = success - self.e = e - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 0: - if ftype == TType.STRING: - self.success = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - elif fid == 1: - if ftype == TType.STRUCT: - self.e = NotAliveException() - self.e.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('getTopologyConf_result') - if self.success is not None: - oprot.writeFieldBegin('success', TType.STRING, 0) - oprot.writeString(self.success.encode('utf-8')) - oprot.writeFieldEnd() - if self.e is not None: - oprot.writeFieldBegin('e', TType.STRUCT, 1) - self.e.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class getTopology_args: - """ - Attributes: - - id - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRING, 'id', None, None, ), # 1 - ) - - def __init__(self, id=None,): - self.id = id - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRING: - self.id = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('getTopology_args') - if self.id is not None: - oprot.writeFieldBegin('id', TType.STRING, 1) - oprot.writeString(self.id.encode('utf-8')) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class getTopology_result: - """ - Attributes: - - success - - e - """ - - thrift_spec = ( - (0, TType.STRUCT, 'success', (StormTopology, StormTopology.thrift_spec), None, ), # 0 - (1, TType.STRUCT, 'e', (NotAliveException, NotAliveException.thrift_spec), None, ), # 1 - ) - - def __init__(self, success=None, e=None,): - self.success = success - self.e = e - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 0: - if ftype == TType.STRUCT: - self.success = StormTopology() - self.success.read(iprot) - else: - iprot.skip(ftype) - elif fid == 1: - if ftype == TType.STRUCT: - self.e = NotAliveException() - self.e.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('getTopology_result') - if self.success is not None: - oprot.writeFieldBegin('success', TType.STRUCT, 0) - self.success.write(oprot) - oprot.writeFieldEnd() - if self.e is not None: - oprot.writeFieldBegin('e', TType.STRUCT, 1) - self.e.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) +# +# Autogenerated by Thrift Compiler (0.8.0) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# +# options string: py:utf8strings +# + +from thrift.Thrift import TType, TMessageType, TException +from ttypes import * +from thrift.Thrift import TProcessor +from thrift.transport import TTransport +from thrift.protocol import TBinaryProtocol, TProtocol +try: + from thrift.protocol import fastbinary +except: + fastbinary = None + + +class Iface: + def submitTopology(self, name, uploadedJarLocation, jsonConf, topology): + """ + Parameters: + - name + - uploadedJarLocation + - jsonConf + - topology + """ + pass + + def killTopology(self, name): + """ + Parameters: + - name + """ + pass + + def killTopologyWithOpts(self, name, options): + """ + Parameters: + - name + - options + """ + pass + + def activate(self, name): + """ + Parameters: + - name + """ + pass + + def deactivate(self, name): + """ + Parameters: + - name + """ + pass + + def rebalance(self, name, options): + """ + Parameters: + - name + - options + """ + pass + + def beginFileUpload(self, ): + pass + + def uploadChunk(self, location, chunk): + """ + Parameters: + - location + - chunk + """ + pass + + def finishFileUpload(self, location): + """ + Parameters: + - location + """ + pass + + def beginFileDownload(self, file): + """ + Parameters: + - file + """ + pass + + def downloadChunk(self, id): + """ + Parameters: + - id + """ + pass + + def getClusterInfo(self, ): + pass + + def getTopologyInfo(self, id): + """ + Parameters: + - id + """ + pass + + def getSupervisorWorkers(self, host): + """ + Parameters: + - host + """ + pass + + def getTopologyConf(self, id): + """ + Parameters: + - id + """ + pass + + def getTopology(self, id): + """ + Parameters: + - id + """ + pass + + +class Client(Iface): + def __init__(self, iprot, oprot=None): + self._iprot = self._oprot = iprot + if oprot is not None: + self._oprot = oprot + self._seqid = 0 + + def submitTopology(self, name, uploadedJarLocation, jsonConf, topology): + """ + Parameters: + - name + - uploadedJarLocation + - jsonConf + - topology + """ + self.send_submitTopology(name, uploadedJarLocation, jsonConf, topology) + self.recv_submitTopology() + + def send_submitTopology(self, name, uploadedJarLocation, jsonConf, topology): + self._oprot.writeMessageBegin('submitTopology', TMessageType.CALL, self._seqid) + args = submitTopology_args() + args.name = name + args.uploadedJarLocation = uploadedJarLocation + args.jsonConf = jsonConf + args.topology = topology + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_submitTopology(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = submitTopology_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.e is not None: + raise result.e + if result.ite is not None: + raise result.ite + return + + def killTopology(self, name): + """ + Parameters: + - name + """ + self.send_killTopology(name) + self.recv_killTopology() + + def send_killTopology(self, name): + self._oprot.writeMessageBegin('killTopology', TMessageType.CALL, self._seqid) + args = killTopology_args() + args.name = name + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_killTopology(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = killTopology_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.e is not None: + raise result.e + return + + def killTopologyWithOpts(self, name, options): + """ + Parameters: + - name + - options + """ + self.send_killTopologyWithOpts(name, options) + self.recv_killTopologyWithOpts() + + def send_killTopologyWithOpts(self, name, options): + self._oprot.writeMessageBegin('killTopologyWithOpts', TMessageType.CALL, self._seqid) + args = killTopologyWithOpts_args() + args.name = name + args.options = options + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_killTopologyWithOpts(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = killTopologyWithOpts_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.e is not None: + raise result.e + return + + def activate(self, name): + """ + Parameters: + - name + """ + self.send_activate(name) + self.recv_activate() + + def send_activate(self, name): + self._oprot.writeMessageBegin('activate', TMessageType.CALL, self._seqid) + args = activate_args() + args.name = name + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_activate(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = activate_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.e is not None: + raise result.e + return + + def deactivate(self, name): + """ + Parameters: + - name + """ + self.send_deactivate(name) + self.recv_deactivate() + + def send_deactivate(self, name): + self._oprot.writeMessageBegin('deactivate', TMessageType.CALL, self._seqid) + args = deactivate_args() + args.name = name + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_deactivate(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = deactivate_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.e is not None: + raise result.e + return + + def rebalance(self, name, options): + """ + Parameters: + - name + - options + """ + self.send_rebalance(name, options) + self.recv_rebalance() + + def send_rebalance(self, name, options): + self._oprot.writeMessageBegin('rebalance', TMessageType.CALL, self._seqid) + args = rebalance_args() + args.name = name + args.options = options + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_rebalance(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = rebalance_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.e is not None: + raise result.e + return + + def beginFileUpload(self, ): + self.send_beginFileUpload() + return self.recv_beginFileUpload() + + def send_beginFileUpload(self, ): + self._oprot.writeMessageBegin('beginFileUpload', TMessageType.CALL, self._seqid) + args = beginFileUpload_args() + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_beginFileUpload(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = beginFileUpload_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "beginFileUpload failed: unknown result"); + + def uploadChunk(self, location, chunk): + """ + Parameters: + - location + - chunk + """ + self.send_uploadChunk(location, chunk) + self.recv_uploadChunk() + + def send_uploadChunk(self, location, chunk): + self._oprot.writeMessageBegin('uploadChunk', TMessageType.CALL, self._seqid) + args = uploadChunk_args() + args.location = location + args.chunk = chunk + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_uploadChunk(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = uploadChunk_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + return + + def finishFileUpload(self, location): + """ + Parameters: + - location + """ + self.send_finishFileUpload(location) + self.recv_finishFileUpload() + + def send_finishFileUpload(self, location): + self._oprot.writeMessageBegin('finishFileUpload', TMessageType.CALL, self._seqid) + args = finishFileUpload_args() + args.location = location + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_finishFileUpload(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = finishFileUpload_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + return + + def beginFileDownload(self, file): + """ + Parameters: + - file + """ + self.send_beginFileDownload(file) + return self.recv_beginFileDownload() + + def send_beginFileDownload(self, file): + self._oprot.writeMessageBegin('beginFileDownload', TMessageType.CALL, self._seqid) + args = beginFileDownload_args() + args.file = file + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_beginFileDownload(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = beginFileDownload_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "beginFileDownload failed: unknown result"); + + def downloadChunk(self, id): + """ + Parameters: + - id + """ + self.send_downloadChunk(id) + return self.recv_downloadChunk() + + def send_downloadChunk(self, id): + self._oprot.writeMessageBegin('downloadChunk', TMessageType.CALL, self._seqid) + args = downloadChunk_args() + args.id = id + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_downloadChunk(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = downloadChunk_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "downloadChunk failed: unknown result"); + + def getClusterInfo(self, ): + self.send_getClusterInfo() + return self.recv_getClusterInfo() + + def send_getClusterInfo(self, ): + self._oprot.writeMessageBegin('getClusterInfo', TMessageType.CALL, self._seqid) + args = getClusterInfo_args() + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_getClusterInfo(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = getClusterInfo_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "getClusterInfo failed: unknown result"); + + def getTopologyInfo(self, id): + """ + Parameters: + - id + """ + self.send_getTopologyInfo(id) + return self.recv_getTopologyInfo() + + def send_getTopologyInfo(self, id): + self._oprot.writeMessageBegin('getTopologyInfo', TMessageType.CALL, self._seqid) + args = getTopologyInfo_args() + args.id = id + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_getTopologyInfo(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = getTopologyInfo_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.e is not None: + raise result.e + raise TApplicationException(TApplicationException.MISSING_RESULT, "getTopologyInfo failed: unknown result"); + + def getSupervisorWorkers(self, host): + """ + Parameters: + - host + """ + self.send_getSupervisorWorkers(host) + return self.recv_getSupervisorWorkers() + + def send_getSupervisorWorkers(self, host): + self._oprot.writeMessageBegin('getSupervisorWorkers', TMessageType.CALL, self._seqid) + args = getSupervisorWorkers_args() + args.host = host + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_getSupervisorWorkers(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = getSupervisorWorkers_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.e is not None: + raise result.e + raise TApplicationException(TApplicationException.MISSING_RESULT, "getSupervisorWorkers failed: unknown result"); + + def getTopologyConf(self, id): + """ + Parameters: + - id + """ + self.send_getTopologyConf(id) + return self.recv_getTopologyConf() + + def send_getTopologyConf(self, id): + self._oprot.writeMessageBegin('getTopologyConf', TMessageType.CALL, self._seqid) + args = getTopologyConf_args() + args.id = id + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_getTopologyConf(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = getTopologyConf_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.e is not None: + raise result.e + raise TApplicationException(TApplicationException.MISSING_RESULT, "getTopologyConf failed: unknown result"); + + def getTopology(self, id): + """ + Parameters: + - id + """ + self.send_getTopology(id) + return self.recv_getTopology() + + def send_getTopology(self, id): + self._oprot.writeMessageBegin('getTopology', TMessageType.CALL, self._seqid) + args = getTopology_args() + args.id = id + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_getTopology(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = getTopology_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.e is not None: + raise result.e + raise TApplicationException(TApplicationException.MISSING_RESULT, "getTopology failed: unknown result"); + + +class Processor(Iface, TProcessor): + def __init__(self, handler): + self._handler = handler + self._processMap = {} + self._processMap["submitTopology"] = Processor.process_submitTopology + self._processMap["killTopology"] = Processor.process_killTopology + self._processMap["killTopologyWithOpts"] = Processor.process_killTopologyWithOpts + self._processMap["activate"] = Processor.process_activate + self._processMap["deactivate"] = Processor.process_deactivate + self._processMap["rebalance"] = Processor.process_rebalance + self._processMap["beginFileUpload"] = Processor.process_beginFileUpload + self._processMap["uploadChunk"] = Processor.process_uploadChunk + self._processMap["finishFileUpload"] = Processor.process_finishFileUpload + self._processMap["beginFileDownload"] = Processor.process_beginFileDownload + self._processMap["downloadChunk"] = Processor.process_downloadChunk + self._processMap["getClusterInfo"] = Processor.process_getClusterInfo + self._processMap["getTopologyInfo"] = Processor.process_getTopologyInfo + self._processMap["getSupervisorWorkers"] = Processor.process_getSupervisorWorkers + self._processMap["getTopologyConf"] = Processor.process_getTopologyConf + self._processMap["getTopology"] = Processor.process_getTopology + + def process(self, iprot, oprot): + (name, type, seqid) = iprot.readMessageBegin() + if name not in self._processMap: + iprot.skip(TType.STRUCT) + iprot.readMessageEnd() + x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name)) + oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid) + x.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + return + else: + self._processMap[name](self, seqid, iprot, oprot) + return True + + def process_submitTopology(self, seqid, iprot, oprot): + args = submitTopology_args() + args.read(iprot) + iprot.readMessageEnd() + result = submitTopology_result() + try: + self._handler.submitTopology(args.name, args.uploadedJarLocation, args.jsonConf, args.topology) + except AlreadyAliveException, e: + result.e = e + except InvalidTopologyException, ite: + result.ite = ite + oprot.writeMessageBegin("submitTopology", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_killTopology(self, seqid, iprot, oprot): + args = killTopology_args() + args.read(iprot) + iprot.readMessageEnd() + result = killTopology_result() + try: + self._handler.killTopology(args.name) + except NotAliveException, e: + result.e = e + oprot.writeMessageBegin("killTopology", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_killTopologyWithOpts(self, seqid, iprot, oprot): + args = killTopologyWithOpts_args() + args.read(iprot) + iprot.readMessageEnd() + result = killTopologyWithOpts_result() + try: + self._handler.killTopologyWithOpts(args.name, args.options) + except NotAliveException, e: + result.e = e + oprot.writeMessageBegin("killTopologyWithOpts", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_activate(self, seqid, iprot, oprot): + args = activate_args() + args.read(iprot) + iprot.readMessageEnd() + result = activate_result() + try: + self._handler.activate(args.name) + except NotAliveException, e: + result.e = e + oprot.writeMessageBegin("activate", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_deactivate(self, seqid, iprot, oprot): + args = deactivate_args() + args.read(iprot) + iprot.readMessageEnd() + result = deactivate_result() + try: + self._handler.deactivate(args.name) + except NotAliveException, e: + result.e = e + oprot.writeMessageBegin("deactivate", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_rebalance(self, seqid, iprot, oprot): + args = rebalance_args() + args.read(iprot) + iprot.readMessageEnd() + result = rebalance_result() + try: + self._handler.rebalance(args.name, args.options) + except NotAliveException, e: + result.e = e + oprot.writeMessageBegin("rebalance", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_beginFileUpload(self, seqid, iprot, oprot): + args = beginFileUpload_args() + args.read(iprot) + iprot.readMessageEnd() + result = beginFileUpload_result() + result.success = self._handler.beginFileUpload() + oprot.writeMessageBegin("beginFileUpload", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_uploadChunk(self, seqid, iprot, oprot): + args = uploadChunk_args() + args.read(iprot) + iprot.readMessageEnd() + result = uploadChunk_result() + self._handler.uploadChunk(args.location, args.chunk) + oprot.writeMessageBegin("uploadChunk", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_finishFileUpload(self, seqid, iprot, oprot): + args = finishFileUpload_args() + args.read(iprot) + iprot.readMessageEnd() + result = finishFileUpload_result() + self._handler.finishFileUpload(args.location) + oprot.writeMessageBegin("finishFileUpload", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_beginFileDownload(self, seqid, iprot, oprot): + args = beginFileDownload_args() + args.read(iprot) + iprot.readMessageEnd() + result = beginFileDownload_result() + result.success = self._handler.beginFileDownload(args.file) + oprot.writeMessageBegin("beginFileDownload", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_downloadChunk(self, seqid, iprot, oprot): + args = downloadChunk_args() + args.read(iprot) + iprot.readMessageEnd() + result = downloadChunk_result() + result.success = self._handler.downloadChunk(args.id) + oprot.writeMessageBegin("downloadChunk", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_getClusterInfo(self, seqid, iprot, oprot): + args = getClusterInfo_args() + args.read(iprot) + iprot.readMessageEnd() + result = getClusterInfo_result() + result.success = self._handler.getClusterInfo() + oprot.writeMessageBegin("getClusterInfo", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_getTopologyInfo(self, seqid, iprot, oprot): + args = getTopologyInfo_args() + args.read(iprot) + iprot.readMessageEnd() + result = getTopologyInfo_result() + try: + result.success = self._handler.getTopologyInfo(args.id) + except NotAliveException, e: + result.e = e + oprot.writeMessageBegin("getTopologyInfo", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_getSupervisorWorkers(self, seqid, iprot, oprot): + args = getSupervisorWorkers_args() + args.read(iprot) + iprot.readMessageEnd() + result = getSupervisorWorkers_result() + try: + result.success = self._handler.getSupervisorWorkers(args.host) + except NotAliveException, e: + result.e = e + oprot.writeMessageBegin("getSupervisorWorkers", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_getTopologyConf(self, seqid, iprot, oprot): + args = getTopologyConf_args() + args.read(iprot) + iprot.readMessageEnd() + result = getTopologyConf_result() + try: + result.success = self._handler.getTopologyConf(args.id) + except NotAliveException, e: + result.e = e + oprot.writeMessageBegin("getTopologyConf", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_getTopology(self, seqid, iprot, oprot): + args = getTopology_args() + args.read(iprot) + iprot.readMessageEnd() + result = getTopology_result() + try: + result.success = self._handler.getTopology(args.id) + except NotAliveException, e: + result.e = e + oprot.writeMessageBegin("getTopology", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + +# HELPER FUNCTIONS AND STRUCTURES + +class submitTopology_args: + """ + Attributes: + - name + - uploadedJarLocation + - jsonConf + - topology + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'name', None, None, ), # 1 + (2, TType.STRING, 'uploadedJarLocation', None, None, ), # 2 + (3, TType.STRING, 'jsonConf', None, None, ), # 3 + (4, TType.STRUCT, 'topology', (StormTopology, StormTopology.thrift_spec), None, ), # 4 + ) + + def __init__(self, name=None, uploadedJarLocation=None, jsonConf=None, topology=None,): + self.name = name + self.uploadedJarLocation = uploadedJarLocation + self.jsonConf = jsonConf + self.topology = topology + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.name = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.uploadedJarLocation = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.jsonConf = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRUCT: + self.topology = StormTopology() + self.topology.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('submitTopology_args') + if self.name is not None: + oprot.writeFieldBegin('name', TType.STRING, 1) + oprot.writeString(self.name.encode('utf-8')) + oprot.writeFieldEnd() + if self.uploadedJarLocation is not None: + oprot.writeFieldBegin('uploadedJarLocation', TType.STRING, 2) + oprot.writeString(self.uploadedJarLocation.encode('utf-8')) + oprot.writeFieldEnd() + if self.jsonConf is not None: + oprot.writeFieldBegin('jsonConf', TType.STRING, 3) + oprot.writeString(self.jsonConf.encode('utf-8')) + oprot.writeFieldEnd() + if self.topology is not None: + oprot.writeFieldBegin('topology', TType.STRUCT, 4) + self.topology.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class submitTopology_result: + """ + Attributes: + - e + - ite + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'e', (AlreadyAliveException, AlreadyAliveException.thrift_spec), None, ), # 1 + (2, TType.STRUCT, 'ite', (InvalidTopologyException, InvalidTopologyException.thrift_spec), None, ), # 2 + ) + + def __init__(self, e=None, ite=None,): + self.e = e + self.ite = ite + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRUCT: + self.e = AlreadyAliveException() + self.e.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.ite = InvalidTopologyException() + self.ite.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('submitTopology_result') + if self.e is not None: + oprot.writeFieldBegin('e', TType.STRUCT, 1) + self.e.write(oprot) + oprot.writeFieldEnd() + if self.ite is not None: + oprot.writeFieldBegin('ite', TType.STRUCT, 2) + self.ite.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class killTopology_args: + """ + Attributes: + - name + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'name', None, None, ), # 1 + ) + + def __init__(self, name=None,): + self.name = name + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.name = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('killTopology_args') + if self.name is not None: + oprot.writeFieldBegin('name', TType.STRING, 1) + oprot.writeString(self.name.encode('utf-8')) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class killTopology_result: + """ + Attributes: + - e + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'e', (NotAliveException, NotAliveException.thrift_spec), None, ), # 1 + ) + + def __init__(self, e=None,): + self.e = e + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRUCT: + self.e = NotAliveException() + self.e.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('killTopology_result') + if self.e is not None: + oprot.writeFieldBegin('e', TType.STRUCT, 1) + self.e.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class killTopologyWithOpts_args: + """ + Attributes: + - name + - options + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'name', None, None, ), # 1 + (2, TType.STRUCT, 'options', (KillOptions, KillOptions.thrift_spec), None, ), # 2 + ) + + def __init__(self, name=None, options=None,): + self.name = name + self.options = options + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.name = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.options = KillOptions() + self.options.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('killTopologyWithOpts_args') + if self.name is not None: + oprot.writeFieldBegin('name', TType.STRING, 1) + oprot.writeString(self.name.encode('utf-8')) + oprot.writeFieldEnd() + if self.options is not None: + oprot.writeFieldBegin('options', TType.STRUCT, 2) + self.options.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class killTopologyWithOpts_result: + """ + Attributes: + - e + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'e', (NotAliveException, NotAliveException.thrift_spec), None, ), # 1 + ) + + def __init__(self, e=None,): + self.e = e + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRUCT: + self.e = NotAliveException() + self.e.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('killTopologyWithOpts_result') + if self.e is not None: + oprot.writeFieldBegin('e', TType.STRUCT, 1) + self.e.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class activate_args: + """ + Attributes: + - name + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'name', None, None, ), # 1 + ) + + def __init__(self, name=None,): + self.name = name + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.name = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('activate_args') + if self.name is not None: + oprot.writeFieldBegin('name', TType.STRING, 1) + oprot.writeString(self.name.encode('utf-8')) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class activate_result: + """ + Attributes: + - e + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'e', (NotAliveException, NotAliveException.thrift_spec), None, ), # 1 + ) + + def __init__(self, e=None,): + self.e = e + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRUCT: + self.e = NotAliveException() + self.e.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('activate_result') + if self.e is not None: + oprot.writeFieldBegin('e', TType.STRUCT, 1) + self.e.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class deactivate_args: + """ + Attributes: + - name + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'name', None, None, ), # 1 + ) + + def __init__(self, name=None,): + self.name = name + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.name = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('deactivate_args') + if self.name is not None: + oprot.writeFieldBegin('name', TType.STRING, 1) + oprot.writeString(self.name.encode('utf-8')) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class deactivate_result: + """ + Attributes: + - e + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'e', (NotAliveException, NotAliveException.thrift_spec), None, ), # 1 + ) + + def __init__(self, e=None,): + self.e = e + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRUCT: + self.e = NotAliveException() + self.e.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('deactivate_result') + if self.e is not None: + oprot.writeFieldBegin('e', TType.STRUCT, 1) + self.e.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class rebalance_args: + """ + Attributes: + - name + - options + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'name', None, None, ), # 1 + (2, TType.STRUCT, 'options', (RebalanceOptions, RebalanceOptions.thrift_spec), None, ), # 2 + ) + + def __init__(self, name=None, options=None,): + self.name = name + self.options = options + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.name = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.options = RebalanceOptions() + self.options.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('rebalance_args') + if self.name is not None: + oprot.writeFieldBegin('name', TType.STRING, 1) + oprot.writeString(self.name.encode('utf-8')) + oprot.writeFieldEnd() + if self.options is not None: + oprot.writeFieldBegin('options', TType.STRUCT, 2) + self.options.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class rebalance_result: + """ + Attributes: + - e + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'e', (NotAliveException, NotAliveException.thrift_spec), None, ), # 1 + ) + + def __init__(self, e=None,): + self.e = e + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRUCT: + self.e = NotAliveException() + self.e.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('rebalance_result') + if self.e is not None: + oprot.writeFieldBegin('e', TType.STRUCT, 1) + self.e.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class beginFileUpload_args: + + thrift_spec = ( + ) + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('beginFileUpload_args') + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class beginFileUpload_result: + """ + Attributes: + - success + """ + + thrift_spec = ( + (0, TType.STRING, 'success', None, None, ), # 0 + ) + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.STRING: + self.success = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('beginFileUpload_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.STRING, 0) + oprot.writeString(self.success.encode('utf-8')) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class uploadChunk_args: + """ + Attributes: + - location + - chunk + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'location', None, None, ), # 1 + (2, TType.STRING, 'chunk', None, None, ), # 2 + ) + + def __init__(self, location=None, chunk=None,): + self.location = location + self.chunk = chunk + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.location = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.chunk = iprot.readString(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('uploadChunk_args') + if self.location is not None: + oprot.writeFieldBegin('location', TType.STRING, 1) + oprot.writeString(self.location.encode('utf-8')) + oprot.writeFieldEnd() + if self.chunk is not None: + oprot.writeFieldBegin('chunk', TType.STRING, 2) + oprot.writeString(self.chunk) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class uploadChunk_result: + + thrift_spec = ( + ) + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('uploadChunk_result') + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class finishFileUpload_args: + """ + Attributes: + - location + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'location', None, None, ), # 1 + ) + + def __init__(self, location=None,): + self.location = location + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.location = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('finishFileUpload_args') + if self.location is not None: + oprot.writeFieldBegin('location', TType.STRING, 1) + oprot.writeString(self.location.encode('utf-8')) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class finishFileUpload_result: + + thrift_spec = ( + ) + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('finishFileUpload_result') + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class beginFileDownload_args: + """ + Attributes: + - file + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'file', None, None, ), # 1 + ) + + def __init__(self, file=None,): + self.file = file + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.file = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('beginFileDownload_args') + if self.file is not None: + oprot.writeFieldBegin('file', TType.STRING, 1) + oprot.writeString(self.file.encode('utf-8')) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class beginFileDownload_result: + """ + Attributes: + - success + """ + + thrift_spec = ( + (0, TType.STRING, 'success', None, None, ), # 0 + ) + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.STRING: + self.success = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('beginFileDownload_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.STRING, 0) + oprot.writeString(self.success.encode('utf-8')) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class downloadChunk_args: + """ + Attributes: + - id + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'id', None, None, ), # 1 + ) + + def __init__(self, id=None,): + self.id = id + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.id = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('downloadChunk_args') + if self.id is not None: + oprot.writeFieldBegin('id', TType.STRING, 1) + oprot.writeString(self.id.encode('utf-8')) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class downloadChunk_result: + """ + Attributes: + - success + """ + + thrift_spec = ( + (0, TType.STRING, 'success', None, None, ), # 0 + ) + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.STRING: + self.success = iprot.readString(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('downloadChunk_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.STRING, 0) + oprot.writeString(self.success) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getClusterInfo_args: + + thrift_spec = ( + ) + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getClusterInfo_args') + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getClusterInfo_result: + """ + Attributes: + - success + """ + + thrift_spec = ( + (0, TType.STRUCT, 'success', (ClusterSummary, ClusterSummary.thrift_spec), None, ), # 0 + ) + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.STRUCT: + self.success = ClusterSummary() + self.success.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getClusterInfo_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.STRUCT, 0) + self.success.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getTopologyInfo_args: + """ + Attributes: + - id + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'id', None, None, ), # 1 + ) + + def __init__(self, id=None,): + self.id = id + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.id = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getTopologyInfo_args') + if self.id is not None: + oprot.writeFieldBegin('id', TType.STRING, 1) + oprot.writeString(self.id.encode('utf-8')) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getTopologyInfo_result: + """ + Attributes: + - success + - e + """ + + thrift_spec = ( + (0, TType.STRUCT, 'success', (TopologyInfo, TopologyInfo.thrift_spec), None, ), # 0 + (1, TType.STRUCT, 'e', (NotAliveException, NotAliveException.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, e=None,): + self.success = success + self.e = e + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.STRUCT: + self.success = TopologyInfo() + self.success.read(iprot) + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.e = NotAliveException() + self.e.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getTopologyInfo_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.STRUCT, 0) + self.success.write(oprot) + oprot.writeFieldEnd() + if self.e is not None: + oprot.writeFieldBegin('e', TType.STRUCT, 1) + self.e.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getSupervisorWorkers_args: + """ + Attributes: + - host + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'host', None, None, ), # 1 + ) + + def __init__(self, host=None,): + self.host = host + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.host = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getSupervisorWorkers_args') + if self.host is not None: + oprot.writeFieldBegin('host', TType.STRING, 1) + oprot.writeString(self.host.encode('utf-8')) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getSupervisorWorkers_result: + """ + Attributes: + - success + - e + """ + + thrift_spec = ( + (0, TType.STRUCT, 'success', (SupervisorWorkers, SupervisorWorkers.thrift_spec), None, ), # 0 + (1, TType.STRUCT, 'e', (NotAliveException, NotAliveException.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, e=None,): + self.success = success + self.e = e + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.STRUCT: + self.success = SupervisorWorkers() + self.success.read(iprot) + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.e = NotAliveException() + self.e.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getSupervisorWorkers_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.STRUCT, 0) + self.success.write(oprot) + oprot.writeFieldEnd() + if self.e is not None: + oprot.writeFieldBegin('e', TType.STRUCT, 1) + self.e.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getTopologyConf_args: + """ + Attributes: + - id + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'id', None, None, ), # 1 + ) + + def __init__(self, id=None,): + self.id = id + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.id = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getTopologyConf_args') + if self.id is not None: + oprot.writeFieldBegin('id', TType.STRING, 1) + oprot.writeString(self.id.encode('utf-8')) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getTopologyConf_result: + """ + Attributes: + - success + - e + """ + + thrift_spec = ( + (0, TType.STRING, 'success', None, None, ), # 0 + (1, TType.STRUCT, 'e', (NotAliveException, NotAliveException.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, e=None,): + self.success = success + self.e = e + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.STRING: + self.success = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.e = NotAliveException() + self.e.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getTopologyConf_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.STRING, 0) + oprot.writeString(self.success.encode('utf-8')) + oprot.writeFieldEnd() + if self.e is not None: + oprot.writeFieldBegin('e', TType.STRUCT, 1) + self.e.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getTopology_args: + """ + Attributes: + - id + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'id', None, None, ), # 1 + ) + + def __init__(self, id=None,): + self.id = id + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.id = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getTopology_args') + if self.id is not None: + oprot.writeFieldBegin('id', TType.STRING, 1) + oprot.writeString(self.id.encode('utf-8')) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getTopology_result: + """ + Attributes: + - success + - e + """ + + thrift_spec = ( + (0, TType.STRUCT, 'success', (StormTopology, StormTopology.thrift_spec), None, ), # 0 + (1, TType.STRUCT, 'e', (NotAliveException, NotAliveException.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, e=None,): + self.success = success + self.e = e + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.STRUCT: + self.success = StormTopology() + self.success.read(iprot) + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.e = NotAliveException() + self.e.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getTopology_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.STRUCT, 0) + self.success.write(oprot) + oprot.writeFieldEnd() + if self.e is not None: + oprot.writeFieldBegin('e', TType.STRUCT, 1) + self.e.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) diff --git a/jstorm-client/src/main/py/storm/__init__.py b/jstorm-client/src/main/py/storm/__init__.py index 10e7d4051..22144a94e 100644 --- a/jstorm-client/src/main/py/storm/__init__.py +++ b/jstorm-client/src/main/py/storm/__init__.py @@ -1 +1 @@ -__all__ = ['ttypes', 'constants', 'Nimbus', 'DistributedRPC', 'DistributedRPCInvocations'] +__all__ = ['ttypes', 'constants', 'Nimbus', 'DistributedRPC', 'DistributedRPCInvocations'] diff --git a/jstorm-client/src/main/py/storm/constants.py b/jstorm-client/src/main/py/storm/constants.py index 732b3680d..1a5599647 100644 --- a/jstorm-client/src/main/py/storm/constants.py +++ b/jstorm-client/src/main/py/storm/constants.py @@ -1,9 +1,11 @@ -# -# Autogenerated by Thrift Compiler (0.7.0) -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# - -from thrift.Thrift import * -from ttypes import * - +# +# Autogenerated by Thrift Compiler (0.8.0) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# +# options string: py:utf8strings +# + +from thrift.Thrift import TType, TMessageType, TException +from ttypes import * + diff --git a/jstorm-client/src/main/py/storm/ttypes.py b/jstorm-client/src/main/py/storm/ttypes.py index bec9f1e22..5546b11b0 100644 --- a/jstorm-client/src/main/py/storm/ttypes.py +++ b/jstorm-client/src/main/py/storm/ttypes.py @@ -1,2817 +1,2819 @@ -# -# Autogenerated by Thrift Compiler (0.7.0) -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# - -from thrift.Thrift import * - -from thrift.transport import TTransport -from thrift.protocol import TBinaryProtocol, TProtocol -try: - from thrift.protocol import fastbinary -except: - fastbinary = None - - - -class JavaObjectArg: - """ - Attributes: - - int_arg - - long_arg - - string_arg - - bool_arg - - binary_arg - - double_arg - """ - - thrift_spec = ( - None, # 0 - (1, TType.I32, 'int_arg', None, None, ), # 1 - (2, TType.I64, 'long_arg', None, None, ), # 2 - (3, TType.STRING, 'string_arg', None, None, ), # 3 - (4, TType.BOOL, 'bool_arg', None, None, ), # 4 - (5, TType.STRING, 'binary_arg', None, None, ), # 5 - (6, TType.DOUBLE, 'double_arg', None, None, ), # 6 - ) - - def __init__(self, int_arg=None, long_arg=None, string_arg=None, bool_arg=None, binary_arg=None, double_arg=None,): - self.int_arg = int_arg - self.long_arg = long_arg - self.string_arg = string_arg - self.bool_arg = bool_arg - self.binary_arg = binary_arg - self.double_arg = double_arg - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.I32: - self.int_arg = iprot.readI32(); - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.I64: - self.long_arg = iprot.readI64(); - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.STRING: - self.string_arg = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - elif fid == 4: - if ftype == TType.BOOL: - self.bool_arg = iprot.readBool(); - else: - iprot.skip(ftype) - elif fid == 5: - if ftype == TType.STRING: - self.binary_arg = iprot.readString(); - else: - iprot.skip(ftype) - elif fid == 6: - if ftype == TType.DOUBLE: - self.double_arg = iprot.readDouble(); - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('JavaObjectArg') - if self.int_arg is not None: - oprot.writeFieldBegin('int_arg', TType.I32, 1) - oprot.writeI32(self.int_arg) - oprot.writeFieldEnd() - if self.long_arg is not None: - oprot.writeFieldBegin('long_arg', TType.I64, 2) - oprot.writeI64(self.long_arg) - oprot.writeFieldEnd() - if self.string_arg is not None: - oprot.writeFieldBegin('string_arg', TType.STRING, 3) - oprot.writeString(self.string_arg.encode('utf-8')) - oprot.writeFieldEnd() - if self.bool_arg is not None: - oprot.writeFieldBegin('bool_arg', TType.BOOL, 4) - oprot.writeBool(self.bool_arg) - oprot.writeFieldEnd() - if self.binary_arg is not None: - oprot.writeFieldBegin('binary_arg', TType.STRING, 5) - oprot.writeString(self.binary_arg) - oprot.writeFieldEnd() - if self.double_arg is not None: - oprot.writeFieldBegin('double_arg', TType.DOUBLE, 6) - oprot.writeDouble(self.double_arg) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class JavaObject: - """ - Attributes: - - full_class_name - - args_list - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRING, 'full_class_name', None, None, ), # 1 - (2, TType.LIST, 'args_list', (TType.STRUCT,(JavaObjectArg, JavaObjectArg.thrift_spec)), None, ), # 2 - ) - - def __init__(self, full_class_name=None, args_list=None,): - self.full_class_name = full_class_name - self.args_list = args_list - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRING: - self.full_class_name = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.LIST: - self.args_list = [] - (_etype3, _size0) = iprot.readListBegin() - for _i4 in xrange(_size0): - _elem5 = JavaObjectArg() - _elem5.read(iprot) - self.args_list.append(_elem5) - iprot.readListEnd() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('JavaObject') - if self.full_class_name is not None: - oprot.writeFieldBegin('full_class_name', TType.STRING, 1) - oprot.writeString(self.full_class_name.encode('utf-8')) - oprot.writeFieldEnd() - if self.args_list is not None: - oprot.writeFieldBegin('args_list', TType.LIST, 2) - oprot.writeListBegin(TType.STRUCT, len(self.args_list)) - for iter6 in self.args_list: - iter6.write(oprot) - oprot.writeListEnd() - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.full_class_name is None: - raise TProtocol.TProtocolException(message='Required field full_class_name is unset!') - if self.args_list is None: - raise TProtocol.TProtocolException(message='Required field args_list is unset!') - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class NullStruct: - - thrift_spec = ( - ) - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('NullStruct') - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class GlobalStreamId: - """ - Attributes: - - componentId - - streamId - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRING, 'componentId', None, None, ), # 1 - (2, TType.STRING, 'streamId', None, None, ), # 2 - ) - - def __init__(self, componentId=None, streamId=None,): - self.componentId = componentId - self.streamId = streamId - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRING: - self.componentId = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRING: - self.streamId = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('GlobalStreamId') - if self.componentId is not None: - oprot.writeFieldBegin('componentId', TType.STRING, 1) - oprot.writeString(self.componentId.encode('utf-8')) - oprot.writeFieldEnd() - if self.streamId is not None: - oprot.writeFieldBegin('streamId', TType.STRING, 2) - oprot.writeString(self.streamId.encode('utf-8')) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.componentId is None: - raise TProtocol.TProtocolException(message='Required field componentId is unset!') - if self.streamId is None: - raise TProtocol.TProtocolException(message='Required field streamId is unset!') - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class Grouping: - """ - Attributes: - - fields - - shuffle - - all - - none - - direct - - custom_object - - custom_serialized - - local_or_shuffle - """ - - thrift_spec = ( - None, # 0 - (1, TType.LIST, 'fields', (TType.STRING,None), None, ), # 1 - (2, TType.STRUCT, 'shuffle', (NullStruct, NullStruct.thrift_spec), None, ), # 2 - (3, TType.STRUCT, 'all', (NullStruct, NullStruct.thrift_spec), None, ), # 3 - (4, TType.STRUCT, 'none', (NullStruct, NullStruct.thrift_spec), None, ), # 4 - (5, TType.STRUCT, 'direct', (NullStruct, NullStruct.thrift_spec), None, ), # 5 - (6, TType.STRUCT, 'custom_object', (JavaObject, JavaObject.thrift_spec), None, ), # 6 - (7, TType.STRING, 'custom_serialized', None, None, ), # 7 - (8, TType.STRUCT, 'local_or_shuffle', (NullStruct, NullStruct.thrift_spec), None, ), # 8 - ) - - def __init__(self, fields=None, shuffle=None, all=None, none=None, direct=None, custom_object=None, custom_serialized=None, local_or_shuffle=None,): - self.fields = fields - self.shuffle = shuffle - self.all = all - self.none = none - self.direct = direct - self.custom_object = custom_object - self.custom_serialized = custom_serialized - self.local_or_shuffle = local_or_shuffle - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.LIST: - self.fields = [] - (_etype10, _size7) = iprot.readListBegin() - for _i11 in xrange(_size7): - _elem12 = iprot.readString().decode('utf-8') - self.fields.append(_elem12) - iprot.readListEnd() - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRUCT: - self.shuffle = NullStruct() - self.shuffle.read(iprot) - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.STRUCT: - self.all = NullStruct() - self.all.read(iprot) - else: - iprot.skip(ftype) - elif fid == 4: - if ftype == TType.STRUCT: - self.none = NullStruct() - self.none.read(iprot) - else: - iprot.skip(ftype) - elif fid == 5: - if ftype == TType.STRUCT: - self.direct = NullStruct() - self.direct.read(iprot) - else: - iprot.skip(ftype) - elif fid == 6: - if ftype == TType.STRUCT: - self.custom_object = JavaObject() - self.custom_object.read(iprot) - else: - iprot.skip(ftype) - elif fid == 7: - if ftype == TType.STRING: - self.custom_serialized = iprot.readString(); - else: - iprot.skip(ftype) - elif fid == 8: - if ftype == TType.STRUCT: - self.local_or_shuffle = NullStruct() - self.local_or_shuffle.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('Grouping') - if self.fields is not None: - oprot.writeFieldBegin('fields', TType.LIST, 1) - oprot.writeListBegin(TType.STRING, len(self.fields)) - for iter13 in self.fields: - oprot.writeString(iter13.encode('utf-8')) - oprot.writeListEnd() - oprot.writeFieldEnd() - if self.shuffle is not None: - oprot.writeFieldBegin('shuffle', TType.STRUCT, 2) - self.shuffle.write(oprot) - oprot.writeFieldEnd() - if self.all is not None: - oprot.writeFieldBegin('all', TType.STRUCT, 3) - self.all.write(oprot) - oprot.writeFieldEnd() - if self.none is not None: - oprot.writeFieldBegin('none', TType.STRUCT, 4) - self.none.write(oprot) - oprot.writeFieldEnd() - if self.direct is not None: - oprot.writeFieldBegin('direct', TType.STRUCT, 5) - self.direct.write(oprot) - oprot.writeFieldEnd() - if self.custom_object is not None: - oprot.writeFieldBegin('custom_object', TType.STRUCT, 6) - self.custom_object.write(oprot) - oprot.writeFieldEnd() - if self.custom_serialized is not None: - oprot.writeFieldBegin('custom_serialized', TType.STRING, 7) - oprot.writeString(self.custom_serialized) - oprot.writeFieldEnd() - if self.local_or_shuffle is not None: - oprot.writeFieldBegin('local_or_shuffle', TType.STRUCT, 8) - self.local_or_shuffle.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class StreamInfo: - """ - Attributes: - - output_fields - - direct - """ - - thrift_spec = ( - None, # 0 - (1, TType.LIST, 'output_fields', (TType.STRING,None), None, ), # 1 - (2, TType.BOOL, 'direct', None, None, ), # 2 - ) - - def __init__(self, output_fields=None, direct=None,): - self.output_fields = output_fields - self.direct = direct - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.LIST: - self.output_fields = [] - (_etype17, _size14) = iprot.readListBegin() - for _i18 in xrange(_size14): - _elem19 = iprot.readString().decode('utf-8') - self.output_fields.append(_elem19) - iprot.readListEnd() - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.BOOL: - self.direct = iprot.readBool(); - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('StreamInfo') - if self.output_fields is not None: - oprot.writeFieldBegin('output_fields', TType.LIST, 1) - oprot.writeListBegin(TType.STRING, len(self.output_fields)) - for iter20 in self.output_fields: - oprot.writeString(iter20.encode('utf-8')) - oprot.writeListEnd() - oprot.writeFieldEnd() - if self.direct is not None: - oprot.writeFieldBegin('direct', TType.BOOL, 2) - oprot.writeBool(self.direct) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.output_fields is None: - raise TProtocol.TProtocolException(message='Required field output_fields is unset!') - if self.direct is None: - raise TProtocol.TProtocolException(message='Required field direct is unset!') - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class ShellComponent: - """ - Attributes: - - execution_command - - script - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRING, 'execution_command', None, None, ), # 1 - (2, TType.STRING, 'script', None, None, ), # 2 - ) - - def __init__(self, execution_command=None, script=None,): - self.execution_command = execution_command - self.script = script - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRING: - self.execution_command = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRING: - self.script = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('ShellComponent') - if self.execution_command is not None: - oprot.writeFieldBegin('execution_command', TType.STRING, 1) - oprot.writeString(self.execution_command.encode('utf-8')) - oprot.writeFieldEnd() - if self.script is not None: - oprot.writeFieldBegin('script', TType.STRING, 2) - oprot.writeString(self.script.encode('utf-8')) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class ComponentObject: - """ - Attributes: - - serialized_java - - shell - - java_object - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRING, 'serialized_java', None, None, ), # 1 - (2, TType.STRUCT, 'shell', (ShellComponent, ShellComponent.thrift_spec), None, ), # 2 - (3, TType.STRUCT, 'java_object', (JavaObject, JavaObject.thrift_spec), None, ), # 3 - ) - - def __init__(self, serialized_java=None, shell=None, java_object=None,): - self.serialized_java = serialized_java - self.shell = shell - self.java_object = java_object - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRING: - self.serialized_java = iprot.readString(); - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRUCT: - self.shell = ShellComponent() - self.shell.read(iprot) - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.STRUCT: - self.java_object = JavaObject() - self.java_object.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('ComponentObject') - if self.serialized_java is not None: - oprot.writeFieldBegin('serialized_java', TType.STRING, 1) - oprot.writeString(self.serialized_java) - oprot.writeFieldEnd() - if self.shell is not None: - oprot.writeFieldBegin('shell', TType.STRUCT, 2) - self.shell.write(oprot) - oprot.writeFieldEnd() - if self.java_object is not None: - oprot.writeFieldBegin('java_object', TType.STRUCT, 3) - self.java_object.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class ComponentCommon: - """ - Attributes: - - inputs - - streams - - parallelism_hint - - json_conf - """ - - thrift_spec = ( - None, # 0 - (1, TType.MAP, 'inputs', (TType.STRUCT,(GlobalStreamId, GlobalStreamId.thrift_spec),TType.STRUCT,(Grouping, Grouping.thrift_spec)), None, ), # 1 - (2, TType.MAP, 'streams', (TType.STRING,None,TType.STRUCT,(StreamInfo, StreamInfo.thrift_spec)), None, ), # 2 - (3, TType.I32, 'parallelism_hint', None, None, ), # 3 - (4, TType.STRING, 'json_conf', None, None, ), # 4 - ) - - def __init__(self, inputs=None, streams=None, parallelism_hint=None, json_conf=None,): - self.inputs = inputs - self.streams = streams - self.parallelism_hint = parallelism_hint - self.json_conf = json_conf - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.MAP: - self.inputs = {} - (_ktype22, _vtype23, _size21 ) = iprot.readMapBegin() - for _i25 in xrange(_size21): - _key26 = GlobalStreamId() - _key26.read(iprot) - _val27 = Grouping() - _val27.read(iprot) - self.inputs[_key26] = _val27 - iprot.readMapEnd() - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.MAP: - self.streams = {} - (_ktype29, _vtype30, _size28 ) = iprot.readMapBegin() - for _i32 in xrange(_size28): - _key33 = iprot.readString().decode('utf-8') - _val34 = StreamInfo() - _val34.read(iprot) - self.streams[_key33] = _val34 - iprot.readMapEnd() - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.I32: - self.parallelism_hint = iprot.readI32(); - else: - iprot.skip(ftype) - elif fid == 4: - if ftype == TType.STRING: - self.json_conf = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('ComponentCommon') - if self.inputs is not None: - oprot.writeFieldBegin('inputs', TType.MAP, 1) - oprot.writeMapBegin(TType.STRUCT, TType.STRUCT, len(self.inputs)) - for kiter35,viter36 in self.inputs.items(): - kiter35.write(oprot) - viter36.write(oprot) - oprot.writeMapEnd() - oprot.writeFieldEnd() - if self.streams is not None: - oprot.writeFieldBegin('streams', TType.MAP, 2) - oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.streams)) - for kiter37,viter38 in self.streams.items(): - oprot.writeString(kiter37.encode('utf-8')) - viter38.write(oprot) - oprot.writeMapEnd() - oprot.writeFieldEnd() - if self.parallelism_hint is not None: - oprot.writeFieldBegin('parallelism_hint', TType.I32, 3) - oprot.writeI32(self.parallelism_hint) - oprot.writeFieldEnd() - if self.json_conf is not None: - oprot.writeFieldBegin('json_conf', TType.STRING, 4) - oprot.writeString(self.json_conf.encode('utf-8')) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.inputs is None: - raise TProtocol.TProtocolException(message='Required field inputs is unset!') - if self.streams is None: - raise TProtocol.TProtocolException(message='Required field streams is unset!') - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class SpoutSpec: - """ - Attributes: - - spout_object - - common - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'spout_object', (ComponentObject, ComponentObject.thrift_spec), None, ), # 1 - (2, TType.STRUCT, 'common', (ComponentCommon, ComponentCommon.thrift_spec), None, ), # 2 - ) - - def __init__(self, spout_object=None, common=None,): - self.spout_object = spout_object - self.common = common - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRUCT: - self.spout_object = ComponentObject() - self.spout_object.read(iprot) - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRUCT: - self.common = ComponentCommon() - self.common.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('SpoutSpec') - if self.spout_object is not None: - oprot.writeFieldBegin('spout_object', TType.STRUCT, 1) - self.spout_object.write(oprot) - oprot.writeFieldEnd() - if self.common is not None: - oprot.writeFieldBegin('common', TType.STRUCT, 2) - self.common.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.spout_object is None: - raise TProtocol.TProtocolException(message='Required field spout_object is unset!') - if self.common is None: - raise TProtocol.TProtocolException(message='Required field common is unset!') - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class Bolt: - """ - Attributes: - - bolt_object - - common - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'bolt_object', (ComponentObject, ComponentObject.thrift_spec), None, ), # 1 - (2, TType.STRUCT, 'common', (ComponentCommon, ComponentCommon.thrift_spec), None, ), # 2 - ) - - def __init__(self, bolt_object=None, common=None,): - self.bolt_object = bolt_object - self.common = common - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRUCT: - self.bolt_object = ComponentObject() - self.bolt_object.read(iprot) - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRUCT: - self.common = ComponentCommon() - self.common.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('Bolt') - if self.bolt_object is not None: - oprot.writeFieldBegin('bolt_object', TType.STRUCT, 1) - self.bolt_object.write(oprot) - oprot.writeFieldEnd() - if self.common is not None: - oprot.writeFieldBegin('common', TType.STRUCT, 2) - self.common.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.bolt_object is None: - raise TProtocol.TProtocolException(message='Required field bolt_object is unset!') - if self.common is None: - raise TProtocol.TProtocolException(message='Required field common is unset!') - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class StateSpoutSpec: - """ - Attributes: - - state_spout_object - - common - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'state_spout_object', (ComponentObject, ComponentObject.thrift_spec), None, ), # 1 - (2, TType.STRUCT, 'common', (ComponentCommon, ComponentCommon.thrift_spec), None, ), # 2 - ) - - def __init__(self, state_spout_object=None, common=None,): - self.state_spout_object = state_spout_object - self.common = common - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRUCT: - self.state_spout_object = ComponentObject() - self.state_spout_object.read(iprot) - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRUCT: - self.common = ComponentCommon() - self.common.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('StateSpoutSpec') - if self.state_spout_object is not None: - oprot.writeFieldBegin('state_spout_object', TType.STRUCT, 1) - self.state_spout_object.write(oprot) - oprot.writeFieldEnd() - if self.common is not None: - oprot.writeFieldBegin('common', TType.STRUCT, 2) - self.common.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.state_spout_object is None: - raise TProtocol.TProtocolException(message='Required field state_spout_object is unset!') - if self.common is None: - raise TProtocol.TProtocolException(message='Required field common is unset!') - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class StormTopology: - """ - Attributes: - - spouts - - bolts - - state_spouts - """ - - thrift_spec = ( - None, # 0 - (1, TType.MAP, 'spouts', (TType.STRING,None,TType.STRUCT,(SpoutSpec, SpoutSpec.thrift_spec)), None, ), # 1 - (2, TType.MAP, 'bolts', (TType.STRING,None,TType.STRUCT,(Bolt, Bolt.thrift_spec)), None, ), # 2 - (3, TType.MAP, 'state_spouts', (TType.STRING,None,TType.STRUCT,(StateSpoutSpec, StateSpoutSpec.thrift_spec)), None, ), # 3 - ) - - def __init__(self, spouts=None, bolts=None, state_spouts=None,): - self.spouts = spouts - self.bolts = bolts - self.state_spouts = state_spouts - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.MAP: - self.spouts = {} - (_ktype40, _vtype41, _size39 ) = iprot.readMapBegin() - for _i43 in xrange(_size39): - _key44 = iprot.readString().decode('utf-8') - _val45 = SpoutSpec() - _val45.read(iprot) - self.spouts[_key44] = _val45 - iprot.readMapEnd() - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.MAP: - self.bolts = {} - (_ktype47, _vtype48, _size46 ) = iprot.readMapBegin() - for _i50 in xrange(_size46): - _key51 = iprot.readString().decode('utf-8') - _val52 = Bolt() - _val52.read(iprot) - self.bolts[_key51] = _val52 - iprot.readMapEnd() - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.MAP: - self.state_spouts = {} - (_ktype54, _vtype55, _size53 ) = iprot.readMapBegin() - for _i57 in xrange(_size53): - _key58 = iprot.readString().decode('utf-8') - _val59 = StateSpoutSpec() - _val59.read(iprot) - self.state_spouts[_key58] = _val59 - iprot.readMapEnd() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('StormTopology') - if self.spouts is not None: - oprot.writeFieldBegin('spouts', TType.MAP, 1) - oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.spouts)) - for kiter60,viter61 in self.spouts.items(): - oprot.writeString(kiter60.encode('utf-8')) - viter61.write(oprot) - oprot.writeMapEnd() - oprot.writeFieldEnd() - if self.bolts is not None: - oprot.writeFieldBegin('bolts', TType.MAP, 2) - oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.bolts)) - for kiter62,viter63 in self.bolts.items(): - oprot.writeString(kiter62.encode('utf-8')) - viter63.write(oprot) - oprot.writeMapEnd() - oprot.writeFieldEnd() - if self.state_spouts is not None: - oprot.writeFieldBegin('state_spouts', TType.MAP, 3) - oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.state_spouts)) - for kiter64,viter65 in self.state_spouts.items(): - oprot.writeString(kiter64.encode('utf-8')) - viter65.write(oprot) - oprot.writeMapEnd() - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.spouts is None: - raise TProtocol.TProtocolException(message='Required field spouts is unset!') - if self.bolts is None: - raise TProtocol.TProtocolException(message='Required field bolts is unset!') - if self.state_spouts is None: - raise TProtocol.TProtocolException(message='Required field state_spouts is unset!') - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class AlreadyAliveException(Exception): - """ - Attributes: - - msg - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRING, 'msg', None, None, ), # 1 - ) - - def __init__(self, msg=None,): - self.msg = msg - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRING: - self.msg = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('AlreadyAliveException') - if self.msg is not None: - oprot.writeFieldBegin('msg', TType.STRING, 1) - oprot.writeString(self.msg.encode('utf-8')) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.msg is None: - raise TProtocol.TProtocolException(message='Required field msg is unset!') - return - - - def __str__(self): - return repr(self) - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class NotAliveException(Exception): - """ - Attributes: - - msg - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRING, 'msg', None, None, ), # 1 - ) - - def __init__(self, msg=None,): - self.msg = msg - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRING: - self.msg = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('NotAliveException') - if self.msg is not None: - oprot.writeFieldBegin('msg', TType.STRING, 1) - oprot.writeString(self.msg.encode('utf-8')) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.msg is None: - raise TProtocol.TProtocolException(message='Required field msg is unset!') - return - - - def __str__(self): - return repr(self) - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class InvalidTopologyException(Exception): - """ - Attributes: - - msg - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRING, 'msg', None, None, ), # 1 - ) - - def __init__(self, msg=None,): - self.msg = msg - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRING: - self.msg = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('InvalidTopologyException') - if self.msg is not None: - oprot.writeFieldBegin('msg', TType.STRING, 1) - oprot.writeString(self.msg.encode('utf-8')) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.msg is None: - raise TProtocol.TProtocolException(message='Required field msg is unset!') - return - - - def __str__(self): - return repr(self) - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class TopologySummary: - """ - Attributes: - - id - - name - - num_tasks - - num_workers - - uptime_secs - - status - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRING, 'id', None, None, ), # 1 - (2, TType.STRING, 'name', None, None, ), # 2 - (3, TType.I32, 'num_tasks', None, None, ), # 3 - (4, TType.I32, 'num_workers', None, None, ), # 4 - (5, TType.I32, 'uptime_secs', None, None, ), # 5 - (6, TType.STRING, 'status', None, None, ), # 6 - ) - - def __init__(self, id=None, name=None, num_tasks=None, num_workers=None, uptime_secs=None, status=None,): - self.id = id - self.name = name - self.num_tasks = num_tasks - self.num_workers = num_workers - self.uptime_secs = uptime_secs - self.status = status - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRING: - self.id = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRING: - self.name = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.I32: - self.num_tasks = iprot.readI32(); - else: - iprot.skip(ftype) - elif fid == 4: - if ftype == TType.I32: - self.num_workers = iprot.readI32(); - else: - iprot.skip(ftype) - elif fid == 5: - if ftype == TType.I32: - self.uptime_secs = iprot.readI32(); - else: - iprot.skip(ftype) - elif fid == 6: - if ftype == TType.STRING: - self.status = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('TopologySummary') - if self.id is not None: - oprot.writeFieldBegin('id', TType.STRING, 1) - oprot.writeString(self.id.encode('utf-8')) - oprot.writeFieldEnd() - if self.name is not None: - oprot.writeFieldBegin('name', TType.STRING, 2) - oprot.writeString(self.name.encode('utf-8')) - oprot.writeFieldEnd() - if self.num_tasks is not None: - oprot.writeFieldBegin('num_tasks', TType.I32, 3) - oprot.writeI32(self.num_tasks) - oprot.writeFieldEnd() - if self.num_workers is not None: - oprot.writeFieldBegin('num_workers', TType.I32, 4) - oprot.writeI32(self.num_workers) - oprot.writeFieldEnd() - if self.uptime_secs is not None: - oprot.writeFieldBegin('uptime_secs', TType.I32, 5) - oprot.writeI32(self.uptime_secs) - oprot.writeFieldEnd() - if self.status is not None: - oprot.writeFieldBegin('status', TType.STRING, 6) - oprot.writeString(self.status.encode('utf-8')) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.id is None: - raise TProtocol.TProtocolException(message='Required field id is unset!') - if self.name is None: - raise TProtocol.TProtocolException(message='Required field name is unset!') - if self.num_tasks is None: - raise TProtocol.TProtocolException(message='Required field num_tasks is unset!') - if self.num_workers is None: - raise TProtocol.TProtocolException(message='Required field num_workers is unset!') - if self.uptime_secs is None: - raise TProtocol.TProtocolException(message='Required field uptime_secs is unset!') - if self.status is None: - raise TProtocol.TProtocolException(message='Required field status is unset!') - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class SupervisorSummary: - """ - Attributes: - - host - - uptime_secs - - num_workers - - num_used_workers - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRING, 'host', None, None, ), # 1 - (2, TType.I32, 'uptime_secs', None, None, ), # 2 - (3, TType.I32, 'num_workers', None, None, ), # 3 - (4, TType.I32, 'num_used_workers', None, None, ), # 4 - ) - - def __init__(self, host=None, uptime_secs=None, num_workers=None, num_used_workers=None,): - self.host = host - self.uptime_secs = uptime_secs - self.num_workers = num_workers - self.num_used_workers = num_used_workers - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRING: - self.host = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.I32: - self.uptime_secs = iprot.readI32(); - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.I32: - self.num_workers = iprot.readI32(); - else: - iprot.skip(ftype) - elif fid == 4: - if ftype == TType.I32: - self.num_used_workers = iprot.readI32(); - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('SupervisorSummary') - if self.host is not None: - oprot.writeFieldBegin('host', TType.STRING, 1) - oprot.writeString(self.host.encode('utf-8')) - oprot.writeFieldEnd() - if self.uptime_secs is not None: - oprot.writeFieldBegin('uptime_secs', TType.I32, 2) - oprot.writeI32(self.uptime_secs) - oprot.writeFieldEnd() - if self.num_workers is not None: - oprot.writeFieldBegin('num_workers', TType.I32, 3) - oprot.writeI32(self.num_workers) - oprot.writeFieldEnd() - if self.num_used_workers is not None: - oprot.writeFieldBegin('num_used_workers', TType.I32, 4) - oprot.writeI32(self.num_used_workers) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.host is None: - raise TProtocol.TProtocolException(message='Required field host is unset!') - if self.uptime_secs is None: - raise TProtocol.TProtocolException(message='Required field uptime_secs is unset!') - if self.num_workers is None: - raise TProtocol.TProtocolException(message='Required field num_workers is unset!') - if self.num_used_workers is None: - raise TProtocol.TProtocolException(message='Required field num_used_workers is unset!') - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class ClusterSummary: - """ - Attributes: - - supervisors - - nimbus_uptime_secs - - topologies - """ - - thrift_spec = ( - None, # 0 - (1, TType.LIST, 'supervisors', (TType.STRUCT,(SupervisorSummary, SupervisorSummary.thrift_spec)), None, ), # 1 - (2, TType.I32, 'nimbus_uptime_secs', None, None, ), # 2 - (3, TType.LIST, 'topologies', (TType.STRUCT,(TopologySummary, TopologySummary.thrift_spec)), None, ), # 3 - ) - - def __init__(self, supervisors=None, nimbus_uptime_secs=None, topologies=None,): - self.supervisors = supervisors - self.nimbus_uptime_secs = nimbus_uptime_secs - self.topologies = topologies - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.LIST: - self.supervisors = [] - (_etype69, _size66) = iprot.readListBegin() - for _i70 in xrange(_size66): - _elem71 = SupervisorSummary() - _elem71.read(iprot) - self.supervisors.append(_elem71) - iprot.readListEnd() - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.I32: - self.nimbus_uptime_secs = iprot.readI32(); - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.LIST: - self.topologies = [] - (_etype75, _size72) = iprot.readListBegin() - for _i76 in xrange(_size72): - _elem77 = TopologySummary() - _elem77.read(iprot) - self.topologies.append(_elem77) - iprot.readListEnd() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('ClusterSummary') - if self.supervisors is not None: - oprot.writeFieldBegin('supervisors', TType.LIST, 1) - oprot.writeListBegin(TType.STRUCT, len(self.supervisors)) - for iter78 in self.supervisors: - iter78.write(oprot) - oprot.writeListEnd() - oprot.writeFieldEnd() - if self.nimbus_uptime_secs is not None: - oprot.writeFieldBegin('nimbus_uptime_secs', TType.I32, 2) - oprot.writeI32(self.nimbus_uptime_secs) - oprot.writeFieldEnd() - if self.topologies is not None: - oprot.writeFieldBegin('topologies', TType.LIST, 3) - oprot.writeListBegin(TType.STRUCT, len(self.topologies)) - for iter79 in self.topologies: - iter79.write(oprot) - oprot.writeListEnd() - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.supervisors is None: - raise TProtocol.TProtocolException(message='Required field supervisors is unset!') - if self.nimbus_uptime_secs is None: - raise TProtocol.TProtocolException(message='Required field nimbus_uptime_secs is unset!') - if self.topologies is None: - raise TProtocol.TProtocolException(message='Required field topologies is unset!') - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class ErrorInfo: - """ - Attributes: - - error - - error_time_secs - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRING, 'error', None, None, ), # 1 - (2, TType.I32, 'error_time_secs', None, None, ), # 2 - ) - - def __init__(self, error=None, error_time_secs=None,): - self.error = error - self.error_time_secs = error_time_secs - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRING: - self.error = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.I32: - self.error_time_secs = iprot.readI32(); - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('ErrorInfo') - if self.error is not None: - oprot.writeFieldBegin('error', TType.STRING, 1) - oprot.writeString(self.error.encode('utf-8')) - oprot.writeFieldEnd() - if self.error_time_secs is not None: - oprot.writeFieldBegin('error_time_secs', TType.I32, 2) - oprot.writeI32(self.error_time_secs) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.error is None: - raise TProtocol.TProtocolException(message='Required field error is unset!') - if self.error_time_secs is None: - raise TProtocol.TProtocolException(message='Required field error_time_secs is unset!') - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class TaskStats: - """ - Attributes: - - emitted - - send_tps - - recv_tps - - acked - - failed - - process_ms_avg - """ - - thrift_spec = ( - None, # 0 - (1, TType.MAP, 'emitted', (TType.STRING,None,TType.MAP,(TType.STRING,None,TType.I64,None)), None, ), # 1 - (2, TType.MAP, 'send_tps', (TType.STRING,None,TType.MAP,(TType.STRING,None,TType.DOUBLE,None)), None, ), # 2 - (3, TType.MAP, 'recv_tps', (TType.STRING,None,TType.MAP,(TType.STRUCT,(GlobalStreamId, GlobalStreamId.thrift_spec),TType.DOUBLE,None)), None, ), # 3 - (4, TType.MAP, 'acked', (TType.STRING,None,TType.MAP,(TType.STRUCT,(GlobalStreamId, GlobalStreamId.thrift_spec),TType.I64,None)), None, ), # 4 - (5, TType.MAP, 'failed', (TType.STRING,None,TType.MAP,(TType.STRUCT,(GlobalStreamId, GlobalStreamId.thrift_spec),TType.I64,None)), None, ), # 5 - (6, TType.MAP, 'process_ms_avg', (TType.STRING,None,TType.MAP,(TType.STRUCT,(GlobalStreamId, GlobalStreamId.thrift_spec),TType.DOUBLE,None)), None, ), # 6 - ) - - def __init__(self, emitted=None, send_tps=None, recv_tps=None, acked=None, failed=None, process_ms_avg=None,): - self.emitted = emitted - self.send_tps = send_tps - self.recv_tps = recv_tps - self.acked = acked - self.failed = failed - self.process_ms_avg = process_ms_avg - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.MAP: - self.emitted = {} - (_ktype81, _vtype82, _size80 ) = iprot.readMapBegin() - for _i84 in xrange(_size80): - _key85 = iprot.readString().decode('utf-8') - _val86 = {} - (_ktype88, _vtype89, _size87 ) = iprot.readMapBegin() - for _i91 in xrange(_size87): - _key92 = iprot.readString().decode('utf-8') - _val93 = iprot.readI64(); - _val86[_key92] = _val93 - iprot.readMapEnd() - self.emitted[_key85] = _val86 - iprot.readMapEnd() - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.MAP: - self.send_tps = {} - (_ktype95, _vtype96, _size94 ) = iprot.readMapBegin() - for _i98 in xrange(_size94): - _key99 = iprot.readString().decode('utf-8') - _val100 = {} - (_ktype102, _vtype103, _size101 ) = iprot.readMapBegin() - for _i105 in xrange(_size101): - _key106 = iprot.readString().decode('utf-8') - _val107 = iprot.readDouble(); - _val100[_key106] = _val107 - iprot.readMapEnd() - self.send_tps[_key99] = _val100 - iprot.readMapEnd() - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.MAP: - self.recv_tps = {} - (_ktype109, _vtype110, _size108 ) = iprot.readMapBegin() - for _i112 in xrange(_size108): - _key113 = iprot.readString().decode('utf-8') - _val114 = {} - (_ktype116, _vtype117, _size115 ) = iprot.readMapBegin() - for _i119 in xrange(_size115): - _key120 = GlobalStreamId() - _key120.read(iprot) - _val121 = iprot.readDouble(); - _val114[_key120] = _val121 - iprot.readMapEnd() - self.recv_tps[_key113] = _val114 - iprot.readMapEnd() - else: - iprot.skip(ftype) - elif fid == 4: - if ftype == TType.MAP: - self.acked = {} - (_ktype123, _vtype124, _size122 ) = iprot.readMapBegin() - for _i126 in xrange(_size122): - _key127 = iprot.readString().decode('utf-8') - _val128 = {} - (_ktype130, _vtype131, _size129 ) = iprot.readMapBegin() - for _i133 in xrange(_size129): - _key134 = GlobalStreamId() - _key134.read(iprot) - _val135 = iprot.readI64(); - _val128[_key134] = _val135 - iprot.readMapEnd() - self.acked[_key127] = _val128 - iprot.readMapEnd() - else: - iprot.skip(ftype) - elif fid == 5: - if ftype == TType.MAP: - self.failed = {} - (_ktype137, _vtype138, _size136 ) = iprot.readMapBegin() - for _i140 in xrange(_size136): - _key141 = iprot.readString().decode('utf-8') - _val142 = {} - (_ktype144, _vtype145, _size143 ) = iprot.readMapBegin() - for _i147 in xrange(_size143): - _key148 = GlobalStreamId() - _key148.read(iprot) - _val149 = iprot.readI64(); - _val142[_key148] = _val149 - iprot.readMapEnd() - self.failed[_key141] = _val142 - iprot.readMapEnd() - else: - iprot.skip(ftype) - elif fid == 6: - if ftype == TType.MAP: - self.process_ms_avg = {} - (_ktype151, _vtype152, _size150 ) = iprot.readMapBegin() - for _i154 in xrange(_size150): - _key155 = iprot.readString().decode('utf-8') - _val156 = {} - (_ktype158, _vtype159, _size157 ) = iprot.readMapBegin() - for _i161 in xrange(_size157): - _key162 = GlobalStreamId() - _key162.read(iprot) - _val163 = iprot.readDouble(); - _val156[_key162] = _val163 - iprot.readMapEnd() - self.process_ms_avg[_key155] = _val156 - iprot.readMapEnd() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('TaskStats') - if self.emitted is not None: - oprot.writeFieldBegin('emitted', TType.MAP, 1) - oprot.writeMapBegin(TType.STRING, TType.MAP, len(self.emitted)) - for kiter164,viter165 in self.emitted.items(): - oprot.writeString(kiter164.encode('utf-8')) - oprot.writeMapBegin(TType.STRING, TType.I64, len(viter165)) - for kiter166,viter167 in viter165.items(): - oprot.writeString(kiter166.encode('utf-8')) - oprot.writeI64(viter167) - oprot.writeMapEnd() - oprot.writeMapEnd() - oprot.writeFieldEnd() - if self.send_tps is not None: - oprot.writeFieldBegin('send_tps', TType.MAP, 2) - oprot.writeMapBegin(TType.STRING, TType.MAP, len(self.send_tps)) - for kiter168,viter169 in self.send_tps.items(): - oprot.writeString(kiter168.encode('utf-8')) - oprot.writeMapBegin(TType.STRING, TType.DOUBLE, len(viter169)) - for kiter170,viter171 in viter169.items(): - oprot.writeString(kiter170.encode('utf-8')) - oprot.writeDouble(viter171) - oprot.writeMapEnd() - oprot.writeMapEnd() - oprot.writeFieldEnd() - if self.recv_tps is not None: - oprot.writeFieldBegin('recv_tps', TType.MAP, 3) - oprot.writeMapBegin(TType.STRING, TType.MAP, len(self.recv_tps)) - for kiter172,viter173 in self.recv_tps.items(): - oprot.writeString(kiter172.encode('utf-8')) - oprot.writeMapBegin(TType.STRUCT, TType.DOUBLE, len(viter173)) - for kiter174,viter175 in viter173.items(): - kiter174.write(oprot) - oprot.writeDouble(viter175) - oprot.writeMapEnd() - oprot.writeMapEnd() - oprot.writeFieldEnd() - if self.acked is not None: - oprot.writeFieldBegin('acked', TType.MAP, 4) - oprot.writeMapBegin(TType.STRING, TType.MAP, len(self.acked)) - for kiter176,viter177 in self.acked.items(): - oprot.writeString(kiter176.encode('utf-8')) - oprot.writeMapBegin(TType.STRUCT, TType.I64, len(viter177)) - for kiter178,viter179 in viter177.items(): - kiter178.write(oprot) - oprot.writeI64(viter179) - oprot.writeMapEnd() - oprot.writeMapEnd() - oprot.writeFieldEnd() - if self.failed is not None: - oprot.writeFieldBegin('failed', TType.MAP, 5) - oprot.writeMapBegin(TType.STRING, TType.MAP, len(self.failed)) - for kiter180,viter181 in self.failed.items(): - oprot.writeString(kiter180.encode('utf-8')) - oprot.writeMapBegin(TType.STRUCT, TType.I64, len(viter181)) - for kiter182,viter183 in viter181.items(): - kiter182.write(oprot) - oprot.writeI64(viter183) - oprot.writeMapEnd() - oprot.writeMapEnd() - oprot.writeFieldEnd() - if self.process_ms_avg is not None: - oprot.writeFieldBegin('process_ms_avg', TType.MAP, 6) - oprot.writeMapBegin(TType.STRING, TType.MAP, len(self.process_ms_avg)) - for kiter184,viter185 in self.process_ms_avg.items(): - oprot.writeString(kiter184.encode('utf-8')) - oprot.writeMapBegin(TType.STRUCT, TType.DOUBLE, len(viter185)) - for kiter186,viter187 in viter185.items(): - kiter186.write(oprot) - oprot.writeDouble(viter187) - oprot.writeMapEnd() - oprot.writeMapEnd() - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.emitted is None: - raise TProtocol.TProtocolException(message='Required field emitted is unset!') - if self.send_tps is None: - raise TProtocol.TProtocolException(message='Required field send_tps is unset!') - if self.recv_tps is None: - raise TProtocol.TProtocolException(message='Required field recv_tps is unset!') - if self.acked is None: - raise TProtocol.TProtocolException(message='Required field acked is unset!') - if self.failed is None: - raise TProtocol.TProtocolException(message='Required field failed is unset!') - if self.process_ms_avg is None: - raise TProtocol.TProtocolException(message='Required field process_ms_avg is unset!') - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class TaskSummary: - """ - Attributes: - - task_id - - component_id - - host - - port - - uptime_secs - - errors - - stats - """ - - thrift_spec = ( - None, # 0 - (1, TType.I32, 'task_id', None, None, ), # 1 - (2, TType.STRING, 'component_id', None, None, ), # 2 - (3, TType.STRING, 'host', None, None, ), # 3 - (4, TType.I32, 'port', None, None, ), # 4 - (5, TType.I32, 'uptime_secs', None, None, ), # 5 - (6, TType.LIST, 'errors', (TType.STRUCT,(ErrorInfo, ErrorInfo.thrift_spec)), None, ), # 6 - (7, TType.STRUCT, 'stats', (TaskStats, TaskStats.thrift_spec), None, ), # 7 - ) - - def __init__(self, task_id=None, component_id=None, host=None, port=None, uptime_secs=None, errors=None, stats=None,): - self.task_id = task_id - self.component_id = component_id - self.host = host - self.port = port - self.uptime_secs = uptime_secs - self.errors = errors - self.stats = stats - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.I32: - self.task_id = iprot.readI32(); - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRING: - self.component_id = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.STRING: - self.host = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - elif fid == 4: - if ftype == TType.I32: - self.port = iprot.readI32(); - else: - iprot.skip(ftype) - elif fid == 5: - if ftype == TType.I32: - self.uptime_secs = iprot.readI32(); - else: - iprot.skip(ftype) - elif fid == 6: - if ftype == TType.LIST: - self.errors = [] - (_etype191, _size188) = iprot.readListBegin() - for _i192 in xrange(_size188): - _elem193 = ErrorInfo() - _elem193.read(iprot) - self.errors.append(_elem193) - iprot.readListEnd() - else: - iprot.skip(ftype) - elif fid == 7: - if ftype == TType.STRUCT: - self.stats = TaskStats() - self.stats.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('TaskSummary') - if self.task_id is not None: - oprot.writeFieldBegin('task_id', TType.I32, 1) - oprot.writeI32(self.task_id) - oprot.writeFieldEnd() - if self.component_id is not None: - oprot.writeFieldBegin('component_id', TType.STRING, 2) - oprot.writeString(self.component_id.encode('utf-8')) - oprot.writeFieldEnd() - if self.host is not None: - oprot.writeFieldBegin('host', TType.STRING, 3) - oprot.writeString(self.host.encode('utf-8')) - oprot.writeFieldEnd() - if self.port is not None: - oprot.writeFieldBegin('port', TType.I32, 4) - oprot.writeI32(self.port) - oprot.writeFieldEnd() - if self.uptime_secs is not None: - oprot.writeFieldBegin('uptime_secs', TType.I32, 5) - oprot.writeI32(self.uptime_secs) - oprot.writeFieldEnd() - if self.errors is not None: - oprot.writeFieldBegin('errors', TType.LIST, 6) - oprot.writeListBegin(TType.STRUCT, len(self.errors)) - for iter194 in self.errors: - iter194.write(oprot) - oprot.writeListEnd() - oprot.writeFieldEnd() - if self.stats is not None: - oprot.writeFieldBegin('stats', TType.STRUCT, 7) - self.stats.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.task_id is None: - raise TProtocol.TProtocolException(message='Required field task_id is unset!') - if self.component_id is None: - raise TProtocol.TProtocolException(message='Required field component_id is unset!') - if self.host is None: - raise TProtocol.TProtocolException(message='Required field host is unset!') - if self.port is None: - raise TProtocol.TProtocolException(message='Required field port is unset!') - if self.uptime_secs is None: - raise TProtocol.TProtocolException(message='Required field uptime_secs is unset!') - if self.errors is None: - raise TProtocol.TProtocolException(message='Required field errors is unset!') - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class TopologyInfo: - """ - Attributes: - - id - - name - - uptime_secs - - tasks - - status - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRING, 'id', None, None, ), # 1 - (2, TType.STRING, 'name', None, None, ), # 2 - (3, TType.I32, 'uptime_secs', None, None, ), # 3 - (4, TType.LIST, 'tasks', (TType.STRUCT,(TaskSummary, TaskSummary.thrift_spec)), None, ), # 4 - (5, TType.STRING, 'status', None, None, ), # 5 - ) - - def __init__(self, id=None, name=None, uptime_secs=None, tasks=None, status=None,): - self.id = id - self.name = name - self.uptime_secs = uptime_secs - self.tasks = tasks - self.status = status - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRING: - self.id = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRING: - self.name = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.I32: - self.uptime_secs = iprot.readI32(); - else: - iprot.skip(ftype) - elif fid == 4: - if ftype == TType.LIST: - self.tasks = [] - (_etype198, _size195) = iprot.readListBegin() - for _i199 in xrange(_size195): - _elem200 = TaskSummary() - _elem200.read(iprot) - self.tasks.append(_elem200) - iprot.readListEnd() - else: - iprot.skip(ftype) - elif fid == 5: - if ftype == TType.STRING: - self.status = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('TopologyInfo') - if self.id is not None: - oprot.writeFieldBegin('id', TType.STRING, 1) - oprot.writeString(self.id.encode('utf-8')) - oprot.writeFieldEnd() - if self.name is not None: - oprot.writeFieldBegin('name', TType.STRING, 2) - oprot.writeString(self.name.encode('utf-8')) - oprot.writeFieldEnd() - if self.uptime_secs is not None: - oprot.writeFieldBegin('uptime_secs', TType.I32, 3) - oprot.writeI32(self.uptime_secs) - oprot.writeFieldEnd() - if self.tasks is not None: - oprot.writeFieldBegin('tasks', TType.LIST, 4) - oprot.writeListBegin(TType.STRUCT, len(self.tasks)) - for iter201 in self.tasks: - iter201.write(oprot) - oprot.writeListEnd() - oprot.writeFieldEnd() - if self.status is not None: - oprot.writeFieldBegin('status', TType.STRING, 5) - oprot.writeString(self.status.encode('utf-8')) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.id is None: - raise TProtocol.TProtocolException(message='Required field id is unset!') - if self.name is None: - raise TProtocol.TProtocolException(message='Required field name is unset!') - if self.uptime_secs is None: - raise TProtocol.TProtocolException(message='Required field uptime_secs is unset!') - if self.tasks is None: - raise TProtocol.TProtocolException(message='Required field tasks is unset!') - if self.status is None: - raise TProtocol.TProtocolException(message='Required field status is unset!') - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class WorkerSummary: - """ - Attributes: - - port - - topology - - tasks - """ - - thrift_spec = ( - None, # 0 - (1, TType.I32, 'port', None, None, ), # 1 - (2, TType.STRING, 'topology', None, None, ), # 2 - (3, TType.LIST, 'tasks', (TType.STRUCT,(TaskSummary, TaskSummary.thrift_spec)), None, ), # 3 - ) - - def __init__(self, port=None, topology=None, tasks=None,): - self.port = port - self.topology = topology - self.tasks = tasks - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.I32: - self.port = iprot.readI32(); - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRING: - self.topology = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.LIST: - self.tasks = [] - (_etype205, _size202) = iprot.readListBegin() - for _i206 in xrange(_size202): - _elem207 = TaskSummary() - _elem207.read(iprot) - self.tasks.append(_elem207) - iprot.readListEnd() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('WorkerSummary') - if self.port is not None: - oprot.writeFieldBegin('port', TType.I32, 1) - oprot.writeI32(self.port) - oprot.writeFieldEnd() - if self.topology is not None: - oprot.writeFieldBegin('topology', TType.STRING, 2) - oprot.writeString(self.topology.encode('utf-8')) - oprot.writeFieldEnd() - if self.tasks is not None: - oprot.writeFieldBegin('tasks', TType.LIST, 3) - oprot.writeListBegin(TType.STRUCT, len(self.tasks)) - for iter208 in self.tasks: - iter208.write(oprot) - oprot.writeListEnd() - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.port is None: - raise TProtocol.TProtocolException(message='Required field port is unset!') - if self.topology is None: - raise TProtocol.TProtocolException(message='Required field topology is unset!') - if self.tasks is None: - raise TProtocol.TProtocolException(message='Required field tasks is unset!') - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class SupervisorWorkers: - """ - Attributes: - - supervisor - - workers - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'supervisor', (SupervisorSummary, SupervisorSummary.thrift_spec), None, ), # 1 - (2, TType.LIST, 'workers', (TType.STRUCT,(WorkerSummary, WorkerSummary.thrift_spec)), None, ), # 2 - ) - - def __init__(self, supervisor=None, workers=None,): - self.supervisor = supervisor - self.workers = workers - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRUCT: - self.supervisor = SupervisorSummary() - self.supervisor.read(iprot) - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.LIST: - self.workers = [] - (_etype212, _size209) = iprot.readListBegin() - for _i213 in xrange(_size209): - _elem214 = WorkerSummary() - _elem214.read(iprot) - self.workers.append(_elem214) - iprot.readListEnd() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('SupervisorWorkers') - if self.supervisor is not None: - oprot.writeFieldBegin('supervisor', TType.STRUCT, 1) - self.supervisor.write(oprot) - oprot.writeFieldEnd() - if self.workers is not None: - oprot.writeFieldBegin('workers', TType.LIST, 2) - oprot.writeListBegin(TType.STRUCT, len(self.workers)) - for iter215 in self.workers: - iter215.write(oprot) - oprot.writeListEnd() - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.supervisor is None: - raise TProtocol.TProtocolException(message='Required field supervisor is unset!') - if self.workers is None: - raise TProtocol.TProtocolException(message='Required field workers is unset!') - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class KillOptions: - """ - Attributes: - - wait_secs - """ - - thrift_spec = ( - None, # 0 - (1, TType.I32, 'wait_secs', None, None, ), # 1 - ) - - def __init__(self, wait_secs=None,): - self.wait_secs = wait_secs - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.I32: - self.wait_secs = iprot.readI32(); - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('KillOptions') - if self.wait_secs is not None: - oprot.writeFieldBegin('wait_secs', TType.I32, 1) - oprot.writeI32(self.wait_secs) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class RebalanceOptions: - """ - Attributes: - - wait_secs - """ - - thrift_spec = ( - None, # 0 - (1, TType.I32, 'wait_secs', None, None, ), # 1 - ) - - def __init__(self, wait_secs=None,): - self.wait_secs = wait_secs - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.I32: - self.wait_secs = iprot.readI32(); - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('RebalanceOptions') - if self.wait_secs is not None: - oprot.writeFieldBegin('wait_secs', TType.I32, 1) - oprot.writeI32(self.wait_secs) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class DRPCRequest: - """ - Attributes: - - func_args - - request_id - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRING, 'func_args', None, None, ), # 1 - (2, TType.STRING, 'request_id', None, None, ), # 2 - ) - - def __init__(self, func_args=None, request_id=None,): - self.func_args = func_args - self.request_id = request_id - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRING: - self.func_args = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRING: - self.request_id = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('DRPCRequest') - if self.func_args is not None: - oprot.writeFieldBegin('func_args', TType.STRING, 1) - oprot.writeString(self.func_args.encode('utf-8')) - oprot.writeFieldEnd() - if self.request_id is not None: - oprot.writeFieldBegin('request_id', TType.STRING, 2) - oprot.writeString(self.request_id.encode('utf-8')) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.func_args is None: - raise TProtocol.TProtocolException(message='Required field func_args is unset!') - if self.request_id is None: - raise TProtocol.TProtocolException(message='Required field request_id is unset!') - return - - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) - -class DRPCExecutionException(Exception): - """ - Attributes: - - msg - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRING, 'msg', None, None, ), # 1 - ) - - def __init__(self, msg=None,): - self.msg = msg - - def read(self, iprot): - if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: - fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRING: - self.msg = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: - oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) - return - oprot.writeStructBegin('DRPCExecutionException') - if self.msg is not None: - oprot.writeFieldBegin('msg', TType.STRING, 1) - oprot.writeString(self.msg.encode('utf-8')) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.msg is None: - raise TProtocol.TProtocolException(message='Required field msg is unset!') - return - - - def __str__(self): - return repr(self) - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.iteritems()] - return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) - - def __eq__(self, other): - return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ - - def __ne__(self, other): - return not (self == other) +# +# Autogenerated by Thrift Compiler (0.8.0) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# +# options string: py:utf8strings +# + +from thrift.Thrift import TType, TMessageType, TException + +from thrift.transport import TTransport +from thrift.protocol import TBinaryProtocol, TProtocol +try: + from thrift.protocol import fastbinary +except: + fastbinary = None + + + +class JavaObjectArg: + """ + Attributes: + - int_arg + - long_arg + - string_arg + - bool_arg + - binary_arg + - double_arg + """ + + thrift_spec = ( + None, # 0 + (1, TType.I32, 'int_arg', None, None, ), # 1 + (2, TType.I64, 'long_arg', None, None, ), # 2 + (3, TType.STRING, 'string_arg', None, None, ), # 3 + (4, TType.BOOL, 'bool_arg', None, None, ), # 4 + (5, TType.STRING, 'binary_arg', None, None, ), # 5 + (6, TType.DOUBLE, 'double_arg', None, None, ), # 6 + ) + + def __init__(self, int_arg=None, long_arg=None, string_arg=None, bool_arg=None, binary_arg=None, double_arg=None,): + self.int_arg = int_arg + self.long_arg = long_arg + self.string_arg = string_arg + self.bool_arg = bool_arg + self.binary_arg = binary_arg + self.double_arg = double_arg + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.I32: + self.int_arg = iprot.readI32(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.I64: + self.long_arg = iprot.readI64(); + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.string_arg = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.BOOL: + self.bool_arg = iprot.readBool(); + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.STRING: + self.binary_arg = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.DOUBLE: + self.double_arg = iprot.readDouble(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('JavaObjectArg') + if self.int_arg is not None: + oprot.writeFieldBegin('int_arg', TType.I32, 1) + oprot.writeI32(self.int_arg) + oprot.writeFieldEnd() + if self.long_arg is not None: + oprot.writeFieldBegin('long_arg', TType.I64, 2) + oprot.writeI64(self.long_arg) + oprot.writeFieldEnd() + if self.string_arg is not None: + oprot.writeFieldBegin('string_arg', TType.STRING, 3) + oprot.writeString(self.string_arg.encode('utf-8')) + oprot.writeFieldEnd() + if self.bool_arg is not None: + oprot.writeFieldBegin('bool_arg', TType.BOOL, 4) + oprot.writeBool(self.bool_arg) + oprot.writeFieldEnd() + if self.binary_arg is not None: + oprot.writeFieldBegin('binary_arg', TType.STRING, 5) + oprot.writeString(self.binary_arg) + oprot.writeFieldEnd() + if self.double_arg is not None: + oprot.writeFieldBegin('double_arg', TType.DOUBLE, 6) + oprot.writeDouble(self.double_arg) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class JavaObject: + """ + Attributes: + - full_class_name + - args_list + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'full_class_name', None, None, ), # 1 + (2, TType.LIST, 'args_list', (TType.STRUCT,(JavaObjectArg, JavaObjectArg.thrift_spec)), None, ), # 2 + ) + + def __init__(self, full_class_name=None, args_list=None,): + self.full_class_name = full_class_name + self.args_list = args_list + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.full_class_name = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.LIST: + self.args_list = [] + (_etype3, _size0) = iprot.readListBegin() + for _i4 in xrange(_size0): + _elem5 = JavaObjectArg() + _elem5.read(iprot) + self.args_list.append(_elem5) + iprot.readListEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('JavaObject') + if self.full_class_name is not None: + oprot.writeFieldBegin('full_class_name', TType.STRING, 1) + oprot.writeString(self.full_class_name.encode('utf-8')) + oprot.writeFieldEnd() + if self.args_list is not None: + oprot.writeFieldBegin('args_list', TType.LIST, 2) + oprot.writeListBegin(TType.STRUCT, len(self.args_list)) + for iter6 in self.args_list: + iter6.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.full_class_name is None: + raise TProtocol.TProtocolException(message='Required field full_class_name is unset!') + if self.args_list is None: + raise TProtocol.TProtocolException(message='Required field args_list is unset!') + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class NullStruct: + + thrift_spec = ( + ) + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('NullStruct') + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class GlobalStreamId: + """ + Attributes: + - componentId + - streamId + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'componentId', None, None, ), # 1 + (2, TType.STRING, 'streamId', None, None, ), # 2 + ) + + def __init__(self, componentId=None, streamId=None,): + self.componentId = componentId + self.streamId = streamId + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.componentId = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.streamId = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('GlobalStreamId') + if self.componentId is not None: + oprot.writeFieldBegin('componentId', TType.STRING, 1) + oprot.writeString(self.componentId.encode('utf-8')) + oprot.writeFieldEnd() + if self.streamId is not None: + oprot.writeFieldBegin('streamId', TType.STRING, 2) + oprot.writeString(self.streamId.encode('utf-8')) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.componentId is None: + raise TProtocol.TProtocolException(message='Required field componentId is unset!') + if self.streamId is None: + raise TProtocol.TProtocolException(message='Required field streamId is unset!') + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class Grouping: + """ + Attributes: + - fields + - shuffle + - all + - none + - direct + - custom_object + - custom_serialized + - local_or_shuffle + """ + + thrift_spec = ( + None, # 0 + (1, TType.LIST, 'fields', (TType.STRING,None), None, ), # 1 + (2, TType.STRUCT, 'shuffle', (NullStruct, NullStruct.thrift_spec), None, ), # 2 + (3, TType.STRUCT, 'all', (NullStruct, NullStruct.thrift_spec), None, ), # 3 + (4, TType.STRUCT, 'none', (NullStruct, NullStruct.thrift_spec), None, ), # 4 + (5, TType.STRUCT, 'direct', (NullStruct, NullStruct.thrift_spec), None, ), # 5 + (6, TType.STRUCT, 'custom_object', (JavaObject, JavaObject.thrift_spec), None, ), # 6 + (7, TType.STRING, 'custom_serialized', None, None, ), # 7 + (8, TType.STRUCT, 'local_or_shuffle', (NullStruct, NullStruct.thrift_spec), None, ), # 8 + ) + + def __init__(self, fields=None, shuffle=None, all=None, none=None, direct=None, custom_object=None, custom_serialized=None, local_or_shuffle=None,): + self.fields = fields + self.shuffle = shuffle + self.all = all + self.none = none + self.direct = direct + self.custom_object = custom_object + self.custom_serialized = custom_serialized + self.local_or_shuffle = local_or_shuffle + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.LIST: + self.fields = [] + (_etype10, _size7) = iprot.readListBegin() + for _i11 in xrange(_size7): + _elem12 = iprot.readString().decode('utf-8') + self.fields.append(_elem12) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.shuffle = NullStruct() + self.shuffle.read(iprot) + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRUCT: + self.all = NullStruct() + self.all.read(iprot) + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRUCT: + self.none = NullStruct() + self.none.read(iprot) + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.STRUCT: + self.direct = NullStruct() + self.direct.read(iprot) + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.STRUCT: + self.custom_object = JavaObject() + self.custom_object.read(iprot) + else: + iprot.skip(ftype) + elif fid == 7: + if ftype == TType.STRING: + self.custom_serialized = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 8: + if ftype == TType.STRUCT: + self.local_or_shuffle = NullStruct() + self.local_or_shuffle.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('Grouping') + if self.fields is not None: + oprot.writeFieldBegin('fields', TType.LIST, 1) + oprot.writeListBegin(TType.STRING, len(self.fields)) + for iter13 in self.fields: + oprot.writeString(iter13.encode('utf-8')) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.shuffle is not None: + oprot.writeFieldBegin('shuffle', TType.STRUCT, 2) + self.shuffle.write(oprot) + oprot.writeFieldEnd() + if self.all is not None: + oprot.writeFieldBegin('all', TType.STRUCT, 3) + self.all.write(oprot) + oprot.writeFieldEnd() + if self.none is not None: + oprot.writeFieldBegin('none', TType.STRUCT, 4) + self.none.write(oprot) + oprot.writeFieldEnd() + if self.direct is not None: + oprot.writeFieldBegin('direct', TType.STRUCT, 5) + self.direct.write(oprot) + oprot.writeFieldEnd() + if self.custom_object is not None: + oprot.writeFieldBegin('custom_object', TType.STRUCT, 6) + self.custom_object.write(oprot) + oprot.writeFieldEnd() + if self.custom_serialized is not None: + oprot.writeFieldBegin('custom_serialized', TType.STRING, 7) + oprot.writeString(self.custom_serialized) + oprot.writeFieldEnd() + if self.local_or_shuffle is not None: + oprot.writeFieldBegin('local_or_shuffle', TType.STRUCT, 8) + self.local_or_shuffle.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class StreamInfo: + """ + Attributes: + - output_fields + - direct + """ + + thrift_spec = ( + None, # 0 + (1, TType.LIST, 'output_fields', (TType.STRING,None), None, ), # 1 + (2, TType.BOOL, 'direct', None, None, ), # 2 + ) + + def __init__(self, output_fields=None, direct=None,): + self.output_fields = output_fields + self.direct = direct + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.LIST: + self.output_fields = [] + (_etype17, _size14) = iprot.readListBegin() + for _i18 in xrange(_size14): + _elem19 = iprot.readString().decode('utf-8') + self.output_fields.append(_elem19) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.BOOL: + self.direct = iprot.readBool(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('StreamInfo') + if self.output_fields is not None: + oprot.writeFieldBegin('output_fields', TType.LIST, 1) + oprot.writeListBegin(TType.STRING, len(self.output_fields)) + for iter20 in self.output_fields: + oprot.writeString(iter20.encode('utf-8')) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.direct is not None: + oprot.writeFieldBegin('direct', TType.BOOL, 2) + oprot.writeBool(self.direct) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.output_fields is None: + raise TProtocol.TProtocolException(message='Required field output_fields is unset!') + if self.direct is None: + raise TProtocol.TProtocolException(message='Required field direct is unset!') + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class ShellComponent: + """ + Attributes: + - execution_command + - script + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'execution_command', None, None, ), # 1 + (2, TType.STRING, 'script', None, None, ), # 2 + ) + + def __init__(self, execution_command=None, script=None,): + self.execution_command = execution_command + self.script = script + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.execution_command = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.script = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('ShellComponent') + if self.execution_command is not None: + oprot.writeFieldBegin('execution_command', TType.STRING, 1) + oprot.writeString(self.execution_command.encode('utf-8')) + oprot.writeFieldEnd() + if self.script is not None: + oprot.writeFieldBegin('script', TType.STRING, 2) + oprot.writeString(self.script.encode('utf-8')) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class ComponentObject: + """ + Attributes: + - serialized_java + - shell + - java_object + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'serialized_java', None, None, ), # 1 + (2, TType.STRUCT, 'shell', (ShellComponent, ShellComponent.thrift_spec), None, ), # 2 + (3, TType.STRUCT, 'java_object', (JavaObject, JavaObject.thrift_spec), None, ), # 3 + ) + + def __init__(self, serialized_java=None, shell=None, java_object=None,): + self.serialized_java = serialized_java + self.shell = shell + self.java_object = java_object + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.serialized_java = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.shell = ShellComponent() + self.shell.read(iprot) + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRUCT: + self.java_object = JavaObject() + self.java_object.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('ComponentObject') + if self.serialized_java is not None: + oprot.writeFieldBegin('serialized_java', TType.STRING, 1) + oprot.writeString(self.serialized_java) + oprot.writeFieldEnd() + if self.shell is not None: + oprot.writeFieldBegin('shell', TType.STRUCT, 2) + self.shell.write(oprot) + oprot.writeFieldEnd() + if self.java_object is not None: + oprot.writeFieldBegin('java_object', TType.STRUCT, 3) + self.java_object.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class ComponentCommon: + """ + Attributes: + - inputs + - streams + - parallelism_hint + - json_conf + """ + + thrift_spec = ( + None, # 0 + (1, TType.MAP, 'inputs', (TType.STRUCT,(GlobalStreamId, GlobalStreamId.thrift_spec),TType.STRUCT,(Grouping, Grouping.thrift_spec)), None, ), # 1 + (2, TType.MAP, 'streams', (TType.STRING,None,TType.STRUCT,(StreamInfo, StreamInfo.thrift_spec)), None, ), # 2 + (3, TType.I32, 'parallelism_hint', None, None, ), # 3 + (4, TType.STRING, 'json_conf', None, None, ), # 4 + ) + + def __init__(self, inputs=None, streams=None, parallelism_hint=None, json_conf=None,): + self.inputs = inputs + self.streams = streams + self.parallelism_hint = parallelism_hint + self.json_conf = json_conf + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.MAP: + self.inputs = {} + (_ktype22, _vtype23, _size21 ) = iprot.readMapBegin() + for _i25 in xrange(_size21): + _key26 = GlobalStreamId() + _key26.read(iprot) + _val27 = Grouping() + _val27.read(iprot) + self.inputs[_key26] = _val27 + iprot.readMapEnd() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.MAP: + self.streams = {} + (_ktype29, _vtype30, _size28 ) = iprot.readMapBegin() + for _i32 in xrange(_size28): + _key33 = iprot.readString().decode('utf-8') + _val34 = StreamInfo() + _val34.read(iprot) + self.streams[_key33] = _val34 + iprot.readMapEnd() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.I32: + self.parallelism_hint = iprot.readI32(); + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRING: + self.json_conf = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('ComponentCommon') + if self.inputs is not None: + oprot.writeFieldBegin('inputs', TType.MAP, 1) + oprot.writeMapBegin(TType.STRUCT, TType.STRUCT, len(self.inputs)) + for kiter35,viter36 in self.inputs.items(): + kiter35.write(oprot) + viter36.write(oprot) + oprot.writeMapEnd() + oprot.writeFieldEnd() + if self.streams is not None: + oprot.writeFieldBegin('streams', TType.MAP, 2) + oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.streams)) + for kiter37,viter38 in self.streams.items(): + oprot.writeString(kiter37.encode('utf-8')) + viter38.write(oprot) + oprot.writeMapEnd() + oprot.writeFieldEnd() + if self.parallelism_hint is not None: + oprot.writeFieldBegin('parallelism_hint', TType.I32, 3) + oprot.writeI32(self.parallelism_hint) + oprot.writeFieldEnd() + if self.json_conf is not None: + oprot.writeFieldBegin('json_conf', TType.STRING, 4) + oprot.writeString(self.json_conf.encode('utf-8')) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.inputs is None: + raise TProtocol.TProtocolException(message='Required field inputs is unset!') + if self.streams is None: + raise TProtocol.TProtocolException(message='Required field streams is unset!') + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class SpoutSpec: + """ + Attributes: + - spout_object + - common + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'spout_object', (ComponentObject, ComponentObject.thrift_spec), None, ), # 1 + (2, TType.STRUCT, 'common', (ComponentCommon, ComponentCommon.thrift_spec), None, ), # 2 + ) + + def __init__(self, spout_object=None, common=None,): + self.spout_object = spout_object + self.common = common + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRUCT: + self.spout_object = ComponentObject() + self.spout_object.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.common = ComponentCommon() + self.common.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('SpoutSpec') + if self.spout_object is not None: + oprot.writeFieldBegin('spout_object', TType.STRUCT, 1) + self.spout_object.write(oprot) + oprot.writeFieldEnd() + if self.common is not None: + oprot.writeFieldBegin('common', TType.STRUCT, 2) + self.common.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.spout_object is None: + raise TProtocol.TProtocolException(message='Required field spout_object is unset!') + if self.common is None: + raise TProtocol.TProtocolException(message='Required field common is unset!') + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class Bolt: + """ + Attributes: + - bolt_object + - common + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'bolt_object', (ComponentObject, ComponentObject.thrift_spec), None, ), # 1 + (2, TType.STRUCT, 'common', (ComponentCommon, ComponentCommon.thrift_spec), None, ), # 2 + ) + + def __init__(self, bolt_object=None, common=None,): + self.bolt_object = bolt_object + self.common = common + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRUCT: + self.bolt_object = ComponentObject() + self.bolt_object.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.common = ComponentCommon() + self.common.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('Bolt') + if self.bolt_object is not None: + oprot.writeFieldBegin('bolt_object', TType.STRUCT, 1) + self.bolt_object.write(oprot) + oprot.writeFieldEnd() + if self.common is not None: + oprot.writeFieldBegin('common', TType.STRUCT, 2) + self.common.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.bolt_object is None: + raise TProtocol.TProtocolException(message='Required field bolt_object is unset!') + if self.common is None: + raise TProtocol.TProtocolException(message='Required field common is unset!') + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class StateSpoutSpec: + """ + Attributes: + - state_spout_object + - common + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'state_spout_object', (ComponentObject, ComponentObject.thrift_spec), None, ), # 1 + (2, TType.STRUCT, 'common', (ComponentCommon, ComponentCommon.thrift_spec), None, ), # 2 + ) + + def __init__(self, state_spout_object=None, common=None,): + self.state_spout_object = state_spout_object + self.common = common + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRUCT: + self.state_spout_object = ComponentObject() + self.state_spout_object.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.common = ComponentCommon() + self.common.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('StateSpoutSpec') + if self.state_spout_object is not None: + oprot.writeFieldBegin('state_spout_object', TType.STRUCT, 1) + self.state_spout_object.write(oprot) + oprot.writeFieldEnd() + if self.common is not None: + oprot.writeFieldBegin('common', TType.STRUCT, 2) + self.common.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.state_spout_object is None: + raise TProtocol.TProtocolException(message='Required field state_spout_object is unset!') + if self.common is None: + raise TProtocol.TProtocolException(message='Required field common is unset!') + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class StormTopology: + """ + Attributes: + - spouts + - bolts + - state_spouts + """ + + thrift_spec = ( + None, # 0 + (1, TType.MAP, 'spouts', (TType.STRING,None,TType.STRUCT,(SpoutSpec, SpoutSpec.thrift_spec)), None, ), # 1 + (2, TType.MAP, 'bolts', (TType.STRING,None,TType.STRUCT,(Bolt, Bolt.thrift_spec)), None, ), # 2 + (3, TType.MAP, 'state_spouts', (TType.STRING,None,TType.STRUCT,(StateSpoutSpec, StateSpoutSpec.thrift_spec)), None, ), # 3 + ) + + def __init__(self, spouts=None, bolts=None, state_spouts=None,): + self.spouts = spouts + self.bolts = bolts + self.state_spouts = state_spouts + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.MAP: + self.spouts = {} + (_ktype40, _vtype41, _size39 ) = iprot.readMapBegin() + for _i43 in xrange(_size39): + _key44 = iprot.readString().decode('utf-8') + _val45 = SpoutSpec() + _val45.read(iprot) + self.spouts[_key44] = _val45 + iprot.readMapEnd() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.MAP: + self.bolts = {} + (_ktype47, _vtype48, _size46 ) = iprot.readMapBegin() + for _i50 in xrange(_size46): + _key51 = iprot.readString().decode('utf-8') + _val52 = Bolt() + _val52.read(iprot) + self.bolts[_key51] = _val52 + iprot.readMapEnd() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.MAP: + self.state_spouts = {} + (_ktype54, _vtype55, _size53 ) = iprot.readMapBegin() + for _i57 in xrange(_size53): + _key58 = iprot.readString().decode('utf-8') + _val59 = StateSpoutSpec() + _val59.read(iprot) + self.state_spouts[_key58] = _val59 + iprot.readMapEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('StormTopology') + if self.spouts is not None: + oprot.writeFieldBegin('spouts', TType.MAP, 1) + oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.spouts)) + for kiter60,viter61 in self.spouts.items(): + oprot.writeString(kiter60.encode('utf-8')) + viter61.write(oprot) + oprot.writeMapEnd() + oprot.writeFieldEnd() + if self.bolts is not None: + oprot.writeFieldBegin('bolts', TType.MAP, 2) + oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.bolts)) + for kiter62,viter63 in self.bolts.items(): + oprot.writeString(kiter62.encode('utf-8')) + viter63.write(oprot) + oprot.writeMapEnd() + oprot.writeFieldEnd() + if self.state_spouts is not None: + oprot.writeFieldBegin('state_spouts', TType.MAP, 3) + oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.state_spouts)) + for kiter64,viter65 in self.state_spouts.items(): + oprot.writeString(kiter64.encode('utf-8')) + viter65.write(oprot) + oprot.writeMapEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.spouts is None: + raise TProtocol.TProtocolException(message='Required field spouts is unset!') + if self.bolts is None: + raise TProtocol.TProtocolException(message='Required field bolts is unset!') + if self.state_spouts is None: + raise TProtocol.TProtocolException(message='Required field state_spouts is unset!') + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class AlreadyAliveException(TException): + """ + Attributes: + - msg + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'msg', None, None, ), # 1 + ) + + def __init__(self, msg=None,): + self.msg = msg + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.msg = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('AlreadyAliveException') + if self.msg is not None: + oprot.writeFieldBegin('msg', TType.STRING, 1) + oprot.writeString(self.msg.encode('utf-8')) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.msg is None: + raise TProtocol.TProtocolException(message='Required field msg is unset!') + return + + + def __str__(self): + return repr(self) + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class NotAliveException(TException): + """ + Attributes: + - msg + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'msg', None, None, ), # 1 + ) + + def __init__(self, msg=None,): + self.msg = msg + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.msg = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('NotAliveException') + if self.msg is not None: + oprot.writeFieldBegin('msg', TType.STRING, 1) + oprot.writeString(self.msg.encode('utf-8')) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.msg is None: + raise TProtocol.TProtocolException(message='Required field msg is unset!') + return + + + def __str__(self): + return repr(self) + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class InvalidTopologyException(TException): + """ + Attributes: + - msg + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'msg', None, None, ), # 1 + ) + + def __init__(self, msg=None,): + self.msg = msg + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.msg = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('InvalidTopologyException') + if self.msg is not None: + oprot.writeFieldBegin('msg', TType.STRING, 1) + oprot.writeString(self.msg.encode('utf-8')) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.msg is None: + raise TProtocol.TProtocolException(message='Required field msg is unset!') + return + + + def __str__(self): + return repr(self) + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class TopologySummary: + """ + Attributes: + - id + - name + - num_tasks + - num_workers + - uptime_secs + - status + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'id', None, None, ), # 1 + (2, TType.STRING, 'name', None, None, ), # 2 + (3, TType.I32, 'num_tasks', None, None, ), # 3 + (4, TType.I32, 'num_workers', None, None, ), # 4 + (5, TType.I32, 'uptime_secs', None, None, ), # 5 + (6, TType.STRING, 'status', None, None, ), # 6 + ) + + def __init__(self, id=None, name=None, num_tasks=None, num_workers=None, uptime_secs=None, status=None,): + self.id = id + self.name = name + self.num_tasks = num_tasks + self.num_workers = num_workers + self.uptime_secs = uptime_secs + self.status = status + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.id = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.name = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.I32: + self.num_tasks = iprot.readI32(); + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.I32: + self.num_workers = iprot.readI32(); + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.I32: + self.uptime_secs = iprot.readI32(); + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.STRING: + self.status = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('TopologySummary') + if self.id is not None: + oprot.writeFieldBegin('id', TType.STRING, 1) + oprot.writeString(self.id.encode('utf-8')) + oprot.writeFieldEnd() + if self.name is not None: + oprot.writeFieldBegin('name', TType.STRING, 2) + oprot.writeString(self.name.encode('utf-8')) + oprot.writeFieldEnd() + if self.num_tasks is not None: + oprot.writeFieldBegin('num_tasks', TType.I32, 3) + oprot.writeI32(self.num_tasks) + oprot.writeFieldEnd() + if self.num_workers is not None: + oprot.writeFieldBegin('num_workers', TType.I32, 4) + oprot.writeI32(self.num_workers) + oprot.writeFieldEnd() + if self.uptime_secs is not None: + oprot.writeFieldBegin('uptime_secs', TType.I32, 5) + oprot.writeI32(self.uptime_secs) + oprot.writeFieldEnd() + if self.status is not None: + oprot.writeFieldBegin('status', TType.STRING, 6) + oprot.writeString(self.status.encode('utf-8')) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.id is None: + raise TProtocol.TProtocolException(message='Required field id is unset!') + if self.name is None: + raise TProtocol.TProtocolException(message='Required field name is unset!') + if self.num_tasks is None: + raise TProtocol.TProtocolException(message='Required field num_tasks is unset!') + if self.num_workers is None: + raise TProtocol.TProtocolException(message='Required field num_workers is unset!') + if self.uptime_secs is None: + raise TProtocol.TProtocolException(message='Required field uptime_secs is unset!') + if self.status is None: + raise TProtocol.TProtocolException(message='Required field status is unset!') + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class SupervisorSummary: + """ + Attributes: + - host + - uptime_secs + - num_workers + - num_used_workers + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'host', None, None, ), # 1 + (2, TType.I32, 'uptime_secs', None, None, ), # 2 + (3, TType.I32, 'num_workers', None, None, ), # 3 + (4, TType.I32, 'num_used_workers', None, None, ), # 4 + ) + + def __init__(self, host=None, uptime_secs=None, num_workers=None, num_used_workers=None,): + self.host = host + self.uptime_secs = uptime_secs + self.num_workers = num_workers + self.num_used_workers = num_used_workers + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.host = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.I32: + self.uptime_secs = iprot.readI32(); + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.I32: + self.num_workers = iprot.readI32(); + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.I32: + self.num_used_workers = iprot.readI32(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('SupervisorSummary') + if self.host is not None: + oprot.writeFieldBegin('host', TType.STRING, 1) + oprot.writeString(self.host.encode('utf-8')) + oprot.writeFieldEnd() + if self.uptime_secs is not None: + oprot.writeFieldBegin('uptime_secs', TType.I32, 2) + oprot.writeI32(self.uptime_secs) + oprot.writeFieldEnd() + if self.num_workers is not None: + oprot.writeFieldBegin('num_workers', TType.I32, 3) + oprot.writeI32(self.num_workers) + oprot.writeFieldEnd() + if self.num_used_workers is not None: + oprot.writeFieldBegin('num_used_workers', TType.I32, 4) + oprot.writeI32(self.num_used_workers) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.host is None: + raise TProtocol.TProtocolException(message='Required field host is unset!') + if self.uptime_secs is None: + raise TProtocol.TProtocolException(message='Required field uptime_secs is unset!') + if self.num_workers is None: + raise TProtocol.TProtocolException(message='Required field num_workers is unset!') + if self.num_used_workers is None: + raise TProtocol.TProtocolException(message='Required field num_used_workers is unset!') + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class ClusterSummary: + """ + Attributes: + - supervisors + - nimbus_uptime_secs + - topologies + """ + + thrift_spec = ( + None, # 0 + (1, TType.LIST, 'supervisors', (TType.STRUCT,(SupervisorSummary, SupervisorSummary.thrift_spec)), None, ), # 1 + (2, TType.I32, 'nimbus_uptime_secs', None, None, ), # 2 + (3, TType.LIST, 'topologies', (TType.STRUCT,(TopologySummary, TopologySummary.thrift_spec)), None, ), # 3 + ) + + def __init__(self, supervisors=None, nimbus_uptime_secs=None, topologies=None,): + self.supervisors = supervisors + self.nimbus_uptime_secs = nimbus_uptime_secs + self.topologies = topologies + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.LIST: + self.supervisors = [] + (_etype69, _size66) = iprot.readListBegin() + for _i70 in xrange(_size66): + _elem71 = SupervisorSummary() + _elem71.read(iprot) + self.supervisors.append(_elem71) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.I32: + self.nimbus_uptime_secs = iprot.readI32(); + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.LIST: + self.topologies = [] + (_etype75, _size72) = iprot.readListBegin() + for _i76 in xrange(_size72): + _elem77 = TopologySummary() + _elem77.read(iprot) + self.topologies.append(_elem77) + iprot.readListEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('ClusterSummary') + if self.supervisors is not None: + oprot.writeFieldBegin('supervisors', TType.LIST, 1) + oprot.writeListBegin(TType.STRUCT, len(self.supervisors)) + for iter78 in self.supervisors: + iter78.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.nimbus_uptime_secs is not None: + oprot.writeFieldBegin('nimbus_uptime_secs', TType.I32, 2) + oprot.writeI32(self.nimbus_uptime_secs) + oprot.writeFieldEnd() + if self.topologies is not None: + oprot.writeFieldBegin('topologies', TType.LIST, 3) + oprot.writeListBegin(TType.STRUCT, len(self.topologies)) + for iter79 in self.topologies: + iter79.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.supervisors is None: + raise TProtocol.TProtocolException(message='Required field supervisors is unset!') + if self.nimbus_uptime_secs is None: + raise TProtocol.TProtocolException(message='Required field nimbus_uptime_secs is unset!') + if self.topologies is None: + raise TProtocol.TProtocolException(message='Required field topologies is unset!') + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class ErrorInfo: + """ + Attributes: + - error + - error_time_secs + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'error', None, None, ), # 1 + (2, TType.I32, 'error_time_secs', None, None, ), # 2 + ) + + def __init__(self, error=None, error_time_secs=None,): + self.error = error + self.error_time_secs = error_time_secs + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.error = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.I32: + self.error_time_secs = iprot.readI32(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('ErrorInfo') + if self.error is not None: + oprot.writeFieldBegin('error', TType.STRING, 1) + oprot.writeString(self.error.encode('utf-8')) + oprot.writeFieldEnd() + if self.error_time_secs is not None: + oprot.writeFieldBegin('error_time_secs', TType.I32, 2) + oprot.writeI32(self.error_time_secs) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.error is None: + raise TProtocol.TProtocolException(message='Required field error is unset!') + if self.error_time_secs is None: + raise TProtocol.TProtocolException(message='Required field error_time_secs is unset!') + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class TaskStats: + """ + Attributes: + - emitted + - send_tps + - recv_tps + - acked + - failed + - process_ms_avg + """ + + thrift_spec = ( + None, # 0 + (1, TType.MAP, 'emitted', (TType.STRING,None,TType.MAP,(TType.STRING,None,TType.I64,None)), None, ), # 1 + (2, TType.MAP, 'send_tps', (TType.STRING,None,TType.MAP,(TType.STRING,None,TType.DOUBLE,None)), None, ), # 2 + (3, TType.MAP, 'recv_tps', (TType.STRING,None,TType.MAP,(TType.STRUCT,(GlobalStreamId, GlobalStreamId.thrift_spec),TType.DOUBLE,None)), None, ), # 3 + (4, TType.MAP, 'acked', (TType.STRING,None,TType.MAP,(TType.STRUCT,(GlobalStreamId, GlobalStreamId.thrift_spec),TType.I64,None)), None, ), # 4 + (5, TType.MAP, 'failed', (TType.STRING,None,TType.MAP,(TType.STRUCT,(GlobalStreamId, GlobalStreamId.thrift_spec),TType.I64,None)), None, ), # 5 + (6, TType.MAP, 'process_ms_avg', (TType.STRING,None,TType.MAP,(TType.STRUCT,(GlobalStreamId, GlobalStreamId.thrift_spec),TType.DOUBLE,None)), None, ), # 6 + ) + + def __init__(self, emitted=None, send_tps=None, recv_tps=None, acked=None, failed=None, process_ms_avg=None,): + self.emitted = emitted + self.send_tps = send_tps + self.recv_tps = recv_tps + self.acked = acked + self.failed = failed + self.process_ms_avg = process_ms_avg + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.MAP: + self.emitted = {} + (_ktype81, _vtype82, _size80 ) = iprot.readMapBegin() + for _i84 in xrange(_size80): + _key85 = iprot.readString().decode('utf-8') + _val86 = {} + (_ktype88, _vtype89, _size87 ) = iprot.readMapBegin() + for _i91 in xrange(_size87): + _key92 = iprot.readString().decode('utf-8') + _val93 = iprot.readI64(); + _val86[_key92] = _val93 + iprot.readMapEnd() + self.emitted[_key85] = _val86 + iprot.readMapEnd() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.MAP: + self.send_tps = {} + (_ktype95, _vtype96, _size94 ) = iprot.readMapBegin() + for _i98 in xrange(_size94): + _key99 = iprot.readString().decode('utf-8') + _val100 = {} + (_ktype102, _vtype103, _size101 ) = iprot.readMapBegin() + for _i105 in xrange(_size101): + _key106 = iprot.readString().decode('utf-8') + _val107 = iprot.readDouble(); + _val100[_key106] = _val107 + iprot.readMapEnd() + self.send_tps[_key99] = _val100 + iprot.readMapEnd() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.MAP: + self.recv_tps = {} + (_ktype109, _vtype110, _size108 ) = iprot.readMapBegin() + for _i112 in xrange(_size108): + _key113 = iprot.readString().decode('utf-8') + _val114 = {} + (_ktype116, _vtype117, _size115 ) = iprot.readMapBegin() + for _i119 in xrange(_size115): + _key120 = GlobalStreamId() + _key120.read(iprot) + _val121 = iprot.readDouble(); + _val114[_key120] = _val121 + iprot.readMapEnd() + self.recv_tps[_key113] = _val114 + iprot.readMapEnd() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.MAP: + self.acked = {} + (_ktype123, _vtype124, _size122 ) = iprot.readMapBegin() + for _i126 in xrange(_size122): + _key127 = iprot.readString().decode('utf-8') + _val128 = {} + (_ktype130, _vtype131, _size129 ) = iprot.readMapBegin() + for _i133 in xrange(_size129): + _key134 = GlobalStreamId() + _key134.read(iprot) + _val135 = iprot.readI64(); + _val128[_key134] = _val135 + iprot.readMapEnd() + self.acked[_key127] = _val128 + iprot.readMapEnd() + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.MAP: + self.failed = {} + (_ktype137, _vtype138, _size136 ) = iprot.readMapBegin() + for _i140 in xrange(_size136): + _key141 = iprot.readString().decode('utf-8') + _val142 = {} + (_ktype144, _vtype145, _size143 ) = iprot.readMapBegin() + for _i147 in xrange(_size143): + _key148 = GlobalStreamId() + _key148.read(iprot) + _val149 = iprot.readI64(); + _val142[_key148] = _val149 + iprot.readMapEnd() + self.failed[_key141] = _val142 + iprot.readMapEnd() + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.MAP: + self.process_ms_avg = {} + (_ktype151, _vtype152, _size150 ) = iprot.readMapBegin() + for _i154 in xrange(_size150): + _key155 = iprot.readString().decode('utf-8') + _val156 = {} + (_ktype158, _vtype159, _size157 ) = iprot.readMapBegin() + for _i161 in xrange(_size157): + _key162 = GlobalStreamId() + _key162.read(iprot) + _val163 = iprot.readDouble(); + _val156[_key162] = _val163 + iprot.readMapEnd() + self.process_ms_avg[_key155] = _val156 + iprot.readMapEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('TaskStats') + if self.emitted is not None: + oprot.writeFieldBegin('emitted', TType.MAP, 1) + oprot.writeMapBegin(TType.STRING, TType.MAP, len(self.emitted)) + for kiter164,viter165 in self.emitted.items(): + oprot.writeString(kiter164.encode('utf-8')) + oprot.writeMapBegin(TType.STRING, TType.I64, len(viter165)) + for kiter166,viter167 in viter165.items(): + oprot.writeString(kiter166.encode('utf-8')) + oprot.writeI64(viter167) + oprot.writeMapEnd() + oprot.writeMapEnd() + oprot.writeFieldEnd() + if self.send_tps is not None: + oprot.writeFieldBegin('send_tps', TType.MAP, 2) + oprot.writeMapBegin(TType.STRING, TType.MAP, len(self.send_tps)) + for kiter168,viter169 in self.send_tps.items(): + oprot.writeString(kiter168.encode('utf-8')) + oprot.writeMapBegin(TType.STRING, TType.DOUBLE, len(viter169)) + for kiter170,viter171 in viter169.items(): + oprot.writeString(kiter170.encode('utf-8')) + oprot.writeDouble(viter171) + oprot.writeMapEnd() + oprot.writeMapEnd() + oprot.writeFieldEnd() + if self.recv_tps is not None: + oprot.writeFieldBegin('recv_tps', TType.MAP, 3) + oprot.writeMapBegin(TType.STRING, TType.MAP, len(self.recv_tps)) + for kiter172,viter173 in self.recv_tps.items(): + oprot.writeString(kiter172.encode('utf-8')) + oprot.writeMapBegin(TType.STRUCT, TType.DOUBLE, len(viter173)) + for kiter174,viter175 in viter173.items(): + kiter174.write(oprot) + oprot.writeDouble(viter175) + oprot.writeMapEnd() + oprot.writeMapEnd() + oprot.writeFieldEnd() + if self.acked is not None: + oprot.writeFieldBegin('acked', TType.MAP, 4) + oprot.writeMapBegin(TType.STRING, TType.MAP, len(self.acked)) + for kiter176,viter177 in self.acked.items(): + oprot.writeString(kiter176.encode('utf-8')) + oprot.writeMapBegin(TType.STRUCT, TType.I64, len(viter177)) + for kiter178,viter179 in viter177.items(): + kiter178.write(oprot) + oprot.writeI64(viter179) + oprot.writeMapEnd() + oprot.writeMapEnd() + oprot.writeFieldEnd() + if self.failed is not None: + oprot.writeFieldBegin('failed', TType.MAP, 5) + oprot.writeMapBegin(TType.STRING, TType.MAP, len(self.failed)) + for kiter180,viter181 in self.failed.items(): + oprot.writeString(kiter180.encode('utf-8')) + oprot.writeMapBegin(TType.STRUCT, TType.I64, len(viter181)) + for kiter182,viter183 in viter181.items(): + kiter182.write(oprot) + oprot.writeI64(viter183) + oprot.writeMapEnd() + oprot.writeMapEnd() + oprot.writeFieldEnd() + if self.process_ms_avg is not None: + oprot.writeFieldBegin('process_ms_avg', TType.MAP, 6) + oprot.writeMapBegin(TType.STRING, TType.MAP, len(self.process_ms_avg)) + for kiter184,viter185 in self.process_ms_avg.items(): + oprot.writeString(kiter184.encode('utf-8')) + oprot.writeMapBegin(TType.STRUCT, TType.DOUBLE, len(viter185)) + for kiter186,viter187 in viter185.items(): + kiter186.write(oprot) + oprot.writeDouble(viter187) + oprot.writeMapEnd() + oprot.writeMapEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.emitted is None: + raise TProtocol.TProtocolException(message='Required field emitted is unset!') + if self.send_tps is None: + raise TProtocol.TProtocolException(message='Required field send_tps is unset!') + if self.recv_tps is None: + raise TProtocol.TProtocolException(message='Required field recv_tps is unset!') + if self.acked is None: + raise TProtocol.TProtocolException(message='Required field acked is unset!') + if self.failed is None: + raise TProtocol.TProtocolException(message='Required field failed is unset!') + if self.process_ms_avg is None: + raise TProtocol.TProtocolException(message='Required field process_ms_avg is unset!') + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class TaskSummary: + """ + Attributes: + - task_id + - component_id + - host + - port + - uptime_secs + - errors + - stats + """ + + thrift_spec = ( + None, # 0 + (1, TType.I32, 'task_id', None, None, ), # 1 + (2, TType.STRING, 'component_id', None, None, ), # 2 + (3, TType.STRING, 'host', None, None, ), # 3 + (4, TType.I32, 'port', None, None, ), # 4 + (5, TType.I32, 'uptime_secs', None, None, ), # 5 + (6, TType.LIST, 'errors', (TType.STRUCT,(ErrorInfo, ErrorInfo.thrift_spec)), None, ), # 6 + (7, TType.STRUCT, 'stats', (TaskStats, TaskStats.thrift_spec), None, ), # 7 + ) + + def __init__(self, task_id=None, component_id=None, host=None, port=None, uptime_secs=None, errors=None, stats=None,): + self.task_id = task_id + self.component_id = component_id + self.host = host + self.port = port + self.uptime_secs = uptime_secs + self.errors = errors + self.stats = stats + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.I32: + self.task_id = iprot.readI32(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.component_id = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.host = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.I32: + self.port = iprot.readI32(); + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.I32: + self.uptime_secs = iprot.readI32(); + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.LIST: + self.errors = [] + (_etype191, _size188) = iprot.readListBegin() + for _i192 in xrange(_size188): + _elem193 = ErrorInfo() + _elem193.read(iprot) + self.errors.append(_elem193) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 7: + if ftype == TType.STRUCT: + self.stats = TaskStats() + self.stats.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('TaskSummary') + if self.task_id is not None: + oprot.writeFieldBegin('task_id', TType.I32, 1) + oprot.writeI32(self.task_id) + oprot.writeFieldEnd() + if self.component_id is not None: + oprot.writeFieldBegin('component_id', TType.STRING, 2) + oprot.writeString(self.component_id.encode('utf-8')) + oprot.writeFieldEnd() + if self.host is not None: + oprot.writeFieldBegin('host', TType.STRING, 3) + oprot.writeString(self.host.encode('utf-8')) + oprot.writeFieldEnd() + if self.port is not None: + oprot.writeFieldBegin('port', TType.I32, 4) + oprot.writeI32(self.port) + oprot.writeFieldEnd() + if self.uptime_secs is not None: + oprot.writeFieldBegin('uptime_secs', TType.I32, 5) + oprot.writeI32(self.uptime_secs) + oprot.writeFieldEnd() + if self.errors is not None: + oprot.writeFieldBegin('errors', TType.LIST, 6) + oprot.writeListBegin(TType.STRUCT, len(self.errors)) + for iter194 in self.errors: + iter194.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.stats is not None: + oprot.writeFieldBegin('stats', TType.STRUCT, 7) + self.stats.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.task_id is None: + raise TProtocol.TProtocolException(message='Required field task_id is unset!') + if self.component_id is None: + raise TProtocol.TProtocolException(message='Required field component_id is unset!') + if self.host is None: + raise TProtocol.TProtocolException(message='Required field host is unset!') + if self.port is None: + raise TProtocol.TProtocolException(message='Required field port is unset!') + if self.uptime_secs is None: + raise TProtocol.TProtocolException(message='Required field uptime_secs is unset!') + if self.errors is None: + raise TProtocol.TProtocolException(message='Required field errors is unset!') + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class TopologyInfo: + """ + Attributes: + - id + - name + - uptime_secs + - tasks + - status + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'id', None, None, ), # 1 + (2, TType.STRING, 'name', None, None, ), # 2 + (3, TType.I32, 'uptime_secs', None, None, ), # 3 + (4, TType.LIST, 'tasks', (TType.STRUCT,(TaskSummary, TaskSummary.thrift_spec)), None, ), # 4 + (5, TType.STRING, 'status', None, None, ), # 5 + ) + + def __init__(self, id=None, name=None, uptime_secs=None, tasks=None, status=None,): + self.id = id + self.name = name + self.uptime_secs = uptime_secs + self.tasks = tasks + self.status = status + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.id = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.name = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.I32: + self.uptime_secs = iprot.readI32(); + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.LIST: + self.tasks = [] + (_etype198, _size195) = iprot.readListBegin() + for _i199 in xrange(_size195): + _elem200 = TaskSummary() + _elem200.read(iprot) + self.tasks.append(_elem200) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.STRING: + self.status = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('TopologyInfo') + if self.id is not None: + oprot.writeFieldBegin('id', TType.STRING, 1) + oprot.writeString(self.id.encode('utf-8')) + oprot.writeFieldEnd() + if self.name is not None: + oprot.writeFieldBegin('name', TType.STRING, 2) + oprot.writeString(self.name.encode('utf-8')) + oprot.writeFieldEnd() + if self.uptime_secs is not None: + oprot.writeFieldBegin('uptime_secs', TType.I32, 3) + oprot.writeI32(self.uptime_secs) + oprot.writeFieldEnd() + if self.tasks is not None: + oprot.writeFieldBegin('tasks', TType.LIST, 4) + oprot.writeListBegin(TType.STRUCT, len(self.tasks)) + for iter201 in self.tasks: + iter201.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.status is not None: + oprot.writeFieldBegin('status', TType.STRING, 5) + oprot.writeString(self.status.encode('utf-8')) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.id is None: + raise TProtocol.TProtocolException(message='Required field id is unset!') + if self.name is None: + raise TProtocol.TProtocolException(message='Required field name is unset!') + if self.uptime_secs is None: + raise TProtocol.TProtocolException(message='Required field uptime_secs is unset!') + if self.tasks is None: + raise TProtocol.TProtocolException(message='Required field tasks is unset!') + if self.status is None: + raise TProtocol.TProtocolException(message='Required field status is unset!') + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class WorkerSummary: + """ + Attributes: + - port + - topology + - tasks + """ + + thrift_spec = ( + None, # 0 + (1, TType.I32, 'port', None, None, ), # 1 + (2, TType.STRING, 'topology', None, None, ), # 2 + (3, TType.LIST, 'tasks', (TType.STRUCT,(TaskSummary, TaskSummary.thrift_spec)), None, ), # 3 + ) + + def __init__(self, port=None, topology=None, tasks=None,): + self.port = port + self.topology = topology + self.tasks = tasks + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.I32: + self.port = iprot.readI32(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.topology = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.LIST: + self.tasks = [] + (_etype205, _size202) = iprot.readListBegin() + for _i206 in xrange(_size202): + _elem207 = TaskSummary() + _elem207.read(iprot) + self.tasks.append(_elem207) + iprot.readListEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('WorkerSummary') + if self.port is not None: + oprot.writeFieldBegin('port', TType.I32, 1) + oprot.writeI32(self.port) + oprot.writeFieldEnd() + if self.topology is not None: + oprot.writeFieldBegin('topology', TType.STRING, 2) + oprot.writeString(self.topology.encode('utf-8')) + oprot.writeFieldEnd() + if self.tasks is not None: + oprot.writeFieldBegin('tasks', TType.LIST, 3) + oprot.writeListBegin(TType.STRUCT, len(self.tasks)) + for iter208 in self.tasks: + iter208.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.port is None: + raise TProtocol.TProtocolException(message='Required field port is unset!') + if self.topology is None: + raise TProtocol.TProtocolException(message='Required field topology is unset!') + if self.tasks is None: + raise TProtocol.TProtocolException(message='Required field tasks is unset!') + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class SupervisorWorkers: + """ + Attributes: + - supervisor + - workers + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'supervisor', (SupervisorSummary, SupervisorSummary.thrift_spec), None, ), # 1 + (2, TType.LIST, 'workers', (TType.STRUCT,(WorkerSummary, WorkerSummary.thrift_spec)), None, ), # 2 + ) + + def __init__(self, supervisor=None, workers=None,): + self.supervisor = supervisor + self.workers = workers + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRUCT: + self.supervisor = SupervisorSummary() + self.supervisor.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.LIST: + self.workers = [] + (_etype212, _size209) = iprot.readListBegin() + for _i213 in xrange(_size209): + _elem214 = WorkerSummary() + _elem214.read(iprot) + self.workers.append(_elem214) + iprot.readListEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('SupervisorWorkers') + if self.supervisor is not None: + oprot.writeFieldBegin('supervisor', TType.STRUCT, 1) + self.supervisor.write(oprot) + oprot.writeFieldEnd() + if self.workers is not None: + oprot.writeFieldBegin('workers', TType.LIST, 2) + oprot.writeListBegin(TType.STRUCT, len(self.workers)) + for iter215 in self.workers: + iter215.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.supervisor is None: + raise TProtocol.TProtocolException(message='Required field supervisor is unset!') + if self.workers is None: + raise TProtocol.TProtocolException(message='Required field workers is unset!') + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class KillOptions: + """ + Attributes: + - wait_secs + """ + + thrift_spec = ( + None, # 0 + (1, TType.I32, 'wait_secs', None, None, ), # 1 + ) + + def __init__(self, wait_secs=None,): + self.wait_secs = wait_secs + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.I32: + self.wait_secs = iprot.readI32(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('KillOptions') + if self.wait_secs is not None: + oprot.writeFieldBegin('wait_secs', TType.I32, 1) + oprot.writeI32(self.wait_secs) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class RebalanceOptions: + """ + Attributes: + - wait_secs + """ + + thrift_spec = ( + None, # 0 + (1, TType.I32, 'wait_secs', None, None, ), # 1 + ) + + def __init__(self, wait_secs=None,): + self.wait_secs = wait_secs + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.I32: + self.wait_secs = iprot.readI32(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('RebalanceOptions') + if self.wait_secs is not None: + oprot.writeFieldBegin('wait_secs', TType.I32, 1) + oprot.writeI32(self.wait_secs) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class DRPCRequest: + """ + Attributes: + - func_args + - request_id + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'func_args', None, None, ), # 1 + (2, TType.STRING, 'request_id', None, None, ), # 2 + ) + + def __init__(self, func_args=None, request_id=None,): + self.func_args = func_args + self.request_id = request_id + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.func_args = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.request_id = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('DRPCRequest') + if self.func_args is not None: + oprot.writeFieldBegin('func_args', TType.STRING, 1) + oprot.writeString(self.func_args.encode('utf-8')) + oprot.writeFieldEnd() + if self.request_id is not None: + oprot.writeFieldBegin('request_id', TType.STRING, 2) + oprot.writeString(self.request_id.encode('utf-8')) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.func_args is None: + raise TProtocol.TProtocolException(message='Required field func_args is unset!') + if self.request_id is None: + raise TProtocol.TProtocolException(message='Required field request_id is unset!') + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class DRPCExecutionException(TException): + """ + Attributes: + - msg + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'msg', None, None, ), # 1 + ) + + def __init__(self, msg=None,): + self.msg = msg + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.msg = iprot.readString().decode('utf-8') + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('DRPCExecutionException') + if self.msg is not None: + oprot.writeFieldBegin('msg', TType.STRING, 1) + oprot.writeString(self.msg.encode('utf-8')) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.msg is None: + raise TProtocol.TProtocolException(message='Required field msg is unset!') + return + + + def __str__(self): + return repr(self) + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) diff --git a/jstorm-server/bin/jstorm.py b/jstorm-server/bin/jstorm.py index f1c722b17..b37b7bd8b 100644 --- a/jstorm-server/bin/jstorm.py +++ b/jstorm-server/bin/jstorm.py @@ -321,3 +321,4 @@ def main(): if __name__ == "__main__": main() + \ No newline at end of file diff --git a/jstorm-server/conf/jstorm.log4j.properties b/jstorm-server/conf/jstorm.log4j.properties index d575ba586..7bf1ee4b3 100644 --- a/jstorm-server/conf/jstorm.log4j.properties +++ b/jstorm-server/conf/jstorm.log4j.properties @@ -23,3 +23,4 @@ log4j.appender.D.Threshold = INFO log4j.appender.D.DatePattern = '.'yyyMMdd log4j.appender.D.layout = org.apache.log4j.PatternLayout log4j.appender.D.layout.ConversionPattern = [%p %d{yyyy-MM-dd HH:mm:ss} %c{1}:%L %t] %m%n + \ No newline at end of file diff --git a/jstorm-server/conf/storm.yaml b/jstorm-server/conf/storm.yaml index d55a1b5ae..86ee48c6a 100644 --- a/jstorm-server/conf/storm.yaml +++ b/jstorm-server/conf/storm.yaml @@ -20,6 +20,6 @@ drpc.servers: - "localhost" - + diff --git a/jstorm-server/src/main/java/com/alipay/dw/jstorm/daemon/nimbus/ServiceHandler.java b/jstorm-server/src/main/java/com/alipay/dw/jstorm/daemon/nimbus/ServiceHandler.java index 1338eaefe..10e3d2e13 100644 --- a/jstorm-server/src/main/java/com/alipay/dw/jstorm/daemon/nimbus/ServiceHandler.java +++ b/jstorm-server/src/main/java/com/alipay/dw/jstorm/daemon/nimbus/ServiceHandler.java @@ -299,8 +299,14 @@ public void rebalance(String topologyName, RebalanceOptions options) throws NotAliveException, TException { try { + checkTopologyActive(data, topologyName, true); + Integer wait_amt = null; + if (options!= null && options.is_set_wait_secs()) { + wait_amt = options.get_wait_secs(); + } + NimbusUtils.transitionName(data, topologyName, true, - StatusType.rebalance); + StatusType.rebalance, wait_amt); } catch (NotAliveException e) { String errMsg = "Rebalance Error, no this topology " + topologyName; LOG.error(errMsg, e); @@ -678,7 +684,7 @@ public TopologyInfo getTopologyInfo(String topologyId) Assignment assignment = stormClusterState.assignment_info( topologyId, null); if (assignment == null) { - throw new TException("Failed to get StormBase from ZK of " + throw new TException("Failed to get Assignment from ZK of " + topologyId); } Map taskToNodePort = assignment @@ -745,10 +751,10 @@ public TopologyInfo getTopologyInfo(String topologyId) taskSummarys, extractStatusStr(base)); } catch (TException e) { - LOG.info("Failed to get topologyInfo" + topologyId, e); + LOG.info("Failed to get topologyInfo " + topologyId, e); throw e; } catch (Exception e) { - LOG.info("Failed to get topologyInfo" + topologyId, e); + LOG.info("Failed to get topologyInfo " + topologyId, e); throw new TException("Failed to get topologyInfo" + topologyId); } diff --git a/jstorm-server/src/main/java/com/alipay/dw/jstorm/daemon/nimbus/TopologyAssign.java b/jstorm-server/src/main/java/com/alipay/dw/jstorm/daemon/nimbus/TopologyAssign.java index 95985c7c4..29ab8205e 100644 --- a/jstorm-server/src/main/java/com/alipay/dw/jstorm/daemon/nimbus/TopologyAssign.java +++ b/jstorm-server/src/main/java/com/alipay/dw/jstorm/daemon/nimbus/TopologyAssign.java @@ -311,7 +311,7 @@ public Assignment mkAssignment(String topologyId, boolean isScratch) Map nodeHost = getTopologyNodeHost(supervisorMap, existingAssignment, taskNodePort); - Map startTimes = getTaskStartTimes( + Map startTimes = getTaskStartTimes(nimbusData, topologyId, existingAssignment, taskNodePort); String codeDir = StormConfig.masterStormdistRoot(conf, topologyId); @@ -336,8 +336,12 @@ public Assignment mkAssignment(String topologyId, boolean isScratch) * @param taskNodePort * @return */ - public static Map getTaskStartTimes( - Assignment existingAssignment, Map taskNodePort) { + public static Map getTaskStartTimes(NimbusData nimbusData, + String topologyId, + Assignment existingAssignment, Map taskNodePort) + throws Exception{ + + StormClusterState stormClusterState = nimbusData.getStormClusterState(); Map startTimes = new HashMap(); @@ -360,6 +364,7 @@ public static Map getTaskStartTimes( int nowSecs = TimeUtils.current_time_secs(); for (Integer changedTaskId : changeTaskIds) { startTimes.put(changedTaskId, nowSecs); + stormClusterState.remove_task_heartbeat(topologyId, changedTaskId); } return startTimes; @@ -713,7 +718,7 @@ public static List sortSlots(Set allSlots, Collections.sort(splitup, new Comparator> () { public int compare(List o1, List o2) { - return o1.size() - o2.size(); + return o2.size() - o1.size(); } }); diff --git a/jstorm-server/src/main/resources/defaults.yaml b/jstorm-server/src/main/resources/defaults.yaml index 16836da35..a28fd86fd 100644 --- a/jstorm-server/src/main/resources/defaults.yaml +++ b/jstorm-server/src/main/resources/defaults.yaml @@ -83,4 +83,4 @@ topology.fall.back.on.java.serialization: true topology.worker.childopts: null topology.debug.recv.tuple: false -spout.delay.run: 10 +spout.delay.run: 30 diff --git a/pom.xml b/pom.xml index b887e09c3..48fcd72f9 100644 --- a/pom.xml +++ b/pom.xml @@ -196,7 +196,7 @@ org.apache.thrift libthrift - 0.7.0 + 0.8.0 clj-time diff --git a/release/jstorm-0.7.1.zip b/release/jstorm-0.7.1.zip index 5fe74478c..75ce58eae 100644 Binary files a/release/jstorm-0.7.1.zip and b/release/jstorm-0.7.1.zip differ