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