Repository: airavata Updated Branches: refs/heads/master c6d78a45b -> b9c9d2456
http://git-wip-us.apache.org/repos/asf/airavata/blob/b9c9d245/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/cpi/OrchestratorService.java ---------------------------------------------------------------------- diff --git a/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/cpi/OrchestratorService.java b/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/cpi/OrchestratorService.java index 1421cad..bbdd53b 100644 --- a/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/cpi/OrchestratorService.java +++ b/modules/orchestrator/airavata-orchestrator-service/src/main/java/org/apache/airavata/orchestrator/cpi/OrchestratorService.java @@ -72,6 +72,19 @@ import org.slf4j.LoggerFactory; public boolean launchExperiment(String experimentId) throws org.apache.thrift.TException; /** + * * In order to run single applications users should create an associating + * * WorkflowNodeDetails and a TaskDetails for it and hand it over for execution + * * + * * @param taskId + * * @return sucess/failure + * * + * * + * + * @param taskId + */ + public boolean launchTask(String taskId) throws org.apache.thrift.TException; + + /** * * * * Validate funcations which can verify if the experiment is ready to be launced. * * @@ -105,6 +118,8 @@ import org.slf4j.LoggerFactory; public void launchExperiment(String experimentId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void launchTask(String taskId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void validateExperiment(String experimentId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void terminateExperiment(String experimentId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; @@ -176,6 +191,29 @@ import org.slf4j.LoggerFactory; throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "launchExperiment failed: unknown result"); } + public boolean launchTask(String taskId) throws org.apache.thrift.TException + { + send_launchTask(taskId); + return recv_launchTask(); + } + + public void send_launchTask(String taskId) throws org.apache.thrift.TException + { + launchTask_args args = new launchTask_args(); + args.setTaskId(taskId); + sendBase("launchTask", args); + } + + public boolean recv_launchTask() throws org.apache.thrift.TException + { + launchTask_result result = new launchTask_result(); + receiveBase(result, "launchTask"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "launchTask failed: unknown result"); + } + public boolean validateExperiment(String experimentId) throws org.apache.airavata.model.error.LaunchValidationException, org.apache.thrift.TException { send_validateExperiment(experimentId); @@ -304,6 +342,38 @@ import org.slf4j.LoggerFactory; } } + public void launchTask(String taskId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + launchTask_call method_call = new launchTask_call(taskId, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class launchTask_call extends org.apache.thrift.async.TAsyncMethodCall { + private String taskId; + public launchTask_call(String taskId, 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.taskId = taskId; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("launchTask", org.apache.thrift.protocol.TMessageType.CALL, 0)); + launchTask_args args = new launchTask_args(); + args.setTaskId(taskId); + args.write(prot); + prot.writeMessageEnd(); + } + + public boolean 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_launchTask(); + } + } + public void validateExperiment(String experimentId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); validateExperiment_call method_call = new validateExperiment_call(experimentId, resultHandler, this, ___protocolFactory, ___transport); @@ -383,6 +453,7 @@ import org.slf4j.LoggerFactory; private static <I extends Iface> Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> getProcessMap(Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) { processMap.put("getOrchestratorCPIVersion", new getOrchestratorCPIVersion()); processMap.put("launchExperiment", new launchExperiment()); + processMap.put("launchTask", new launchTask()); processMap.put("validateExperiment", new validateExperiment()); processMap.put("terminateExperiment", new terminateExperiment()); return processMap; @@ -429,6 +500,27 @@ import org.slf4j.LoggerFactory; } } + public static class launchTask<I extends Iface> extends org.apache.thrift.ProcessFunction<I, launchTask_args> { + public launchTask() { + super("launchTask"); + } + + public launchTask_args getEmptyArgsInstance() { + return new launchTask_args(); + } + + protected boolean isOneway() { + return false; + } + + public launchTask_result getResult(I iface, launchTask_args args) throws org.apache.thrift.TException { + launchTask_result result = new launchTask_result(); + result.success = iface.launchTask(args.taskId); + result.setSuccessIsSet(true); + return result; + } + } + public static class validateExperiment<I extends Iface> extends org.apache.thrift.ProcessFunction<I, validateExperiment_args> { public validateExperiment() { super("validateExperiment"); @@ -490,6 +582,7 @@ import org.slf4j.LoggerFactory; private static <I extends AsyncIface> Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase,?>> getProcessMap(Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) { processMap.put("getOrchestratorCPIVersion", new getOrchestratorCPIVersion()); processMap.put("launchExperiment", new launchExperiment()); + processMap.put("launchTask", new launchTask()); processMap.put("validateExperiment", new validateExperiment()); processMap.put("terminateExperiment", new terminateExperiment()); return processMap; @@ -598,6 +691,58 @@ import org.slf4j.LoggerFactory; } } + public static class launchTask<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, launchTask_args, Boolean> { + public launchTask() { + super("launchTask"); + } + + public launchTask_args getEmptyArgsInstance() { + return new launchTask_args(); + } + + public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback<Boolean>() { + public void onComplete(Boolean o) { + launchTask_result result = new launchTask_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + launchTask_result result = new launchTask_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, launchTask_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException { + iface.launchTask(args.taskId,resultHandler); + } + } + public static class validateExperiment<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, validateExperiment_args, Boolean> { public validateExperiment() { super("validateExperiment"); @@ -2011,6 +2156,707 @@ import org.slf4j.LoggerFactory; } + public static class launchTask_args implements org.apache.thrift.TBase<launchTask_args, launchTask_args._Fields>, java.io.Serializable, Cloneable, Comparable<launchTask_args> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("launchTask_args"); + + private static final org.apache.thrift.protocol.TField TASK_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("taskId", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new launchTask_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new launchTask_argsTupleSchemeFactory()); + } + + public String taskId; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum { + TASK_ID((short)1, "taskId"); + + private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // TASK_ID + return TASK_ID; + 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.TASK_ID, new org.apache.thrift.meta_data.FieldMetaData("taskId", 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(launchTask_args.class, metaDataMap); + } + + public launchTask_args() { + } + + public launchTask_args( + String taskId) + { + this(); + this.taskId = taskId; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public launchTask_args(launchTask_args other) { + if (other.isSetTaskId()) { + this.taskId = other.taskId; + } + } + + public launchTask_args deepCopy() { + return new launchTask_args(this); + } + + @Override + public void clear() { + this.taskId = null; + } + + public String getTaskId() { + return this.taskId; + } + + public launchTask_args setTaskId(String taskId) { + this.taskId = taskId; + return this; + } + + public void unsetTaskId() { + this.taskId = null; + } + + /** Returns true if field taskId is set (has been assigned a value) and false otherwise */ + public boolean isSetTaskId() { + return this.taskId != null; + } + + public void setTaskIdIsSet(boolean value) { + if (!value) { + this.taskId = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TASK_ID: + if (value == null) { + unsetTaskId(); + } else { + setTaskId((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TASK_ID: + return getTaskId(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case TASK_ID: + return isSetTaskId(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof launchTask_args) + return this.equals((launchTask_args)that); + return false; + } + + public boolean equals(launchTask_args that) { + if (that == null) + return false; + + boolean this_present_taskId = true && this.isSetTaskId(); + boolean that_present_taskId = true && that.isSetTaskId(); + if (this_present_taskId || that_present_taskId) { + if (!(this_present_taskId && that_present_taskId)) + return false; + if (!this.taskId.equals(that.taskId)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(launchTask_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetTaskId()).compareTo(other.isSetTaskId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTaskId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.taskId, other.taskId); + 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("launchTask_args("); + boolean first = true; + + sb.append("taskId:"); + if (this.taskId == null) { + sb.append("null"); + } else { + sb.append(this.taskId); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (taskId == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'taskId' was not present! Struct: " + toString()); + } + // check for sub-struct validity + } + + 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 launchTask_argsStandardSchemeFactory implements SchemeFactory { + public launchTask_argsStandardScheme getScheme() { + return new launchTask_argsStandardScheme(); + } + } + + private static class launchTask_argsStandardScheme extends StandardScheme<launchTask_args> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, launchTask_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: // TASK_ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.taskId = iprot.readString(); + struct.setTaskIdIsSet(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(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, launchTask_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.taskId != null) { + oprot.writeFieldBegin(TASK_ID_FIELD_DESC); + oprot.writeString(struct.taskId); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class launchTask_argsTupleSchemeFactory implements SchemeFactory { + public launchTask_argsTupleScheme getScheme() { + return new launchTask_argsTupleScheme(); + } + } + + private static class launchTask_argsTupleScheme extends TupleScheme<launchTask_args> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, launchTask_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.taskId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, launchTask_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.taskId = iprot.readString(); + struct.setTaskIdIsSet(true); + } + } + + } + + public static class launchTask_result implements org.apache.thrift.TBase<launchTask_result, launchTask_result._Fields>, java.io.Serializable, Cloneable, Comparable<launchTask_result> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("launchTask_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new launchTask_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new launchTask_resultTupleSchemeFactory()); + } + + public boolean success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + + 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 + private static final int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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.BOOL))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(launchTask_result.class, metaDataMap); + } + + public launchTask_result() { + } + + public launchTask_result( + boolean success) + { + this(); + this.success = success; + setSuccessIsSet(true); + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public launchTask_result(launchTask_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + } + + public launchTask_result deepCopy() { + return new launchTask_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + } + + public boolean isSuccess() { + return this.success; + } + + public launchTask_result setSuccess(boolean success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Boolean)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return Boolean.valueOf(isSuccess()); + + } + 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 isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof launchTask_result) + return this.equals((launchTask_result)that); + return false; + } + + public boolean equals(launchTask_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(launchTask_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("launchTask_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + 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_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class launchTask_resultStandardSchemeFactory implements SchemeFactory { + public launchTask_resultStandardScheme getScheme() { + return new launchTask_resultStandardScheme(); + } + } + + private static class launchTask_resultStandardScheme extends StandardScheme<launchTask_result> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, launchTask_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.BOOL) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(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(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, launchTask_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class launchTask_resultTupleSchemeFactory implements SchemeFactory { + public launchTask_resultTupleScheme getScheme() { + return new launchTask_resultTupleScheme(); + } + } + + private static class launchTask_resultTupleScheme extends TupleScheme<launchTask_result> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, launchTask_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeBool(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, launchTask_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + } + } + + } + public static class validateExperiment_args implements org.apache.thrift.TBase<validateExperiment_args, validateExperiment_args._Fields>, java.io.Serializable, Cloneable, Comparable<validateExperiment_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("validateExperiment_args");
