You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sm...@apache.org on 2018/01/08 20:04:32 UTC
[airavata] 01/03: Implementing force post processing of an
experiment
This is an automated email from the ASF dual-hosted git repository.
smarru pushed a commit to branch AIRAVATA-2620
in repository https://gitbox.apache.org/repos/asf/airavata.git
commit 2f0761b9ca5f30ff8a7caccb4cb8b370d9427fac
Author: dimuthu.upeksha2@gmail.com <Di...@1234>
AuthorDate: Fri Dec 22 17:04:19 2017 +0530
Implementing force post processing of an experiment
---
.../api/server/handler/AiravataServerHandler.java | 27 +
.../java/org/apache/airavata/api/Airavata.java | 2095 +++++++++++++++++---
.../samples/ForcePostProcessingExperiment.java | 43 +
.../model/messaging/event/MessageType.java | 5 +-
.../airavata/model/process/ProcessModel.java | 105 +-
.../ProcessType.java} | 37 +-
.../airavata/model/status/ExperimentState.java | 14 +-
.../airavata/gfac/impl/task/SCPDataStageTask.java | 14 +-
.../messaging/core/impl/ExperimentConsumer.java | 3 +-
.../orchestrator/cpi/OrchestratorService.java | 954 +++++++++
.../cpi/impl/SimpleOrchestratorImpl.java | 32 +-
.../server/OrchestratorServerHandler.java | 329 ++-
.../catalog/impl/ExperimentRegistry.java | 2 +
.../core/experiment/catalog/model/Process.java | 10 +
.../catalog/resources/ProcessResource.java | 10 +
.../core/experiment/catalog/resources/Utils.java | 1 +
.../catalog/utils/ThriftDataModelConversion.java | 2 +
.../airavata-apis/airavata_api.thrift | 48 +
.../airavata-apis/messaging_events.thrift | 3 +-
.../component-cpis/orchestrator-cpi.thrift | 2 +
.../experiment-catalog-models/process_model.thrift | 6 +
.../experiment-catalog-models/status_models.thrift | 6 +-
22 files changed, 3377 insertions(+), 371 deletions(-)
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
index 4ae91ea..ddd126e 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
@@ -1762,6 +1762,26 @@ public class AiravataServerHandler implements Airavata.Iface {
}
}
+ @Override
+ public void executePostProcessing(AuthzToken authzToken, String airavataExperimentId, String gatewayId) throws InvalidRequestException, ExperimentNotFoundException, AiravataClientException, AiravataSystemException, AuthorizationException, TException {
+ RegistryService.Client regClient = registryClientPool.getResource();
+ try {
+ ExperimentModel experiment = regClient.getExperiment(airavataExperimentId);
+ if (experiment == null) {
+ logger.error(airavataExperimentId, "Error while starting the post processing of experiment, experiment {} doesn't exist.", airavataExperimentId);
+ throw new ExperimentNotFoundException("Requested experiment id " + airavataExperimentId + " does not exist in the system..");
+ }
+ startPostProcessingOfExperiment(gatewayId, airavataExperimentId);
+ registryClientPool.returnResource(regClient);
+ } catch (Exception e1) {
+ logger.error(airavataExperimentId, "Error while instantiate the registry instance", e1);
+ AiravataSystemException exception = new AiravataSystemException();
+ exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
+ exception.setMessage("Error while instantiate the registry instance. More info : " + e1.getMessage());
+ registryClientPool.returnBrokenResource(regClient);
+ throw exception;
+ }
+ }
// private OrchestratorService.Client getOrchestratorClient() throws TException {
@@ -4808,6 +4828,13 @@ public class AiravataServerHandler implements Airavata.Iface {
}
}
+ private void startPostProcessingOfExperiment(String gatewayId, String experimentId) throws AiravataException {
+ ExperimentSubmitEvent event = new ExperimentSubmitEvent(experimentId, gatewayId);
+ MessageContext messageContext = new MessageContext(event, MessageType.POSTPROCESSING_START, "POSTPROCESS.EXP-" + UUID.randomUUID().toString(), gatewayId);
+ messageContext.setUpdatedTime(AiravataUtils.getCurrentTimestamp());
+ experimentPublisher.publish(messageContext);
+ }
+
private void submitExperiment(String gatewayId,String experimentId) throws AiravataException {
ExperimentSubmitEvent event = new ExperimentSubmitEvent(experimentId, gatewayId);
MessageContext messageContext = new MessageContext(event, MessageType.EXPERIMENT, "LAUNCH.EXP-" + UUID.randomUUID().toString(), gatewayId);
diff --git a/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/Airavata.java b/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/Airavata.java
index 6ef1610..f5f2a17 100644
--- a/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/Airavata.java
+++ b/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/Airavata.java
@@ -934,6 +934,52 @@ public class Airavata {
public void launchExperiment(org.apache.airavata.model.security.AuthzToken authzToken, String airavataExperimentId, String gatewayId) throws org.apache.airavata.model.error.InvalidRequestException, org.apache.airavata.model.error.ExperimentNotFoundException, org.apache.airavata.model.error.AiravataClientException, org.apache.airavata.model.error.AiravataSystemException, org.apache.airavata.model.error.AuthorizationException, org.apache.thrift.TException;
/**
+ * *
+ * * Executes post processing tasks of an Experiment. Usually post processing tasks are executed once the Experiment is
+ * * launched. However this enables the ability for users to forcefully execute these post processing tasks while an
+ * * Experiment running.
+ * *
+ * * @param gatewayId
+ * * ID of the gateway which will launch the experiment.
+ * *
+ * * @param airavataExperimetId
+ * * Identifier of the Experiment in which the post processing should be executed
+ * *
+ * * @return
+ * * This method call does not have a return value.
+ * *
+ * * @throws org.apache.airavata.model.error.InvalidRequestException
+ * * For any incorrect forming of the request itself.
+ * *
+ * * @throws org.apache.airavata.model.error.ExperimentNotFoundException
+ * * If the specified experiment is not previously created, then an Experiment Not Found Exception is thrown.
+ * *
+ * * @throws org.apache.airavata.model.error.AiravataClientException
+ * * The following list of exceptions are thrown which Airavata Client can take corrective actions to resolve:
+ * *
+ * * UNKNOWN_GATEWAY_ID - If a Gateway is not registered with Airavata as a one time administrative
+ * * step, then Airavata Registry will not have a provenance area setup. The client has to follow
+ * * gateway registration steps and retry this request.
+ * *
+ * * AUTHENTICATION_FAILURE - How Authentication will be implemented is yet to be determined.
+ * * For now this is a place holder.
+ * *
+ * * INVALID_AUTHORIZATION - This will throw an authorization exception. When a more robust security hand-shake
+ * * is implemented, the authorization will be more substantial.
+ * *
+ * * @throws org.apache.airavata.model.error.AiravataSystemException
+ * * This exception will be thrown for any Airavata Server side issues and if the problem cannot be corrected by the client
+ * * rather an Airavata Administrator will be notified to take corrective action.
+ * *
+ * *
+ *
+ * @param authzToken
+ * @param airavataExperimetId
+ * @param gatewayId
+ */
+ public void executePostProcessing(org.apache.airavata.model.security.AuthzToken authzToken, String airavataExperimetId, String gatewayId) throws org.apache.airavata.model.error.InvalidRequestException, org.apache.airavata.model.error.ExperimentNotFoundException, org.apache.airavata.model.error.AiravataClientException, org.apache.airavata.model.error.AiravataSystemException, org.apache.airavata.model.error.AuthorizationException, org.apache.thrift.TException;
+
+ /**
*
* Get Experiment Status
*
@@ -3111,6 +3157,8 @@ public class Airavata {
public void launchExperiment(org.apache.airavata.model.security.AuthzToken authzToken, String airavataExperimentId, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+ public void executePostProcessing(org.apache.airavata.model.security.AuthzToken authzToken, String airavataExperimetId, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
public void getExperimentStatus(org.apache.airavata.model.security.AuthzToken authzToken, String airavataExperimentId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void getExperimentOutputs(org.apache.airavata.model.security.AuthzToken authzToken, String airavataExperimentId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
@@ -4946,6 +4994,43 @@ public class Airavata {
return;
}
+ public void executePostProcessing(org.apache.airavata.model.security.AuthzToken authzToken, String airavataExperimetId, String gatewayId) throws org.apache.airavata.model.error.InvalidRequestException, org.apache.airavata.model.error.ExperimentNotFoundException, org.apache.airavata.model.error.AiravataClientException, org.apache.airavata.model.error.AiravataSystemException, org.apache.airavata.model.error.AuthorizationException, org.apache.thrift.TException
+ {
+ send_executePostProcessing(authzToken, airavataExperimetId, gatewayId);
+ recv_executePostProcessing();
+ }
+
+ public void send_executePostProcessing(org.apache.airavata.model.security.AuthzToken authzToken, String airavataExperimetId, String gatewayId) throws org.apache.thrift.TException
+ {
+ executePostProcessing_args args = new executePostProcessing_args();
+ args.setAuthzToken(authzToken);
+ args.setAiravataExperimetId(airavataExperimetId);
+ args.setGatewayId(gatewayId);
+ sendBase("executePostProcessing", args);
+ }
+
+ public void recv_executePostProcessing() throws org.apache.airavata.model.error.InvalidRequestException, org.apache.airavata.model.error.ExperimentNotFoundException, org.apache.airavata.model.error.AiravataClientException, org.apache.airavata.model.error.AiravataSystemException, org.apache.airavata.model.error.AuthorizationException, org.apache.thrift.TException
+ {
+ executePostProcessing_result result = new executePostProcessing_result();
+ receiveBase(result, "executePostProcessing");
+ if (result.ire != null) {
+ throw result.ire;
+ }
+ if (result.enf != null) {
+ throw result.enf;
+ }
+ if (result.ace != null) {
+ throw result.ace;
+ }
+ if (result.ase != null) {
+ throw result.ase;
+ }
+ if (result.ae != null) {
+ throw result.ae;
+ }
+ return;
+ }
+
public org.apache.airavata.model.status.ExperimentStatus getExperimentStatus(org.apache.airavata.model.security.AuthzToken authzToken, String airavataExperimentId) throws org.apache.airavata.model.error.InvalidRequestException, org.apache.airavata.model.error.ExperimentNotFoundException, org.apache.airavata.model.error.AiravataClientException, org.apache.airavata.model.error.AiravataSystemException, org.apache.airavata.model.error.AuthorizationException, org.apache.thrift.TException
{
send_getExperimentStatus(authzToken, airavataExperimentId);
@@ -11250,6 +11335,44 @@ public class Airavata {
}
}
+ public void executePostProcessing(org.apache.airavata.model.security.AuthzToken authzToken, String airavataExperimetId, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ checkReady();
+ executePostProcessing_call method_call = new executePostProcessing_call(authzToken, airavataExperimetId, gatewayId, resultHandler, this, ___protocolFactory, ___transport);
+ this.___currentMethod = method_call;
+ ___manager.call(method_call);
+ }
+
+ public static class executePostProcessing_call extends org.apache.thrift.async.TAsyncMethodCall {
+ private org.apache.airavata.model.security.AuthzToken authzToken;
+ private String airavataExperimetId;
+ private String gatewayId;
+ public executePostProcessing_call(org.apache.airavata.model.security.AuthzToken authzToken, String airavataExperimetId, String gatewayId, 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.authzToken = authzToken;
+ this.airavataExperimetId = airavataExperimetId;
+ this.gatewayId = gatewayId;
+ }
+
+ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+ prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("executePostProcessing", org.apache.thrift.protocol.TMessageType.CALL, 0));
+ executePostProcessing_args args = new executePostProcessing_args();
+ args.setAuthzToken(authzToken);
+ args.setAiravataExperimetId(airavataExperimetId);
+ args.setGatewayId(gatewayId);
+ args.write(prot);
+ prot.writeMessageEnd();
+ }
+
+ public void getResult() throws org.apache.airavata.model.error.InvalidRequestException, org.apache.airavata.model.error.ExperimentNotFoundException, org.apache.airavata.model.error.AiravataClientException, org.apache.airavata.model.error.AiravataSystemException, org.apache.airavata.model.error.AuthorizationException, 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_executePostProcessing();
+ }
+ }
+
public void getExperimentStatus(org.apache.airavata.model.security.AuthzToken authzToken, String airavataExperimentId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
getExperimentStatus_call method_call = new getExperimentStatus_call(authzToken, airavataExperimentId, resultHandler, this, ___protocolFactory, ___transport);
@@ -16001,6 +16124,7 @@ public class Airavata {
processMap.put("updateResourceScheduleing", new updateResourceScheduleing());
processMap.put("validateExperiment", new validateExperiment());
processMap.put("launchExperiment", new launchExperiment());
+ processMap.put("executePostProcessing", new executePostProcessing());
processMap.put("getExperimentStatus", new getExperimentStatus());
processMap.put("getExperimentOutputs", new getExperimentOutputs());
processMap.put("getIntermediateOutputs", new getIntermediateOutputs());
@@ -17421,6 +17545,38 @@ public class Airavata {
}
}
+ public static class executePostProcessing<I extends Iface> extends org.apache.thrift.ProcessFunction<I, executePostProcessing_args> {
+ public executePostProcessing() {
+ super("executePostProcessing");
+ }
+
+ public executePostProcessing_args getEmptyArgsInstance() {
+ return new executePostProcessing_args();
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public executePostProcessing_result getResult(I iface, executePostProcessing_args args) throws org.apache.thrift.TException {
+ executePostProcessing_result result = new executePostProcessing_result();
+ try {
+ iface.executePostProcessing(args.authzToken, args.airavataExperimetId, args.gatewayId);
+ } catch (org.apache.airavata.model.error.InvalidRequestException ire) {
+ result.ire = ire;
+ } catch (org.apache.airavata.model.error.ExperimentNotFoundException enf) {
+ result.enf = enf;
+ } catch (org.apache.airavata.model.error.AiravataClientException ace) {
+ result.ace = ace;
+ } catch (org.apache.airavata.model.error.AiravataSystemException ase) {
+ result.ase = ase;
+ } catch (org.apache.airavata.model.error.AuthorizationException ae) {
+ result.ae = ae;
+ }
+ return result;
+ }
+ }
+
public static class getExperimentStatus<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getExperimentStatus_args> {
public getExperimentStatus() {
super("getExperimentStatus");
@@ -21325,6 +21481,7 @@ public class Airavata {
processMap.put("updateResourceScheduleing", new updateResourceScheduleing());
processMap.put("validateExperiment", new validateExperiment());
processMap.put("launchExperiment", new launchExperiment());
+ processMap.put("executePostProcessing", new executePostProcessing());
processMap.put("getExperimentStatus", new getExperimentStatus());
processMap.put("getExperimentOutputs", new getExperimentOutputs());
processMap.put("getIntermediateOutputs", new getIntermediateOutputs());
@@ -24531,6 +24688,82 @@ public class Airavata {
}
}
+ public static class executePostProcessing<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, executePostProcessing_args, Void> {
+ public executePostProcessing() {
+ super("executePostProcessing");
+ }
+
+ public executePostProcessing_args getEmptyArgsInstance() {
+ return new executePostProcessing_args();
+ }
+
+ public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+ final org.apache.thrift.AsyncProcessFunction fcall = this;
+ return new AsyncMethodCallback<Void>() {
+ public void onComplete(Void o) {
+ executePostProcessing_result result = new executePostProcessing_result();
+ 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;
+ executePostProcessing_result result = new executePostProcessing_result();
+ if (e instanceof org.apache.airavata.model.error.InvalidRequestException) {
+ result.ire = (org.apache.airavata.model.error.InvalidRequestException) e;
+ result.setIreIsSet(true);
+ msg = result;
+ }
+ else if (e instanceof org.apache.airavata.model.error.ExperimentNotFoundException) {
+ result.enf = (org.apache.airavata.model.error.ExperimentNotFoundException) e;
+ result.setEnfIsSet(true);
+ msg = result;
+ }
+ else if (e instanceof org.apache.airavata.model.error.AiravataClientException) {
+ result.ace = (org.apache.airavata.model.error.AiravataClientException) e;
+ result.setAceIsSet(true);
+ msg = result;
+ }
+ else if (e instanceof org.apache.airavata.model.error.AiravataSystemException) {
+ result.ase = (org.apache.airavata.model.error.AiravataSystemException) e;
+ result.setAseIsSet(true);
+ msg = result;
+ }
+ else if (e instanceof org.apache.airavata.model.error.AuthorizationException) {
+ result.ae = (org.apache.airavata.model.error.AuthorizationException) e;
+ result.setAeIsSet(true);
+ msg = result;
+ }
+ else
+ {
+ 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, executePostProcessing_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException {
+ iface.executePostProcessing(args.authzToken, args.airavataExperimetId, args.gatewayId,resultHandler);
+ }
+ }
+
public static class getExperimentStatus<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getExperimentStatus_args, org.apache.airavata.model.status.ExperimentStatus> {
public getExperimentStatus() {
super("getExperimentStatus");
@@ -89441,13 +89674,1461 @@ public class Airavata {
}
// isset id assignments
- private static final int __SUCCESS_ISSET_ID = 0;
- private byte __isset_bitfield = 0;
+ 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)));
+ tmpMap.put(_Fields.IRE, new org.apache.thrift.meta_data.FieldMetaData("ire", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
+ tmpMap.put(_Fields.ENF, new org.apache.thrift.meta_data.FieldMetaData("enf", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
+ tmpMap.put(_Fields.ACE, new org.apache.thrift.meta_data.FieldMetaData("ace", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
+ tmpMap.put(_Fields.ASE, new org.apache.thrift.meta_data.FieldMetaData("ase", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
+ tmpMap.put(_Fields.AE, new org.apache.thrift.meta_data.FieldMetaData("ae", 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(validateExperiment_result.class, metaDataMap);
+ }
+
+ public validateExperiment_result() {
+ }
+
+ public validateExperiment_result(
+ boolean success,
+ org.apache.airavata.model.error.InvalidRequestException ire,
+ org.apache.airavata.model.error.ExperimentNotFoundException enf,
+ org.apache.airavata.model.error.AiravataClientException ace,
+ org.apache.airavata.model.error.AiravataSystemException ase,
+ org.apache.airavata.model.error.AuthorizationException ae)
+ {
+ this();
+ this.success = success;
+ setSuccessIsSet(true);
+ this.ire = ire;
+ this.enf = enf;
+ this.ace = ace;
+ this.ase = ase;
+ this.ae = ae;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public validateExperiment_result(validateExperiment_result other) {
+ __isset_bitfield = other.__isset_bitfield;
+ this.success = other.success;
+ if (other.isSetIre()) {
+ this.ire = new org.apache.airavata.model.error.InvalidRequestException(other.ire);
+ }
+ if (other.isSetEnf()) {
+ this.enf = new org.apache.airavata.model.error.ExperimentNotFoundException(other.enf);
+ }
+ if (other.isSetAce()) {
+ this.ace = new org.apache.airavata.model.error.AiravataClientException(other.ace);
+ }
+ if (other.isSetAse()) {
+ this.ase = new org.apache.airavata.model.error.AiravataSystemException(other.ase);
+ }
+ if (other.isSetAe()) {
+ this.ae = new org.apache.airavata.model.error.AuthorizationException(other.ae);
+ }
+ }
+
+ public validateExperiment_result deepCopy() {
+ return new validateExperiment_result(this);
+ }
+
+ @Override
+ public void clear() {
+ setSuccessIsSet(false);
+ this.success = false;
+ this.ire = null;
+ this.enf = null;
+ this.ace = null;
+ this.ase = null;
+ this.ae = null;
+ }
+
+ public boolean isSuccess() {
+ return this.success;
+ }
+
+ public validateExperiment_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 org.apache.airavata.model.error.InvalidRequestException getIre() {
+ return this.ire;
+ }
+
+ public validateExperiment_result setIre(org.apache.airavata.model.error.InvalidRequestException ire) {
+ this.ire = ire;
+ return this;
+ }
+
+ public void unsetIre() {
+ this.ire = null;
+ }
+
+ /** Returns true if field ire is set (has been assigned a value) and false otherwise */
+ public boolean isSetIre() {
+ return this.ire != null;
+ }
+
+ public void setIreIsSet(boolean value) {
+ if (!value) {
+ this.ire = null;
+ }
+ }
+
+ public org.apache.airavata.model.error.ExperimentNotFoundException getEnf() {
+ return this.enf;
+ }
+
+ public validateExperiment_result setEnf(org.apache.airavata.model.error.ExperimentNotFoundException enf) {
+ this.enf = enf;
+ return this;
+ }
+
+ public void unsetEnf() {
+ this.enf = null;
+ }
+
+ /** Returns true if field enf is set (has been assigned a value) and false otherwise */
+ public boolean isSetEnf() {
+ return this.enf != null;
+ }
+
+ public void setEnfIsSet(boolean value) {
+ if (!value) {
+ this.enf = null;
+ }
+ }
+
+ public org.apache.airavata.model.error.AiravataClientException getAce() {
+ return this.ace;
+ }
+
+ public validateExperiment_result setAce(org.apache.airavata.model.error.AiravataClientException ace) {
+ this.ace = ace;
+ return this;
+ }
+
+ public void unsetAce() {
+ this.ace = null;
+ }
+
+ /** Returns true if field ace is set (has been assigned a value) and false otherwise */
+ public boolean isSetAce() {
+ return this.ace != null;
+ }
+
+ public void setAceIsSet(boolean value) {
+ if (!value) {
+ this.ace = null;
+ }
+ }
+
+ public org.apache.airavata.model.error.AiravataSystemException getAse() {
+ return this.ase;
+ }
+
+ public validateExperiment_result setAse(org.apache.airavata.model.error.AiravataSystemException ase) {
+ this.ase = ase;
+ return this;
+ }
+
+ public void unsetAse() {
+ this.ase = null;
+ }
+
+ /** Returns true if field ase is set (has been assigned a value) and false otherwise */
+ public boolean isSetAse() {
+ return this.ase != null;
+ }
+
+ public void setAseIsSet(boolean value) {
+ if (!value) {
+ this.ase = null;
+ }
+ }
+
+ public org.apache.airavata.model.error.AuthorizationException getAe() {
+ return this.ae;
+ }
+
+ public validateExperiment_result setAe(org.apache.airavata.model.error.AuthorizationException ae) {
+ this.ae = ae;
+ return this;
+ }
+
+ public void unsetAe() {
+ this.ae = null;
+ }
+
+ /** Returns true if field ae is set (has been assigned a value) and false otherwise */
+ public boolean isSetAe() {
+ return this.ae != null;
+ }
+
+ public void setAeIsSet(boolean value) {
+ if (!value) {
+ this.ae = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case SUCCESS:
+ if (value == null) {
+ unsetSuccess();
+ } else {
+ setSuccess((Boolean)value);
+ }
+ break;
+
+ case IRE:
+ if (value == null) {
+ unsetIre();
+ } else {
+ setIre((org.apache.airavata.model.error.InvalidRequestException)value);
+ }
+ break;
+
+ case ENF:
+ if (value == null) {
+ unsetEnf();
+ } else {
+ setEnf((org.apache.airavata.model.error.ExperimentNotFoundException)value);
+ }
+ break;
+
+ case ACE:
+ if (value == null) {
+ unsetAce();
+ } else {
+ setAce((org.apache.airavata.model.error.AiravataClientException)value);
+ }
+ break;
+
+ case ASE:
+ if (value == null) {
+ unsetAse();
+ } else {
+ setAse((org.apache.airavata.model.error.AiravataSystemException)value);
+ }
+ break;
+
+ case AE:
+ if (value == null) {
+ unsetAe();
+ } else {
+ setAe((org.apache.airavata.model.error.AuthorizationException)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case SUCCESS:
+ return isSuccess();
+
+ case IRE:
+ return getIre();
+
+ case ENF:
+ return getEnf();
+
+ case ACE:
+ return getAce();
+
+ case ASE:
+ return getAse();
+
+ case AE:
+ return getAe();
+
+ }
+ 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();
+ case IRE:
+ return isSetIre();
+ case ENF:
+ return isSetEnf();
+ case ACE:
+ return isSetAce();
+ case ASE:
+ return isSetAse();
+ case AE:
+ return isSetAe();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof validateExperiment_result)
+ return this.equals((validateExperiment_result)that);
+ return false;
+ }
+
+ public boolean equals(validateExperiment_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;
+ }
+
+ boolean this_present_ire = true && this.isSetIre();
+ boolean that_present_ire = true && that.isSetIre();
+ if (this_present_ire || that_present_ire) {
+ if (!(this_present_ire && that_present_ire))
+ return false;
+ if (!this.ire.equals(that.ire))
+ return false;
+ }
+
+ boolean this_present_enf = true && this.isSetEnf();
+ boolean that_present_enf = true && that.isSetEnf();
+ if (this_present_enf || that_present_enf) {
+ if (!(this_present_enf && that_present_enf))
+ return false;
+ if (!this.enf.equals(that.enf))
+ return false;
+ }
+
+ boolean this_present_ace = true && this.isSetAce();
+ boolean that_present_ace = true && that.isSetAce();
+ if (this_present_ace || that_present_ace) {
+ if (!(this_present_ace && that_present_ace))
+ return false;
+ if (!this.ace.equals(that.ace))
+ return false;
+ }
+
+ boolean this_present_ase = true && this.isSetAse();
+ boolean that_present_ase = true && that.isSetAse();
+ if (this_present_ase || that_present_ase) {
+ if (!(this_present_ase && that_present_ase))
+ return false;
+ if (!this.ase.equals(that.ase))
+ return false;
+ }
+
+ boolean this_present_ae = true && this.isSetAe();
+ boolean that_present_ae = true && that.isSetAe();
+ if (this_present_ae || that_present_ae) {
+ if (!(this_present_ae && that_present_ae))
+ return false;
+ if (!this.ae.equals(that.ae))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ List<Object> list = new ArrayList<Object>();
+
+ boolean present_success = true;
+ list.add(present_success);
+ if (present_success)
+ list.add(success);
+
+ boolean present_ire = true && (isSetIre());
+ list.add(present_ire);
+ if (present_ire)
+ list.add(ire);
+
+ boolean present_enf = true && (isSetEnf());
+ list.add(present_enf);
+ if (present_enf)
+ list.add(enf);
+
+ boolean present_ace = true && (isSetAce());
+ list.add(present_ace);
+ if (present_ace)
+ list.add(ace);
+
+ boolean present_ase = true && (isSetAse());
+ list.add(present_ase);
+ if (present_ase)
+ list.add(ase);
+
+ boolean present_ae = true && (isSetAe());
+ list.add(present_ae);
+ if (present_ae)
+ list.add(ae);
+
+ return list.hashCode();
+ }
+
+ @Override
+ public int compareTo(validateExperiment_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;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetIre()).compareTo(other.isSetIre());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetIre()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ire, other.ire);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetEnf()).compareTo(other.isSetEnf());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetEnf()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.enf, other.enf);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetAce()).compareTo(other.isSetAce());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetAce()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ace, other.ace);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetAse()).compareTo(other.isSetAse());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetAse()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ase, other.ase);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetAe()).compareTo(other.isSetAe());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetAe()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ae, other.ae);
+ 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("validateExperiment_result(");
+ boolean first = true;
+
+ sb.append("success:");
+ sb.append(this.success);
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("ire:");
+ if (this.ire == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.ire);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("enf:");
+ if (this.enf == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.enf);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("ace:");
+ if (this.ace == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.ace);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("ase:");
+ if (this.ase == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.ase);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("ae:");
+ if (this.ae == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.ae);
+ }
+ 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 validateExperiment_resultStandardSchemeFactory implements SchemeFactory {
+ public validateExperiment_resultStandardScheme getScheme() {
+ return new validateExperiment_resultStandardScheme();
+ }
+ }
+
+ private static class validateExperiment_resultStandardScheme extends StandardScheme<validateExperiment_result> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, validateExperiment_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;
+ case 1: // IRE
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.ire = new org.apache.airavata.model.error.InvalidRequestException();
+ struct.ire.read(iprot);
+ struct.setIreIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // ENF
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.enf = new org.apache.airavata.model.error.ExperimentNotFoundException();
+ struct.enf.read(iprot);
+ struct.setEnfIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // ACE
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.ace = new org.apache.airavata.model.error.AiravataClientException();
+ struct.ace.read(iprot);
+ struct.setAceIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 4: // ASE
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.ase = new org.apache.airavata.model.error.AiravataSystemException();
+ struct.ase.read(iprot);
+ struct.setAseIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 5: // AE
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.ae = new org.apache.airavata.model.error.AuthorizationException();
+ struct.ae.read(iprot);
+ struct.setAeIsSet(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, validateExperiment_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();
+ }
+ if (struct.ire != null) {
+ oprot.writeFieldBegin(IRE_FIELD_DESC);
+ struct.ire.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ if (struct.enf != null) {
+ oprot.writeFieldBegin(ENF_FIELD_DESC);
+ struct.enf.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ if (struct.ace != null) {
+ oprot.writeFieldBegin(ACE_FIELD_DESC);
+ struct.ace.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ if (struct.ase != null) {
+ oprot.writeFieldBegin(ASE_FIELD_DESC);
+ struct.ase.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ if (struct.ae != null) {
+ oprot.writeFieldBegin(AE_FIELD_DESC);
+ struct.ae.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class validateExperiment_resultTupleSchemeFactory implements SchemeFactory {
+ public validateExperiment_resultTupleScheme getScheme() {
+ return new validateExperiment_resultTupleScheme();
+ }
+ }
+
+ private static class validateExperiment_resultTupleScheme extends TupleScheme<validateExperiment_result> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, validateExperiment_result struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetSuccess()) {
+ optionals.set(0);
+ }
+ if (struct.isSetIre()) {
+ optionals.set(1);
+ }
+ if (struct.isSetEnf()) {
+ optionals.set(2);
+ }
+ if (struct.isSetAce()) {
+ optionals.set(3);
+ }
+ if (struct.isSetAse()) {
+ optionals.set(4);
+ }
+ if (struct.isSetAe()) {
+ optionals.set(5);
+ }
+ oprot.writeBitSet(optionals, 6);
+ if (struct.isSetSuccess()) {
+ oprot.writeBool(struct.success);
+ }
+ if (struct.isSetIre()) {
+ struct.ire.write(oprot);
+ }
+ if (struct.isSetEnf()) {
+ struct.enf.write(oprot);
+ }
+ if (struct.isSetAce()) {
+ struct.ace.write(oprot);
+ }
+ if (struct.isSetAse()) {
+ struct.ase.write(oprot);
+ }
+ if (struct.isSetAe()) {
+ struct.ae.write(oprot);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, validateExperiment_result struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(6);
+ if (incoming.get(0)) {
+ struct.success = iprot.readBool();
+ struct.setSuccessIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.ire = new org.apache.airavata.model.error.InvalidRequestException();
+ struct.ire.read(iprot);
+ struct.setIreIsSet(true);
+ }
+ if (incoming.get(2)) {
+ struct.enf = new org.apache.airavata.model.error.ExperimentNotFoundException();
+ struct.enf.read(iprot);
+ struct.setEnfIsSet(true);
+ }
+ if (incoming.get(3)) {
+ struct.ace = new org.apache.airavata.model.error.AiravataClientException();
+ struct.ace.read(iprot);
+ struct.setAceIsSet(true);
+ }
+ if (incoming.get(4)) {
+ struct.ase = new org.apache.airavata.model.error.AiravataSystemException();
+ struct.ase.read(iprot);
+ struct.setAseIsSet(true);
+ }
+ if (incoming.get(5)) {
+ struct.ae = new org.apache.airavata.model.error.AuthorizationException();
+ struct.ae.read(iprot);
+ struct.setAeIsSet(true);
+ }
+ }
+ }
+
+ }
+
+ public static class launchExperiment_args implements org.apache.thrift.TBase<launchExperiment_args, launchExperiment_args._Fields>, java.io.Serializable, Cloneable, Comparable<launchExperiment_args> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("launchExperiment_args");
+
+ private static final org.apache.thrift.protocol.TField AUTHZ_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("authzToken", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+ private static final org.apache.thrift.protocol.TField AIRAVATA_EXPERIMENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("airavataExperimentId", org.apache.thrift.protocol.TType.STRING, (short)2);
+ private static final org.apache.thrift.protocol.TField GATEWAY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayId", org.apache.thrift.protocol.TType.STRING, (short)3);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new launchExperiment_argsStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new launchExperiment_argsTupleSchemeFactory());
+ }
+
+ public org.apache.airavata.model.security.AuthzToken authzToken; // required
+ public String airavataExperimentId; // required
+ public String gatewayId; // 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 {
+ AUTHZ_TOKEN((short)1, "authzToken"),
+ AIRAVATA_EXPERIMENT_ID((short)2, "airavataExperimentId"),
+ GATEWAY_ID((short)3, "gatewayId");
+
+ 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: // AUTHZ_TOKEN
+ return AUTHZ_TOKEN;
+ case 2: // AIRAVATA_EXPERIMENT_ID
+ return AIRAVATA_EXPERIMENT_ID;
+ case 3: // GATEWAY_ID
+ return GATEWAY_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.AUTHZ_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("authzToken", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.model.security.AuthzToken.class)));
+ tmpMap.put(_Fields.AIRAVATA_EXPERIMENT_ID, new org.apache.thrift.meta_data.FieldMetaData("airavataExperimentId", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.GATEWAY_ID, new org.apache.thrift.meta_data.FieldMetaData("gatewayId", 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(launchExperiment_args.class, metaDataMap);
+ }
+
+ public launchExperiment_args() {
+ }
+
+ public launchExperiment_args(
+ org.apache.airavata.model.security.AuthzToken authzToken,
+ String airavataExperimentId,
+ String gatewayId)
+ {
+ this();
+ this.authzToken = authzToken;
+ this.airavataExperimentId = airavataExperimentId;
+ this.gatewayId = gatewayId;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public launchExperiment_args(launchExperiment_args other) {
+ if (other.isSetAuthzToken()) {
+ this.authzToken = new org.apache.airavata.model.security.AuthzToken(other.authzToken);
+ }
+ if (other.isSetAiravataExperimentId()) {
+ this.airavataExperimentId = other.airavataExperimentId;
+ }
+ if (other.isSetGatewayId()) {
+ this.gatewayId = other.gatewayId;
+ }
+ }
+
+ public launchExperiment_args deepCopy() {
+ return new launchExperiment_args(this);
+ }
+
+ @Override
+ public void clear() {
+ this.authzToken = null;
+ this.airavataExperimentId = null;
+ this.gatewayId = null;
+ }
+
+ public org.apache.airavata.model.security.AuthzToken getAuthzToken() {
+ return this.authzToken;
+ }
+
+ public launchExperiment_args setAuthzToken(org.apache.airavata.model.security.AuthzToken authzToken) {
+ this.authzToken = authzToken;
+ return this;
+ }
+
+ public void unsetAuthzToken() {
+ this.authzToken = null;
+ }
+
+ /** Returns true if field authzToken is set (has been assigned a value) and false otherwise */
+ public boolean isSetAuthzToken() {
+ return this.authzToken != null;
+ }
+
+ public void setAuthzTokenIsSet(boolean value) {
+ if (!value) {
+ this.authzToken = null;
+ }
+ }
+
+ public String getAiravataExperimentId() {
+ return this.airavataExperimentId;
+ }
+
+ public launchExperiment_args setAiravataExperimentId(String airavataExperimentId) {
+ this.airavataExperimentId = airavataExperimentId;
+ return this;
+ }
+
+ public void unsetAiravataExperimentId() {
+ this.airavataExperimentId = null;
+ }
+
+ /** Returns true if field airavataExperimentId is set (has been assigned a value) and false otherwise */
+ public boolean isSetAiravataExperimentId() {
+ return this.airavataExperimentId != null;
+ }
+
+ public void setAiravataExperimentIdIsSet(boolean value) {
+ if (!value) {
+ this.airavataExperimentId = null;
+ }
+ }
+
+ public String getGatewayId() {
+ return this.gatewayId;
+ }
+
+ public launchExperiment_args setGatewayId(String gatewayId) {
+ this.gatewayId = gatewayId;
+ return this;
+ }
+
+ public void unsetGatewayId() {
+ this.gatewayId = null;
+ }
+
+ /** Returns true if field gatewayId is set (has been assigned a value) and false otherwise */
+ public boolean isSetGatewayId() {
+ return this.gatewayId != null;
+ }
+
+ public void setGatewayIdIsSet(boolean value) {
+ if (!value) {
+ this.gatewayId = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case AUTHZ_TOKEN:
+ if (value == null) {
+ unsetAuthzToken();
+ } else {
+ setAuthzToken((org.apache.airavata.model.security.AuthzToken)value);
+ }
+ break;
+
+ case AIRAVATA_EXPERIMENT_ID:
+ if (value == null) {
+ unsetAiravataExperimentId();
+ } else {
+ setAiravataExperimentId((String)value);
+ }
+ break;
+
+ case GATEWAY_ID:
+ if (value == null) {
+ unsetGatewayId();
+ } else {
+ setGatewayId((String)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case AUTHZ_TOKEN:
+ return getAuthzToken();
+
+ case AIRAVATA_EXPERIMENT_ID:
+ return getAiravataExperimentId();
+
+ case GATEWAY_ID:
+ return getGatewayId();
+
+ }
+ 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 AUTHZ_TOKEN:
+ return isSetAuthzToken();
+ case AIRAVATA_EXPERIMENT_ID:
+ return isSetAiravataExperimentId();
+ case GATEWAY_ID:
+ return isSetGatewayId();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof launchExperiment_args)
+ return this.equals((launchExperiment_args)that);
+ return false;
+ }
+
+ public boolean equals(launchExperiment_args that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_authzToken = true && this.isSetAuthzToken();
+ boolean that_present_authzToken = true && that.isSetAuthzToken();
+ if (this_present_authzToken || that_present_authzToken) {
+ if (!(this_present_authzToken && that_present_authzToken))
+ return false;
+ if (!this.authzToken.equals(that.authzToken))
+ return false;
+ }
+
+ boolean this_present_airavataExperimentId = true && this.isSetAiravataExperimentId();
+ boolean that_present_airavataExperimentId = true && that.isSetAiravataExperimentId();
+ if (this_present_airavataExperimentId || that_present_airavataExperimentId) {
+ if (!(this_present_airavataExperimentId && that_present_airavataExperimentId))
+ return false;
+ if (!this.airavataExperimentId.equals(that.airavataExperimentId))
+ return false;
+ }
+
+ boolean this_present_gatewayId = true && this.isSetGatewayId();
+ boolean that_present_gatewayId = true && that.isSetGatewayId();
+ if (this_present_gatewayId || that_present_gatewayId) {
+ if (!(this_present_gatewayId && that_present_gatewayId))
+ return false;
+ if (!this.gatewayId.equals(that.gatewayId))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ List<Object> list = new ArrayList<Object>();
+
+ boolean present_authzToken = true && (isSetAuthzToken());
+ list.add(present_authzToken);
+ if (present_authzToken)
+ list.add(authzToken);
+
+ boolean present_airavataExperimentId = true && (isSetAiravataExperimentId());
+ list.add(present_airavataExperimentId);
+ if (present_airavataExperimentId)
+ list.add(airavataExperimentId);
+
+ boolean present_gatewayId = true && (isSetGatewayId());
+ list.add(present_gatewayId);
+ if (present_gatewayId)
+ list.add(gatewayId);
+
+ return list.hashCode();
+ }
+
+ @Override
+ public int compareTo(launchExperiment_args other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetAuthzToken()).compareTo(other.isSetAuthzToken());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetAuthzToken()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.authzToken, other.authzToken);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetAiravataExperimentId()).compareTo(other.isSetAiravataExperimentId());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetAiravataExperimentId()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.airavataExperimentId, other.airavataExperimentId);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetGatewayId()).compareTo(other.isSetGatewayId());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetGatewayId()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gatewayId, other.gatewayId);
+ 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("launchExperiment_args(");
+ boolean first = true;
+
+ sb.append("authzToken:");
+ if (this.authzToken == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.authzToken);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("airavataExperimentId:");
+ if (this.airavataExperimentId == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.airavataExperimentId);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("gatewayId:");
+ if (this.gatewayId == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.gatewayId);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ if (authzToken == null) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'authzToken' was not present! Struct: " + toString());
+ }
+ if (airavataExperimentId == null) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'airavataExperimentId' was not present! Struct: " + toString());
+ }
+ if (gatewayId == null) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'gatewayId' was not present! Struct: " + toString());
+ }
+ // check for sub-struct validity
+ if (authzToken != null) {
+ authzToken.validate();
+ }
+ }
+
+ 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 launchExperiment_argsStandardSchemeFactory implements SchemeFactory {
+ public launchExperiment_argsStandardScheme getScheme() {
+ return new launchExperiment_argsStandardScheme();
+ }
+ }
+
+ private static class launchExperiment_argsStandardScheme extends StandardScheme<launchExperiment_args> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, launchExperiment_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: // AUTHZ_TOKEN
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.authzToken = new org.apache.airavata.model.security.AuthzToken();
+ struct.authzToken.read(iprot);
+ struct.setAuthzTokenIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // AIRAVATA_EXPERIMENT_ID
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.airavataExperimentId = iprot.readString();
+ struct.setAiravataExperimentIdIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // GATEWAY_ID
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.gatewayId = iprot.readString();
+ struct.setGatewayIdIsSet(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, launchExperiment_args struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.authzToken != null) {
+ oprot.writeFieldBegin(AUTHZ_TOKEN_FIELD_DESC);
+ struct.authzToken.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ if (struct.airavataExperimentId != null) {
+ oprot.writeFieldBegin(AIRAVATA_EXPERIMENT_ID_FIELD_DESC);
+ oprot.writeString(struct.airavataExperimentId);
+ oprot.writeFieldEnd();
+ }
+ if (struct.gatewayId != null) {
+ oprot.writeFieldBegin(GATEWAY_ID_FIELD_DESC);
+ oprot.writeString(struct.gatewayId);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class launchExperiment_argsTupleSchemeFactory implements SchemeFactory {
+ public launchExperiment_argsTupleScheme getScheme() {
+ return new launchExperiment_argsTupleScheme();
+ }
+ }
+
+ private static class launchExperiment_argsTupleScheme extends TupleScheme<launchExperiment_args> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, launchExperiment_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ struct.authzToken.write(oprot);
+ oprot.writeString(struct.airavataExperimentId);
+ oprot.writeString(struct.gatewayId);
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, launchExperiment_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ struct.authzToken = new org.apache.airavata.model.security.AuthzToken();
+ struct.authzToken.read(iprot);
+ struct.setAuthzTokenIsSet(true);
+ struct.airavataExperimentId = iprot.readString();
+ struct.setAiravataExperimentIdIsSet(true);
+ struct.gatewayId = iprot.readString();
+ struct.setGatewayIdIsSet(true);
+ }
+ }
+
+ }
+
+ public static class launchExperiment_result implements org.apache.thrift.TBase<launchExperiment_result, launchExperiment_result._Fields>, java.io.Serializable, Cloneable, Comparable<launchExperiment_result> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("launchExperiment_result");
+
+ private static final org.apache.thrift.protocol.TField IRE_FIELD_DESC = new org.apache.thrift.protocol.TField("ire", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+ private static final org.apache.thrift.protocol.TField ENF_FIELD_DESC = new org.apache.thrift.protocol.TField("enf", org.apache.thrift.protocol.TType.STRUCT, (short)2);
+ private static final org.apache.thrift.protocol.TField ACE_FIELD_DESC = new org.apache.thrift.protocol.TField("ace", org.apache.thrift.protocol.TType.STRUCT, (short)3);
+ private static final org.apache.thrift.protocol.TField ASE_FIELD_DESC = new org.apache.thrift.protocol.TField("ase", org.apache.thrift.protocol.TType.STRUCT, (short)4);
+ private static final org.apache.thrift.protocol.TField AE_FIELD_DESC = new org.apache.thrift.protocol.TField("ae", org.apache.thrift.protocol.TType.STRUCT, (short)5);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new launchExperiment_resultStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new launchExperiment_resultTupleSchemeFactory());
+ }
+
+ public org.apache.airavata.model.error.InvalidRequestException ire; // required
+ public org.apache.airavata.model.error.ExperimentNotFoundException enf; // required
+ public org.apache.airavata.model.error.AiravataClientException ace; // required
+ public org.apache.airavata.model.error.AiravataSystemException ase; // required
+ public org.apache.airavata.model.error.AuthorizationException ae; // 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 {
+ IRE((short)1, "ire"),
+ ENF((short)2, "enf"),
+ ACE((short)3, "ace"),
+ ASE((short)4, "ase"),
+ AE((short)5, "ae");
+
+ 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: // IRE
+ return IRE;
+ case 2: // ENF
+ return ENF;
+ case 3: // ACE
+ return ACE;
+ case 4: // ASE
+ return ASE;
+ case 5: // AE
+ return AE;
+ 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.BOOL)));
tmpMap.put(_Fields.IRE, new org.apache.thrift.meta_data.FieldMetaData("ire", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
tmpMap.put(_Fields.ENF, new org.apache.thrift.meta_data.FieldMetaData("enf", org.apache.thrift.TFieldRequirementType.DEFAULT,
@@ -89459,14 +91140,13 @@ public class Airavata {
tmpMap.put(_Fields.AE, new org.apache.thrift.meta_data.FieldMetaData("ae", 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(validateExperiment_result.class, metaDataMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(launchExperiment_result.class, metaDataMap);
}
- public validateExperiment_result() {
+ public launchExperiment_result() {
}
- public validateExperiment_result(
- boolean success,
+ public launchExperiment_result(
org.apache.airavata.model.error.InvalidRequestException ire,
org.apache.airavata.model.error.ExperimentNotFoundException enf,
org.apache.airavata.model.error.AiravataClientException ace,
@@ -89474,8 +91154,6 @@ public class Airavata {
org.apache.airavata.model.error.AuthorizationException ae)
{
this();
- this.success = success;
- setSuccessIsSet(true);
this.ire = ire;
this.enf = enf;
this.ace = ace;
@@ -89486,9 +91164,7 @@ public class Airavata {
/**
* Performs a deep copy on <i>other</i>.
*/
- public validateExperiment_result(validateExperiment_result other) {
- __isset_bitfield = other.__isset_bitfield;
- this.success = other.success;
+ public launchExperiment_result(launchExperiment_result other) {
if (other.isSetIre()) {
this.ire = new org.apache.airavata.model.error.InvalidRequestException(other.ire);
}
@@ -89506,14 +91182,12 @@ public class Airavata {
}
}
- public validateExperiment_result deepCopy() {
- return new validateExperiment_result(this);
+ public launchExperiment_result deepCopy() {
+ return new launchExperiment_result(this);
}
@Override
public void clear() {
- setSuccessIsSet(false);
- this.success = false;
this.ire = null;
this.enf = null;
this.ace = null;
@@ -89521,34 +91195,11 @@ public class Airavata {
this.ae = null;
}
- public boolean isSuccess() {
- return this.success;
- }
-
- public validateExperiment_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 org.apache.airavata.model.error.InvalidRequestException getIre() {
return this.ire;
}
- public validateExperiment_result setIre(org.apache.airavata.model.error.InvalidRequestException ire) {
+ public launchExperiment_result setIre(org.apache.airavata.model.error.InvalidRequestException ire) {
this.ire = ire;
return this;
}
@@ -89572,7 +91223,7 @@ public class Airavata {
return this.enf;
}
- public validateExperiment_result setEnf(org.apache.airavata.model.error.ExperimentNotFoundException enf) {
+ public launchExperiment_result setEnf(org.apache.airavata.model.error.ExperimentNotFoundException enf) {
this.enf = enf;
return this;
}
@@ -89596,7 +91247,7 @@ public class Airavata {
return this.ace;
}
- public validateExperiment_result setAce(org.apache.airavata.model.error.AiravataClientException ace) {
+ public launchExperiment_result setAce(org.apache.airavata.model.error.AiravataClientException ace) {
this.ace = ace;
return this;
}
@@ -89620,7 +91271,7 @@ public class Airavata {
return this.ase;
}
- public validateExperiment_result setAse(org.apache.airavata.model.error.AiravataSystemException ase) {
+ public launchExperiment_result setAse(org.apache.airavata.model.error.AiravataSystemException ase) {
this.ase = ase;
return this;
}
@@ -89644,7 +91295,7 @@ public class Airavata {
return this.ae;
}
- public validateExperiment_result setAe(org.apache.airavata.model.error.AuthorizationException ae) {
+ public launchExperiment_result setAe(org.apache.airavata.model.error.AuthorizationException ae) {
this.ae = ae;
return this;
}
@@ -89666,14 +91317,6 @@ public class Airavata {
public void setFieldValue(_Fields field, Object value) {
switch (field) {
- case SUCCESS:
- if (value == null) {
- unsetSuccess();
- } else {
- setSuccess((Boolean)value);
- }
- break;
-
case IRE:
if (value == null) {
unsetIre();
@@ -89719,9 +91362,6 @@ public class Airavata {
public Object getFieldValue(_Fields field) {
switch (field) {
- case SUCCESS:
- return isSuccess();
-
case IRE:
return getIre();
@@ -89748,8 +91388,6 @@ public class Airavata {
}
switch (field) {
- case SUCCESS:
- return isSetSuccess();
case IRE:
return isSetIre();
case ENF:
@@ -89768,24 +91406,15 @@ public class Airavata {
public boolean equals(Object that) {
if (that == null)
return false;
- if (that instanceof validateExperiment_result)
- return this.equals((validateExperiment_result)that);
+ if (that instanceof launchExperiment_result)
+ return this.equals((launchExperiment_result)that);
return false;
}
- public boolean equals(validateExperiment_result that) {
+ public boolean equals(launchExperiment_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;
- }
-
boolean this_present_ire = true && this.isSetIre();
boolean that_present_ire = true && that.isSetIre();
if (this_present_ire || that_present_ire) {
@@ -89838,11 +91467,6 @@ public class Airavata {
public int hashCode() {
List<Object> list = new ArrayList<Object>();
- boolean present_success = true;
- list.add(present_success);
- if (present_success)
- list.add(success);
-
boolean present_ire = true && (isSetIre());
list.add(present_ire);
if (present_ire)
@@ -89872,23 +91496,13 @@ public class Airavata {
}
@Override
- public int compareTo(validateExperiment_result other) {
+ public int compareTo(launchExperiment_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;
- }
- }
lastComparison = Boolean.valueOf(isSetIre()).compareTo(other.isSetIre());
if (lastComparison != 0) {
return lastComparison;
@@ -89956,13 +91570,9 @@ public class Airavata {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder("validateExperiment_result(");
+ StringBuilder sb = new StringBuilder("launchExperiment_result(");
boolean first = true;
- sb.append("success:");
- sb.append(this.success);
- first = false;
- if (!first) sb.append(", ");
sb.append("ire:");
if (this.ire == null) {
sb.append("null");
@@ -90021,23 +91631,21 @@ public class Airavata {
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 validateExperiment_resultStandardSchemeFactory implements SchemeFactory {
- public validateExperiment_resultStandardScheme getScheme() {
- return new validateExperiment_resultStandardScheme();
+ private static class launchExperiment_resultStandardSchemeFactory implements SchemeFactory {
+ public launchExperiment_resultStandardScheme getScheme() {
+ return new launchExperiment_resultStandardScheme();
}
}
- private static class validateExperiment_resultStandardScheme extends StandardScheme<validateExperiment_result> {
+ private static class launchExperiment_resultStandardScheme extends StandardScheme<launchExperiment_result> {
- public void read(org.apache.thrift.protocol.TProtocol iprot, validateExperiment_result struct) throws org.apache.thrift.TException {
+ public void read(org.apache.thrift.protocol.TProtocol iprot, launchExperiment_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
@@ -90047,14 +91655,6 @@ public class Airavata {
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;
case 1: // IRE
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.ire = new org.apache.airavata.model.error.InvalidRequestException();
@@ -90111,15 +91711,10 @@ public class Airavata {
struct.validate();
}
- public void write(org.apache.thrift.protocol.TProtocol oprot, validateExperiment_result struct) throws org.apache.thrift.TException {
+ public void write(org.apache.thrift.protocol.TProtocol oprot, launchExperiment_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();
- }
if (struct.ire != null) {
oprot.writeFieldBegin(IRE_FIELD_DESC);
struct.ire.write(oprot);
@@ -90151,40 +91746,34 @@ public class Airavata {
}
- private static class validateExperiment_resultTupleSchemeFactory implements SchemeFactory {
- public validateExperiment_resultTupleScheme getScheme() {
- return new validateExperiment_resultTupleScheme();
+ private static class launchExperiment_resultTupleSchemeFactory implements SchemeFactory {
+ public launchExperiment_resultTupleScheme getScheme() {
+ return new launchExperiment_resultTupleScheme();
}
}
- private static class validateExperiment_resultTupleScheme extends TupleScheme<validateExperiment_result> {
+ private static class launchExperiment_resultTupleScheme extends TupleScheme<launchExperiment_result> {
@Override
- public void write(org.apache.thrift.protocol.TProtocol prot, validateExperiment_result struct) throws org.apache.thrift.TException {
+ public void write(org.apache.thrift.protocol.TProtocol prot, launchExperiment_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
- if (struct.isSetSuccess()) {
- optionals.set(0);
- }
if (struct.isSetIre()) {
- optionals.set(1);
+ optionals.set(0);
}
if (struct.isSetEnf()) {
- optionals.set(2);
+ optionals.set(1);
}
if (struct.isSetAce()) {
- optionals.set(3);
+ optionals.set(2);
}
if (struct.isSetAse()) {
- optionals.set(4);
+ optionals.set(3);
}
if (struct.isSetAe()) {
- optionals.set(5);
- }
- oprot.writeBitSet(optionals, 6);
- if (struct.isSetSuccess()) {
- oprot.writeBool(struct.success);
+ optionals.set(4);
}
+ oprot.writeBitSet(optionals, 5);
if (struct.isSetIre()) {
struct.ire.write(oprot);
}
@@ -90203,34 +91792,30 @@ public class Airavata {
}
@Override
- public void read(org.apache.thrift.protocol.TProtocol prot, validateExperiment_result struct) throws org.apache.thrift.TException {
+ public void read(org.apache.thrift.protocol.TProtocol prot, launchExperiment_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(6);
+ BitSet incoming = iprot.readBitSet(5);
if (incoming.get(0)) {
- struct.success = iprot.readBool();
- struct.setSuccessIsSet(true);
- }
- if (incoming.get(1)) {
struct.ire = new org.apache.airavata.model.error.InvalidRequestException();
struct.ire.read(iprot);
struct.setIreIsSet(true);
}
- if (incoming.get(2)) {
+ if (incoming.get(1)) {
struct.enf = new org.apache.airavata.model.error.ExperimentNotFoundException();
struct.enf.read(iprot);
struct.setEnfIsSet(true);
}
- if (incoming.get(3)) {
+ if (incoming.get(2)) {
struct.ace = new org.apache.airavata.model.error.AiravataClientException();
struct.ace.read(iprot);
struct.setAceIsSet(true);
}
- if (incoming.get(4)) {
+ if (incoming.get(3)) {
struct.ase = new org.apache.airavata.model.error.AiravataSystemException();
struct.ase.read(iprot);
struct.setAseIsSet(true);
}
- if (incoming.get(5)) {
+ if (incoming.get(4)) {
struct.ae = new org.apache.airavata.model.error.AuthorizationException();
struct.ae.read(iprot);
struct.setAeIsSet(true);
@@ -90240,27 +91825,27 @@ public class Airavata {
}
- public static class launchExperiment_args implements org.apache.thrift.TBase<launchExperiment_args, launchExperiment_args._Fields>, java.io.Serializable, Cloneable, Comparable<launchExperiment_args> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("launchExperiment_args");
+ public static class executePostProcessing_args implements org.apache.thrift.TBase<executePostProcessing_args, executePostProcessing_args._Fields>, java.io.Serializable, Cloneable, Comparable<executePostProcessing_args> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("executePostProcessing_args");
private static final org.apache.thrift.protocol.TField AUTHZ_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("authzToken", org.apache.thrift.protocol.TType.STRUCT, (short)1);
- private static final org.apache.thrift.protocol.TField AIRAVATA_EXPERIMENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("airavataExperimentId", org.apache.thrift.protocol.TType.STRING, (short)2);
+ private static final org.apache.thrift.protocol.TField AIRAVATA_EXPERIMET_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("airavataExperimetId", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField GATEWAY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayId", org.apache.thrift.protocol.TType.STRING, (short)3);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
- schemes.put(StandardScheme.class, new launchExperiment_argsStandardSchemeFactory());
- schemes.put(TupleScheme.class, new launchExperiment_argsTupleSchemeFactory());
+ schemes.put(StandardScheme.class, new executePostProcessing_argsStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new executePostProcessing_argsTupleSchemeFactory());
}
public org.apache.airavata.model.security.AuthzToken authzToken; // required
- public String airavataExperimentId; // required
+ public String airavataExperimetId; // required
public String gatewayId; // 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 {
AUTHZ_TOKEN((short)1, "authzToken"),
- AIRAVATA_EXPERIMENT_ID((short)2, "airavataExperimentId"),
+ AIRAVATA_EXPERIMET_ID((short)2, "airavataExperimetId"),
GATEWAY_ID((short)3, "gatewayId");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -90278,8 +91863,8 @@ public class Airavata {
switch(fieldId) {
case 1: // AUTHZ_TOKEN
return AUTHZ_TOKEN;
- case 2: // AIRAVATA_EXPERIMENT_ID
- return AIRAVATA_EXPERIMENT_ID;
+ case 2: // AIRAVATA_EXPERIMET_ID
+ return AIRAVATA_EXPERIMET_ID;
case 3: // GATEWAY_ID
return GATEWAY_ID;
default:
@@ -90327,51 +91912,51 @@ public class Airavata {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.AUTHZ_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("authzToken", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.model.security.AuthzToken.class)));
- tmpMap.put(_Fields.AIRAVATA_EXPERIMENT_ID, new org.apache.thrift.meta_data.FieldMetaData("airavataExperimentId", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ tmpMap.put(_Fields.AIRAVATA_EXPERIMET_ID, new org.apache.thrift.meta_data.FieldMetaData("airavataExperimetId", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.GATEWAY_ID, new org.apache.thrift.meta_data.FieldMetaData("gatewayId", 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(launchExperiment_args.class, metaDataMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(executePostProcessing_args.class, metaDataMap);
}
- public launchExperiment_args() {
+ public executePostProcessing_args() {
}
- public launchExperiment_args(
+ public executePostProcessing_args(
org.apache.airavata.model.security.AuthzToken authzToken,
- String airavataExperimentId,
+ String airavataExperimetId,
String gatewayId)
{
this();
this.authzToken = authzToken;
- this.airavataExperimentId = airavataExperimentId;
+ this.airavataExperimetId = airavataExperimetId;
this.gatewayId = gatewayId;
}
/**
* Performs a deep copy on <i>other</i>.
*/
- public launchExperiment_args(launchExperiment_args other) {
+ public executePostProcessing_args(executePostProcessing_args other) {
if (other.isSetAuthzToken()) {
this.authzToken = new org.apache.airavata.model.security.AuthzToken(other.authzToken);
}
- if (other.isSetAiravataExperimentId()) {
- this.airavataExperimentId = other.airavataExperimentId;
+ if (other.isSetAiravataExperimetId()) {
+ this.airavataExperimetId = other.airavataExperimetId;
}
if (other.isSetGatewayId()) {
this.gatewayId = other.gatewayId;
}
}
- public launchExperiment_args deepCopy() {
- return new launchExperiment_args(this);
+ public executePostProcessing_args deepCopy() {
+ return new executePostProcessing_args(this);
}
@Override
public void clear() {
this.authzToken = null;
- this.airavataExperimentId = null;
+ this.airavataExperimetId = null;
this.gatewayId = null;
}
@@ -90379,7 +91964,7 @@ public class Airavata {
return this.authzToken;
}
- public launchExperiment_args setAuthzToken(org.apache.airavata.model.security.AuthzToken authzToken) {
+ public executePostProcessing_args setAuthzToken(org.apache.airavata.model.security.AuthzToken authzToken) {
this.authzToken = authzToken;
return this;
}
@@ -90399,27 +91984,27 @@ public class Airavata {
}
}
- public String getAiravataExperimentId() {
- return this.airavataExperimentId;
+ public String getAiravataExperimetId() {
+ return this.airavataExperimetId;
}
- public launchExperiment_args setAiravataExperimentId(String airavataExperimentId) {
- this.airavataExperimentId = airavataExperimentId;
+ public executePostProcessing_args setAiravataExperimetId(String airavataExperimetId) {
+ this.airavataExperimetId = airavataExperimetId;
return this;
}
- public void unsetAiravataExperimentId() {
- this.airavataExperimentId = null;
+ public void unsetAiravataExperimetId() {
+ this.airavataExperimetId = null;
}
- /** Returns true if field airavataExperimentId is set (has been assigned a value) and false otherwise */
- public boolean isSetAiravataExperimentId() {
- return this.airavataExperimentId != null;
+ /** Returns true if field airavataExperimetId is set (has been assigned a value) and false otherwise */
+ public boolean isSetAiravataExperimetId() {
+ return this.airavataExperimetId != null;
}
- public void setAiravataExperimentIdIsSet(boolean value) {
+ public void setAiravataExperimetIdIsSet(boolean value) {
if (!value) {
- this.airavataExperimentId = null;
+ this.airavataExperimetId = null;
}
}
@@ -90427,7 +92012,7 @@ public class Airavata {
return this.gatewayId;
}
- public launchExperiment_args setGatewayId(String gatewayId) {
+ public executePostProcessing_args setGatewayId(String gatewayId) {
this.gatewayId = gatewayId;
return this;
}
@@ -90457,11 +92042,11 @@ public class Airavata {
}
break;
- case AIRAVATA_EXPERIMENT_ID:
+ case AIRAVATA_EXPERIMET_ID:
if (value == null) {
- unsetAiravataExperimentId();
+ unsetAiravataExperimetId();
} else {
- setAiravataExperimentId((String)value);
+ setAiravataExperimetId((String)value);
}
break;
@@ -90481,8 +92066,8 @@ public class Airavata {
case AUTHZ_TOKEN:
return getAuthzToken();
- case AIRAVATA_EXPERIMENT_ID:
- return getAiravataExperimentId();
+ case AIRAVATA_EXPERIMET_ID:
+ return getAiravataExperimetId();
case GATEWAY_ID:
return getGatewayId();
@@ -90500,8 +92085,8 @@ public class Airavata {
switch (field) {
case AUTHZ_TOKEN:
return isSetAuthzToken();
- case AIRAVATA_EXPERIMENT_ID:
- return isSetAiravataExperimentId();
+ case AIRAVATA_EXPERIMET_ID:
+ return isSetAiravataExperimetId();
case GATEWAY_ID:
return isSetGatewayId();
}
@@ -90512,12 +92097,12 @@ public class Airavata {
public boolean equals(Object that) {
if (that == null)
return false;
- if (that instanceof launchExperiment_args)
- return this.equals((launchExperiment_args)that);
+ if (that instanceof executePostProcessing_args)
+ return this.equals((executePostProcessing_args)that);
return false;
}
- public boolean equals(launchExperiment_args that) {
+ public boolean equals(executePostProcessing_args that) {
if (that == null)
return false;
@@ -90530,12 +92115,12 @@ public class Airavata {
return false;
}
- boolean this_present_airavataExperimentId = true && this.isSetAiravataExperimentId();
- boolean that_present_airavataExperimentId = true && that.isSetAiravataExperimentId();
- if (this_present_airavataExperimentId || that_present_airavataExperimentId) {
- if (!(this_present_airavataExperimentId && that_present_airavataExperimentId))
+ boolean this_present_airavataExperimetId = true && this.isSetAiravataExperimetId();
+ boolean that_present_airavataExperimetId = true && that.isSetAiravataExperimetId();
+ if (this_present_airavataExperimetId || that_present_airavataExperimetId) {
+ if (!(this_present_airavataExperimetId && that_present_airavataExperimetId))
return false;
- if (!this.airavataExperimentId.equals(that.airavataExperimentId))
+ if (!this.airavataExperimetId.equals(that.airavataExperimetId))
return false;
}
@@ -90560,10 +92145,10 @@ public class Airavata {
if (present_authzToken)
list.add(authzToken);
- boolean present_airavataExperimentId = true && (isSetAiravataExperimentId());
- list.add(present_airavataExperimentId);
- if (present_airavataExperimentId)
- list.add(airavataExperimentId);
+ boolean present_airavataExperimetId = true && (isSetAiravataExperimetId());
+ list.add(present_airavataExperimetId);
+ if (present_airavataExperimetId)
+ list.add(airavataExperimetId);
boolean present_gatewayId = true && (isSetGatewayId());
list.add(present_gatewayId);
@@ -90574,7 +92159,7 @@ public class Airavata {
}
@Override
- public int compareTo(launchExperiment_args other) {
+ public int compareTo(executePostProcessing_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
@@ -90591,12 +92176,12 @@ public class Airavata {
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetAiravataExperimentId()).compareTo(other.isSetAiravataExperimentId());
+ lastComparison = Boolean.valueOf(isSetAiravataExperimetId()).compareTo(other.isSetAiravataExperimetId());
if (lastComparison != 0) {
return lastComparison;
}
- if (isSetAiravataExperimentId()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.airavataExperimentId, other.airavataExperimentId);
+ if (isSetAiravataExperimetId()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.airavataExperimetId, other.airavataExperimetId);
if (lastComparison != 0) {
return lastComparison;
}
@@ -90628,7 +92213,7 @@ public class Airavata {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder("launchExperiment_args(");
+ StringBuilder sb = new StringBuilder("executePostProcessing_args(");
boolean first = true;
sb.append("authzToken:");
@@ -90639,11 +92224,11 @@ public class Airavata {
}
first = false;
if (!first) sb.append(", ");
- sb.append("airavataExperimentId:");
- if (this.airavataExperimentId == null) {
+ sb.append("airavataExperimetId:");
+ if (this.airavataExperimetId == null) {
sb.append("null");
} else {
- sb.append(this.airavataExperimentId);
+ sb.append(this.airavataExperimetId);
}
first = false;
if (!first) sb.append(", ");
@@ -90663,8 +92248,8 @@ public class Airavata {
if (authzToken == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'authzToken' was not present! Struct: " + toString());
}
- if (airavataExperimentId == null) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'airavataExperimentId' was not present! Struct: " + toString());
+ if (airavataExperimetId == null) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'airavataExperimetId' was not present! Struct: " + toString());
}
if (gatewayId == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'gatewayId' was not present! Struct: " + toString());
@@ -90691,15 +92276,15 @@ public class Airavata {
}
}
- private static class launchExperiment_argsStandardSchemeFactory implements SchemeFactory {
- public launchExperiment_argsStandardScheme getScheme() {
- return new launchExperiment_argsStandardScheme();
+ private static class executePostProcessing_argsStandardSchemeFactory implements SchemeFactory {
+ public executePostProcessing_argsStandardScheme getScheme() {
+ return new executePostProcessing_argsStandardScheme();
}
}
- private static class launchExperiment_argsStandardScheme extends StandardScheme<launchExperiment_args> {
+ private static class executePostProcessing_argsStandardScheme extends StandardScheme<executePostProcessing_args> {
- public void read(org.apache.thrift.protocol.TProtocol iprot, launchExperiment_args struct) throws org.apache.thrift.TException {
+ public void read(org.apache.thrift.protocol.TProtocol iprot, executePostProcessing_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
@@ -90718,10 +92303,10 @@ public class Airavata {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
- case 2: // AIRAVATA_EXPERIMENT_ID
+ case 2: // AIRAVATA_EXPERIMET_ID
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.airavataExperimentId = iprot.readString();
- struct.setAiravataExperimentIdIsSet(true);
+ struct.airavataExperimetId = iprot.readString();
+ struct.setAiravataExperimetIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
@@ -90745,7 +92330,7 @@ public class Airavata {
struct.validate();
}
- public void write(org.apache.thrift.protocol.TProtocol oprot, launchExperiment_args struct) throws org.apache.thrift.TException {
+ public void write(org.apache.thrift.protocol.TProtocol oprot, executePostProcessing_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
@@ -90754,9 +92339,9 @@ public class Airavata {
struct.authzToken.write(oprot);
oprot.writeFieldEnd();
}
- if (struct.airavataExperimentId != null) {
- oprot.writeFieldBegin(AIRAVATA_EXPERIMENT_ID_FIELD_DESC);
- oprot.writeString(struct.airavataExperimentId);
+ if (struct.airavataExperimetId != null) {
+ oprot.writeFieldBegin(AIRAVATA_EXPERIMET_ID_FIELD_DESC);
+ oprot.writeString(struct.airavataExperimetId);
oprot.writeFieldEnd();
}
if (struct.gatewayId != null) {
@@ -90770,30 +92355,30 @@ public class Airavata {
}
- private static class launchExperiment_argsTupleSchemeFactory implements SchemeFactory {
- public launchExperiment_argsTupleScheme getScheme() {
- return new launchExperiment_argsTupleScheme();
+ private static class executePostProcessing_argsTupleSchemeFactory implements SchemeFactory {
+ public executePostProcessing_argsTupleScheme getScheme() {
+ return new executePostProcessing_argsTupleScheme();
}
}
- private static class launchExperiment_argsTupleScheme extends TupleScheme<launchExperiment_args> {
+ private static class executePostProcessing_argsTupleScheme extends TupleScheme<executePostProcessing_args> {
@Override
- public void write(org.apache.thrift.protocol.TProtocol prot, launchExperiment_args struct) throws org.apache.thrift.TException {
+ public void write(org.apache.thrift.protocol.TProtocol prot, executePostProcessing_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
struct.authzToken.write(oprot);
- oprot.writeString(struct.airavataExperimentId);
+ oprot.writeString(struct.airavataExperimetId);
oprot.writeString(struct.gatewayId);
}
@Override
- public void read(org.apache.thrift.protocol.TProtocol prot, launchExperiment_args struct) throws org.apache.thrift.TException {
+ public void read(org.apache.thrift.protocol.TProtocol prot, executePostProcessing_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
struct.authzToken = new org.apache.airavata.model.security.AuthzToken();
struct.authzToken.read(iprot);
struct.setAuthzTokenIsSet(true);
- struct.airavataExperimentId = iprot.readString();
- struct.setAiravataExperimentIdIsSet(true);
+ struct.airavataExperimetId = iprot.readString();
+ struct.setAiravataExperimetIdIsSet(true);
struct.gatewayId = iprot.readString();
struct.setGatewayIdIsSet(true);
}
@@ -90801,8 +92386,8 @@ public class Airavata {
}
- public static class launchExperiment_result implements org.apache.thrift.TBase<launchExperiment_result, launchExperiment_result._Fields>, java.io.Serializable, Cloneable, Comparable<launchExperiment_result> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("launchExperiment_result");
+ public static class executePostProcessing_result implements org.apache.thrift.TBase<executePostProcessing_result, executePostProcessing_result._Fields>, java.io.Serializable, Cloneable, Comparable<executePostProcessing_result> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("executePostProcessing_result");
private static final org.apache.thrift.protocol.TField IRE_FIELD_DESC = new org.apache.thrift.protocol.TField("ire", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.protocol.TField ENF_FIELD_DESC = new org.apache.thrift.protocol.TField("enf", org.apache.thrift.protocol.TType.STRUCT, (short)2);
@@ -90812,8 +92397,8 @@ public class Airavata {
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
- schemes.put(StandardScheme.class, new launchExperiment_resultStandardSchemeFactory());
- schemes.put(TupleScheme.class, new launchExperiment_resultTupleSchemeFactory());
+ schemes.put(StandardScheme.class, new executePostProcessing_resultStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new executePostProcessing_resultTupleSchemeFactory());
}
public org.apache.airavata.model.error.InvalidRequestException ire; // required
@@ -90907,13 +92492,13 @@ public class Airavata {
tmpMap.put(_Fields.AE, new org.apache.thrift.meta_data.FieldMetaData("ae", 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(launchExperiment_result.class, metaDataMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(executePostProcessing_result.class, metaDataMap);
}
- public launchExperiment_result() {
+ public executePostProcessing_result() {
}
- public launchExperiment_result(
+ public executePostProcessing_result(
org.apache.airavata.model.error.InvalidRequestException ire,
org.apache.airavata.model.error.ExperimentNotFoundException enf,
org.apache.airavata.model.error.AiravataClientException ace,
@@ -90931,7 +92516,7 @@ public class Airavata {
/**
* Performs a deep copy on <i>other</i>.
*/
- public launchExperiment_result(launchExperiment_result other) {
+ public executePostProcessing_result(executePostProcessing_result other) {
if (other.isSetIre()) {
this.ire = new org.apache.airavata.model.error.InvalidRequestException(other.ire);
}
@@ -90949,8 +92534,8 @@ public class Airavata {
}
}
- public launchExperiment_result deepCopy() {
- return new launchExperiment_result(this);
+ public executePostProcessing_result deepCopy() {
+ return new executePostProcessing_result(this);
}
@Override
@@ -90966,7 +92551,7 @@ public class Airavata {
return this.ire;
}
- public launchExperiment_result setIre(org.apache.airavata.model.error.InvalidRequestException ire) {
+ public executePostProcessing_result setIre(org.apache.airavata.model.error.InvalidRequestException ire) {
this.ire = ire;
return this;
}
@@ -90990,7 +92575,7 @@ public class Airavata {
return this.enf;
}
- public launchExperiment_result setEnf(org.apache.airavata.model.error.ExperimentNotFoundException enf) {
+ public executePostProcessing_result setEnf(org.apache.airavata.model.error.ExperimentNotFoundException enf) {
this.enf = enf;
return this;
}
@@ -91014,7 +92599,7 @@ public class Airavata {
return this.ace;
}
- public launchExperiment_result setAce(org.apache.airavata.model.error.AiravataClientException ace) {
+ public executePostProcessing_result setAce(org.apache.airavata.model.error.AiravataClientException ace) {
this.ace = ace;
return this;
}
@@ -91038,7 +92623,7 @@ public class Airavata {
return this.ase;
}
- public launchExperiment_result setAse(org.apache.airavata.model.error.AiravataSystemException ase) {
+ public executePostProcessing_result setAse(org.apache.airavata.model.error.AiravataSystemException ase) {
this.ase = ase;
return this;
}
@@ -91062,7 +92647,7 @@ public class Airavata {
return this.ae;
}
- public launchExperiment_result setAe(org.apache.airavata.model.error.AuthorizationException ae) {
+ public executePostProcessing_result setAe(org.apache.airavata.model.error.AuthorizationException ae) {
this.ae = ae;
return this;
}
@@ -91173,12 +92758,12 @@ public class Airavata {
public boolean equals(Object that) {
if (that == null)
return false;
- if (that instanceof launchExperiment_result)
- return this.equals((launchExperiment_result)that);
+ if (that instanceof executePostProcessing_result)
+ return this.equals((executePostProcessing_result)that);
return false;
}
- public boolean equals(launchExperiment_result that) {
+ public boolean equals(executePostProcessing_result that) {
if (that == null)
return false;
@@ -91263,7 +92848,7 @@ public class Airavata {
}
@Override
- public int compareTo(launchExperiment_result other) {
+ public int compareTo(executePostProcessing_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
@@ -91337,7 +92922,7 @@ public class Airavata {
@Override
public String toString() {
- StringBuilder sb = new StringBuilder("launchExperiment_result(");
+ StringBuilder sb = new StringBuilder("executePostProcessing_result(");
boolean first = true;
sb.append("ire:");
@@ -91404,15 +92989,15 @@ public class Airavata {
}
}
- private static class launchExperiment_resultStandardSchemeFactory implements SchemeFactory {
- public launchExperiment_resultStandardScheme getScheme() {
- return new launchExperiment_resultStandardScheme();
+ private static class executePostProcessing_resultStandardSchemeFactory implements SchemeFactory {
+ public executePostProcessing_resultStandardScheme getScheme() {
+ return new executePostProcessing_resultStandardScheme();
}
}
- private static class launchExperiment_resultStandardScheme extends StandardScheme<launchExperiment_result> {
+ private static class executePostProcessing_resultStandardScheme extends StandardScheme<executePostProcessing_result> {
- public void read(org.apache.thrift.protocol.TProtocol iprot, launchExperiment_result struct) throws org.apache.thrift.TException {
+ public void read(org.apache.thrift.protocol.TProtocol iprot, executePostProcessing_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
@@ -91478,7 +93063,7 @@ public class Airavata {
struct.validate();
}
- public void write(org.apache.thrift.protocol.TProtocol oprot, launchExperiment_result struct) throws org.apache.thrift.TException {
+ public void write(org.apache.thrift.protocol.TProtocol oprot, executePostProcessing_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
@@ -91513,16 +93098,16 @@ public class Airavata {
}
- private static class launchExperiment_resultTupleSchemeFactory implements SchemeFactory {
- public launchExperiment_resultTupleScheme getScheme() {
- return new launchExperiment_resultTupleScheme();
+ private static class executePostProcessing_resultTupleSchemeFactory implements SchemeFactory {
+ public executePostProcessing_resultTupleScheme getScheme() {
+ return new executePostProcessing_resultTupleScheme();
}
}
- private static class launchExperiment_resultTupleScheme extends TupleScheme<launchExperiment_result> {
+ private static class executePostProcessing_resultTupleScheme extends TupleScheme<executePostProcessing_result> {
@Override
- public void write(org.apache.thrift.protocol.TProtocol prot, launchExperiment_result struct) throws org.apache.thrift.TException {
+ public void write(org.apache.thrift.protocol.TProtocol prot, executePostProcessing_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetIre()) {
@@ -91559,7 +93144,7 @@ public class Airavata {
}
@Override
- public void read(org.apache.thrift.protocol.TProtocol prot, launchExperiment_result struct) throws org.apache.thrift.TException {
+ public void read(org.apache.thrift.protocol.TProtocol prot, executePostProcessing_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(5);
if (incoming.get(0)) {
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/ForcePostProcessingExperiment.java b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/ForcePostProcessingExperiment.java
new file mode 100644
index 0000000..ca602b6
--- /dev/null
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/ForcePostProcessingExperiment.java
@@ -0,0 +1,43 @@
+package org.apache.airavata.client.samples;
+
+import org.apache.airavata.api.Airavata;
+import org.apache.airavata.api.client.AiravataClientFactory;
+import org.apache.airavata.model.error.AiravataClientException;
+import org.apache.airavata.model.security.AuthzToken;
+import org.apache.commons.io.IOUtils;
+import org.apache.thrift.TException;
+
+import java.io.BufferedInputStream;
+import java.io.IOException;
+
+/**
+ * This class will demonstrate an example of force post processing of an experiment, Using this, you can manually trigger
+ * post processing tasks of the experiment.
+ *
+ * @author dimuthu
+ * @since 1.0.0-SNAPSHOT
+ */
+public class ForcePostProcessingExperiment {
+
+ private static final String THRIFT_SERVER_HOST = "127.0.0.1";
+ private static final int THRIFT_SERVER_PORT = 8930;
+
+ private Airavata.Client airavataClient;
+ private String experimentId = "dummy-echo-experiment_03e7de4f-04fe-4e0e-9402-7f46289105f2";
+ private String gatewayId = "default";
+
+ public static void main(String args[]) throws TException, IOException {
+ ForcePostProcessingExperiment fppExperiment = new ForcePostProcessingExperiment();
+ fppExperiment.register();
+ }
+
+ public void register() throws TException {
+ airavataClient = AiravataClientFactory.createAiravataClient(THRIFT_SERVER_HOST, THRIFT_SERVER_PORT);
+ forcePostProcess();
+ System.out.println("Force post processing started for experiment " + experimentId);
+ }
+
+ private void forcePostProcess() throws TException {
+ airavataClient.executePostProcessing(new AuthzToken(""), experimentId, gatewayId);
+ }
+}
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/MessageType.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/MessageType.java
index 16bac7f..4fefa6a 100644
--- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/MessageType.java
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/MessageType.java
@@ -37,7 +37,8 @@ public enum MessageType implements org.apache.thrift.TEnum {
LAUNCHPROCESS(5),
TERMINATEPROCESS(6),
PROCESSOUTPUT(7),
- DB_EVENT(8);
+ DB_EVENT(8),
+ POSTPROCESSING_START(9);
private final int value;
@@ -76,6 +77,8 @@ public enum MessageType implements org.apache.thrift.TEnum {
return PROCESSOUTPUT;
case 8:
return DB_EVENT;
+ case 9:
+ return POSTPROCESSING_START;
default:
return null;
}
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/process/ProcessModel.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/process/ProcessModel.java
index 5fa77d0..bde02f7 100644
--- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/process/ProcessModel.java
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/process/ProcessModel.java
@@ -88,6 +88,7 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce
private static final org.apache.thrift.protocol.TField EXPERIMENT_DATA_DIR_FIELD_DESC = new org.apache.thrift.protocol.TField("experimentDataDir", org.apache.thrift.protocol.TType.STRING, (short)22);
private static final org.apache.thrift.protocol.TField USER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("userName", org.apache.thrift.protocol.TType.STRING, (short)23);
private static final org.apache.thrift.protocol.TField USE_USER_CRPREF_FIELD_DESC = new org.apache.thrift.protocol.TField("useUserCRPref", org.apache.thrift.protocol.TType.BOOL, (short)24);
+ private static final org.apache.thrift.protocol.TField PROCESS_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("processType", org.apache.thrift.protocol.TType.I32, (short)25);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
@@ -119,6 +120,7 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce
private String experimentDataDir; // optional
private String userName; // optional
private boolean useUserCRPref; // optional
+ private ProcessType processType; // 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 {
@@ -145,7 +147,8 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce
GENERATE_CERT((short)21, "generateCert"),
EXPERIMENT_DATA_DIR((short)22, "experimentDataDir"),
USER_NAME((short)23, "userName"),
- USE_USER_CRPREF((short)24, "useUserCRPref");
+ USE_USER_CRPREF((short)24, "useUserCRPref"),
+ PROCESS_TYPE((short)25, "processType");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -208,6 +211,8 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce
return USER_NAME;
case 24: // USE_USER_CRPREF
return USE_USER_CRPREF;
+ case 25: // PROCESS_TYPE
+ return PROCESS_TYPE;
default:
return null;
}
@@ -312,6 +317,8 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.USE_USER_CRPREF, new org.apache.thrift.meta_data.FieldMetaData("useUserCRPref", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+ tmpMap.put(_Fields.PROCESS_TYPE, new org.apache.thrift.meta_data.FieldMetaData("processType", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.ENUM , "ProcessType")));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ProcessModel.class, metaDataMap);
}
@@ -325,11 +332,13 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce
public ProcessModel(
String processId,
- String experimentId)
+ String experimentId,
+ ProcessType processType)
{
this();
this.processId = processId;
this.experimentId = experimentId;
+ this.processType = processType;
}
/**
@@ -420,6 +429,9 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce
this.userName = other.userName;
}
this.useUserCRPref = other.useUserCRPref;
+ if (other.isSetProcessType()) {
+ this.processType = other.processType;
+ }
}
public ProcessModel deepCopy() {
@@ -458,6 +470,7 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce
this.userName = null;
setUseUserCRPrefIsSet(false);
this.useUserCRPref = false;
+ this.processType = null;
}
public String getProcessId() {
@@ -1097,6 +1110,29 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __USEUSERCRPREF_ISSET_ID, value);
}
+ public ProcessType getProcessType() {
+ return this.processType;
+ }
+
+ public void setProcessType(ProcessType processType) {
+ this.processType = processType;
+ }
+
+ public void unsetProcessType() {
+ this.processType = null;
+ }
+
+ /** Returns true if field processType is set (has been assigned a value) and false otherwise */
+ public boolean isSetProcessType() {
+ return this.processType != null;
+ }
+
+ public void setProcessTypeIsSet(boolean value) {
+ if (!value) {
+ this.processType = null;
+ }
+ }
+
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case PROCESS_ID:
@@ -1291,6 +1327,14 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce
}
break;
+ case PROCESS_TYPE:
+ if (value == null) {
+ unsetProcessType();
+ } else {
+ setProcessType((ProcessType)value);
+ }
+ break;
+
}
}
@@ -1368,6 +1412,9 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce
case USE_USER_CRPREF:
return isUseUserCRPref();
+ case PROCESS_TYPE:
+ return getProcessType();
+
}
throw new IllegalStateException();
}
@@ -1427,6 +1474,8 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce
return isSetUserName();
case USE_USER_CRPREF:
return isSetUseUserCRPref();
+ case PROCESS_TYPE:
+ return isSetProcessType();
}
throw new IllegalStateException();
}
@@ -1660,6 +1709,15 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce
return false;
}
+ boolean this_present_processType = true && this.isSetProcessType();
+ boolean that_present_processType = true && that.isSetProcessType();
+ if (this_present_processType || that_present_processType) {
+ if (!(this_present_processType && that_present_processType))
+ return false;
+ if (!this.processType.equals(that.processType))
+ return false;
+ }
+
return true;
}
@@ -1787,6 +1845,11 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce
if (present_useUserCRPref)
list.add(useUserCRPref);
+ boolean present_processType = true && (isSetProcessType());
+ list.add(present_processType);
+ if (present_processType)
+ list.add(processType.getValue());
+
return list.hashCode();
}
@@ -2038,6 +2101,16 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce
return lastComparison;
}
}
+ lastComparison = Boolean.valueOf(isSetProcessType()).compareTo(other.isSetProcessType());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetProcessType()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.processType, other.processType);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
return 0;
}
@@ -2273,6 +2346,14 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce
sb.append(this.useUserCRPref);
first = false;
}
+ if (!first) sb.append(", ");
+ sb.append("processType:");
+ if (this.processType == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.processType);
+ }
+ first = false;
sb.append(")");
return sb.toString();
}
@@ -2287,6 +2368,10 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce
throw new org.apache.thrift.protocol.TProtocolException("Required field 'experimentId' is unset! Struct:" + toString());
}
+ if (!isSetProcessType()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'processType' is unset! Struct:" + toString());
+ }
+
// check for sub-struct validity
if (processResourceSchedule != null) {
processResourceSchedule.validate();
@@ -2587,6 +2672,14 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
+ case 25: // PROCESS_TYPE
+ if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+ struct.processType = org.apache.airavata.model.process.ProcessType.findByValue(iprot.readI32());
+ struct.setProcessTypeIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
@@ -2796,6 +2889,11 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce
oprot.writeBool(struct.useUserCRPref);
oprot.writeFieldEnd();
}
+ if (struct.processType != null) {
+ oprot.writeFieldBegin(PROCESS_TYPE_FIELD_DESC);
+ oprot.writeI32(struct.processType.getValue());
+ oprot.writeFieldEnd();
+ }
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@@ -2815,6 +2913,7 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce
TTupleProtocol oprot = (TTupleProtocol) prot;
oprot.writeString(struct.processId);
oprot.writeString(struct.experimentId);
+ oprot.writeI32(struct.processType.getValue());
BitSet optionals = new BitSet();
if (struct.isSetCreationTime()) {
optionals.set(0);
@@ -2994,6 +3093,8 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce
struct.setProcessIdIsSet(true);
struct.experimentId = iprot.readString();
struct.setExperimentIdIsSet(true);
+ struct.processType = org.apache.airavata.model.process.ProcessType.findByValue(iprot.readI32());
+ struct.setProcessTypeIsSet(true);
BitSet incoming = iprot.readBitSet(22);
if (incoming.get(0)) {
struct.creationTime = iprot.readI64();
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/status/ExperimentState.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/process/ProcessType.java
similarity index 68%
copy from airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/status/ExperimentState.java
copy to airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/process/ProcessType.java
index 84e468b..3fb045c 100644
--- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/status/ExperimentState.java
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/process/ProcessType.java
@@ -21,27 +21,20 @@
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
-package org.apache.airavata.model.status;
+package org.apache.airavata.model.process;
import java.util.Map;
import java.util.HashMap;
import org.apache.thrift.TEnum;
-public enum ExperimentState implements org.apache.thrift.TEnum {
- CREATED(0),
- VALIDATED(1),
- SCHEDULED(2),
- LAUNCHED(3),
- EXECUTING(4),
- CANCELING(5),
- CANCELED(6),
- COMPLETED(7),
- FAILED(8);
+public enum ProcessType implements org.apache.thrift.TEnum {
+ PRIMARY(0),
+ FORCE_POST_PROCESING(1);
private final int value;
- private ExperimentState(int value) {
+ private ProcessType(int value) {
this.value = value;
}
@@ -56,26 +49,12 @@ public enum ExperimentState implements org.apache.thrift.TEnum {
* Find a the enum type by its integer value, as defined in the Thrift IDL.
* @return null if the value is not found.
*/
- public static ExperimentState findByValue(int value) {
+ public static ProcessType findByValue(int value) {
switch (value) {
case 0:
- return CREATED;
+ return PRIMARY;
case 1:
- return VALIDATED;
- case 2:
- return SCHEDULED;
- case 3:
- return LAUNCHED;
- case 4:
- return EXECUTING;
- case 5:
- return CANCELING;
- case 6:
- return CANCELED;
- case 7:
- return COMPLETED;
- case 8:
- return FAILED;
+ return FORCE_POST_PROCESING;
default:
return null;
}
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/status/ExperimentState.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/status/ExperimentState.java
index 84e468b..26ba127 100644
--- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/status/ExperimentState.java
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/status/ExperimentState.java
@@ -37,7 +37,11 @@ public enum ExperimentState implements org.apache.thrift.TEnum {
CANCELING(5),
CANCELED(6),
COMPLETED(7),
- FAILED(8);
+ FAILED(8),
+ FORCE_POST_PROCESSING_EXECUTING(9),
+ FORCE_POST_PROCESSING_COMPLETED(10),
+ FORCE_POST_PROCESSING_FAILED(11),
+ FORCE_POST_PROCESSING_CANCELED(12);
private final int value;
@@ -76,6 +80,14 @@ public enum ExperimentState implements org.apache.thrift.TEnum {
return COMPLETED;
case 8:
return FAILED;
+ case 9:
+ return FORCE_POST_PROCESSING_EXECUTING;
+ case 10:
+ return FORCE_POST_PROCESSING_COMPLETED;
+ case 11:
+ return FORCE_POST_PROCESSING_FAILED;
+ case 12:
+ return FORCE_POST_PROCESSING_CANCELED;
default:
return null;
}
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/SCPDataStageTask.java b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/SCPDataStageTask.java
index fe0eb3b..d0f982d 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/SCPDataStageTask.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/SCPDataStageTask.java
@@ -286,10 +286,16 @@ public class SCPDataStageTask implements Task {
}
private void localDataCopy(TaskContext taskContext, URI sourceURI, URI destinationURI) throws GFacException {
- StringBuilder sb = new StringBuilder("rsync -cr ");
- sb.append(sourceURI.getPath()).append(" ").append(destinationURI.getPath());
- CommandInfo commandInfo = new RawCommandInfo(sb.toString());
- taskContext.getParentProcessContext().getDataMovementRemoteCluster().execute(commandInfo);
+ File destinationFile = new File(destinationURI.getPath());
+ File destinationParentDir = destinationFile.getParentFile();
+ String destinationParentPath = destinationParentDir.getPath();
+ // create the parent directory if it does not exist.
+ String mkdirCommand = "mkdir -p " + destinationParentPath;
+ String rsyncCommand = "rsync -cr " + sourceURI.getPath() + " " + destinationURI.getPath();
+ CommandInfo mkdirCommandInfo = new RawCommandInfo(mkdirCommand);
+ CommandInfo rsyncCommandInfo = new RawCommandInfo(rsyncCommand);
+ taskContext.getParentProcessContext().getDataMovementRemoteCluster().execute(mkdirCommandInfo);
+ taskContext.getParentProcessContext().getDataMovementRemoteCluster().execute(rsyncCommandInfo);
}
private void inputDataStaging(TaskContext taskContext, Session srcSession, URI sourceURI, Session destSession, URI
diff --git a/modules/messaging/core/src/main/java/org/apache/airavata/messaging/core/impl/ExperimentConsumer.java b/modules/messaging/core/src/main/java/org/apache/airavata/messaging/core/impl/ExperimentConsumer.java
index b761380..442381c 100644
--- a/modules/messaging/core/src/main/java/org/apache/airavata/messaging/core/impl/ExperimentConsumer.java
+++ b/modules/messaging/core/src/main/java/org/apache/airavata/messaging/core/impl/ExperimentConsumer.java
@@ -66,7 +66,8 @@ public class ExperimentConsumer extends QueueingConsumer {
try {
ThriftUtils.createThriftFromBytes(body, message);
long deliveryTag = envelope.getDeliveryTag();
- if (message.getMessageType() == MessageType.EXPERIMENT || message.getMessageType() == MessageType.EXPERIMENT_CANCEL) {
+ if (message.getMessageType() == MessageType.EXPERIMENT || message.getMessageType() == MessageType.EXPERIMENT_CANCEL
+ || message.getMessageType().equals(MessageType.POSTPROCESSING_START)) {
TBase event = null;
String gatewayId = null;
ExperimentSubmitEvent experimentEvent = new ExperimentSubmitEvent();
diff --git a/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/cpi/OrchestratorService.java b/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/cpi/OrchestratorService.java
index 4c37b59..90417c3 100644
--- a/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/cpi/OrchestratorService.java
+++ b/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/cpi/OrchestratorService.java
@@ -140,6 +140,8 @@ public class OrchestratorService {
*/
public boolean terminateExperiment(String experimentId, String gatewayId) throws org.apache.thrift.TException;
+ public boolean launchPostProcessingOfExperiment(String experimentId, String gatewayId) throws org.apache.thrift.TException;
+
}
public interface AsyncIface {
@@ -156,6 +158,8 @@ public class OrchestratorService {
public void terminateExperiment(String experimentId, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+ public void launchPostProcessingOfExperiment(String experimentId, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
}
public static class Client extends org.apache.thrift.TServiceClient implements Iface {
@@ -326,6 +330,30 @@ public class OrchestratorService {
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "terminateExperiment failed: unknown result");
}
+ public boolean launchPostProcessingOfExperiment(String experimentId, String gatewayId) throws org.apache.thrift.TException
+ {
+ send_launchPostProcessingOfExperiment(experimentId, gatewayId);
+ return recv_launchPostProcessingOfExperiment();
+ }
+
+ public void send_launchPostProcessingOfExperiment(String experimentId, String gatewayId) throws org.apache.thrift.TException
+ {
+ launchPostProcessingOfExperiment_args args = new launchPostProcessingOfExperiment_args();
+ args.setExperimentId(experimentId);
+ args.setGatewayId(gatewayId);
+ sendBase("launchPostProcessingOfExperiment", args);
+ }
+
+ public boolean recv_launchPostProcessingOfExperiment() throws org.apache.thrift.TException
+ {
+ launchPostProcessingOfExperiment_result result = new launchPostProcessingOfExperiment_result();
+ receiveBase(result, "launchPostProcessingOfExperiment");
+ if (result.isSetSuccess()) {
+ return result.success;
+ }
+ throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "launchPostProcessingOfExperiment 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<AsyncClient> {
@@ -548,6 +576,41 @@ public class OrchestratorService {
}
}
+ public void launchPostProcessingOfExperiment(String experimentId, String gatewayId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ checkReady();
+ launchPostProcessingOfExperiment_call method_call = new launchPostProcessingOfExperiment_call(experimentId, gatewayId, resultHandler, this, ___protocolFactory, ___transport);
+ this.___currentMethod = method_call;
+ ___manager.call(method_call);
+ }
+
+ public static class launchPostProcessingOfExperiment_call extends org.apache.thrift.async.TAsyncMethodCall {
+ private String experimentId;
+ private String gatewayId;
+ public launchPostProcessingOfExperiment_call(String experimentId, String gatewayId, 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.experimentId = experimentId;
+ this.gatewayId = gatewayId;
+ }
+
+ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+ prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("launchPostProcessingOfExperiment", org.apache.thrift.protocol.TMessageType.CALL, 0));
+ launchPostProcessingOfExperiment_args args = new launchPostProcessingOfExperiment_args();
+ args.setExperimentId(experimentId);
+ args.setGatewayId(gatewayId);
+ 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_launchPostProcessingOfExperiment();
+ }
+ }
+
}
public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor {
@@ -567,6 +630,7 @@ public class OrchestratorService {
processMap.put("validateExperiment", new validateExperiment());
processMap.put("validateProcess", new validateProcess());
processMap.put("terminateExperiment", new terminateExperiment());
+ processMap.put("launchPostProcessingOfExperiment", new launchPostProcessingOfExperiment());
return processMap;
}
@@ -703,6 +767,27 @@ public class OrchestratorService {
}
}
+ public static class launchPostProcessingOfExperiment<I extends Iface> extends org.apache.thrift.ProcessFunction<I, launchPostProcessingOfExperiment_args> {
+ public launchPostProcessingOfExperiment() {
+ super("launchPostProcessingOfExperiment");
+ }
+
+ public launchPostProcessingOfExperiment_args getEmptyArgsInstance() {
+ return new launchPostProcessingOfExperiment_args();
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public launchPostProcessingOfExperiment_result getResult(I iface, launchPostProcessingOfExperiment_args args) throws org.apache.thrift.TException {
+ launchPostProcessingOfExperiment_result result = new launchPostProcessingOfExperiment_result();
+ result.success = iface.launchPostProcessingOfExperiment(args.experimentId, args.gatewayId);
+ result.setSuccessIsSet(true);
+ return result;
+ }
+ }
+
}
public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> {
@@ -722,6 +807,7 @@ public class OrchestratorService {
processMap.put("validateExperiment", new validateExperiment());
processMap.put("validateProcess", new validateProcess());
processMap.put("terminateExperiment", new terminateExperiment());
+ processMap.put("launchPostProcessingOfExperiment", new launchPostProcessingOfExperiment());
return processMap;
}
@@ -1048,6 +1134,58 @@ public class OrchestratorService {
}
}
+ public static class launchPostProcessingOfExperiment<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, launchPostProcessingOfExperiment_args, Boolean> {
+ public launchPostProcessingOfExperiment() {
+ super("launchPostProcessingOfExperiment");
+ }
+
+ public launchPostProcessingOfExperiment_args getEmptyArgsInstance() {
+ return new launchPostProcessingOfExperiment_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) {
+ launchPostProcessingOfExperiment_result result = new launchPostProcessingOfExperiment_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;
+ launchPostProcessingOfExperiment_result result = new launchPostProcessingOfExperiment_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, launchPostProcessingOfExperiment_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException {
+ iface.launchPostProcessingOfExperiment(args.experimentId, args.gatewayId,resultHandler);
+ }
+ }
+
}
public static class getOrchestratorCPIVersion_args implements org.apache.thrift.TBase<getOrchestratorCPIVersion_args, getOrchestratorCPIVersion_args._Fields>, java.io.Serializable, Cloneable, Comparable<getOrchestratorCPIVersion_args> {
@@ -6007,4 +6145,820 @@ public class OrchestratorService {
}
+ public static class launchPostProcessingOfExperiment_args implements org.apache.thrift.TBase<launchPostProcessingOfExperiment_args, launchPostProcessingOfExperiment_args._Fields>, java.io.Serializable, Cloneable, Comparable<launchPostProcessingOfExperiment_args> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("launchPostProcessingOfExperiment_args");
+
+ private static final org.apache.thrift.protocol.TField EXPERIMENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("experimentId", org.apache.thrift.protocol.TType.STRING, (short)1);
+ private static final org.apache.thrift.protocol.TField GATEWAY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayId", org.apache.thrift.protocol.TType.STRING, (short)2);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new launchPostProcessingOfExperiment_argsStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new launchPostProcessingOfExperiment_argsTupleSchemeFactory());
+ }
+
+ public String experimentId; // required
+ public String gatewayId; // 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 {
+ EXPERIMENT_ID((short)1, "experimentId"),
+ GATEWAY_ID((short)2, "gatewayId");
+
+ 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: // EXPERIMENT_ID
+ return EXPERIMENT_ID;
+ case 2: // GATEWAY_ID
+ return GATEWAY_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.EXPERIMENT_ID, new org.apache.thrift.meta_data.FieldMetaData("experimentId", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.GATEWAY_ID, new org.apache.thrift.meta_data.FieldMetaData("gatewayId", 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(launchPostProcessingOfExperiment_args.class, metaDataMap);
+ }
+
+ public launchPostProcessingOfExperiment_args() {
+ }
+
+ public launchPostProcessingOfExperiment_args(
+ String experimentId,
+ String gatewayId)
+ {
+ this();
+ this.experimentId = experimentId;
+ this.gatewayId = gatewayId;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public launchPostProcessingOfExperiment_args(launchPostProcessingOfExperiment_args other) {
+ if (other.isSetExperimentId()) {
+ this.experimentId = other.experimentId;
+ }
+ if (other.isSetGatewayId()) {
+ this.gatewayId = other.gatewayId;
+ }
+ }
+
+ public launchPostProcessingOfExperiment_args deepCopy() {
+ return new launchPostProcessingOfExperiment_args(this);
+ }
+
+ @Override
+ public void clear() {
+ this.experimentId = null;
+ this.gatewayId = null;
+ }
+
+ public String getExperimentId() {
+ return this.experimentId;
+ }
+
+ public launchPostProcessingOfExperiment_args setExperimentId(String experimentId) {
+ this.experimentId = experimentId;
+ return this;
+ }
+
+ public void unsetExperimentId() {
+ this.experimentId = null;
+ }
+
+ /** Returns true if field experimentId is set (has been assigned a value) and false otherwise */
+ public boolean isSetExperimentId() {
+ return this.experimentId != null;
+ }
+
+ public void setExperimentIdIsSet(boolean value) {
+ if (!value) {
+ this.experimentId = null;
+ }
+ }
+
+ public String getGatewayId() {
+ return this.gatewayId;
+ }
+
+ public launchPostProcessingOfExperiment_args setGatewayId(String gatewayId) {
+ this.gatewayId = gatewayId;
+ return this;
+ }
+
+ public void unsetGatewayId() {
+ this.gatewayId = null;
+ }
+
+ /** Returns true if field gatewayId is set (has been assigned a value) and false otherwise */
+ public boolean isSetGatewayId() {
+ return this.gatewayId != null;
+ }
+
+ public void setGatewayIdIsSet(boolean value) {
+ if (!value) {
+ this.gatewayId = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case EXPERIMENT_ID:
+ if (value == null) {
+ unsetExperimentId();
+ } else {
+ setExperimentId((String)value);
+ }
+ break;
+
+ case GATEWAY_ID:
+ if (value == null) {
+ unsetGatewayId();
+ } else {
+ setGatewayId((String)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case EXPERIMENT_ID:
+ return getExperimentId();
+
+ case GATEWAY_ID:
+ return getGatewayId();
+
+ }
+ 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 EXPERIMENT_ID:
+ return isSetExperimentId();
+ case GATEWAY_ID:
+ return isSetGatewayId();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof launchPostProcessingOfExperiment_args)
+ return this.equals((launchPostProcessingOfExperiment_args)that);
+ return false;
+ }
+
+ public boolean equals(launchPostProcessingOfExperiment_args that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_experimentId = true && this.isSetExperimentId();
+ boolean that_present_experimentId = true && that.isSetExperimentId();
+ if (this_present_experimentId || that_present_experimentId) {
+ if (!(this_present_experimentId && that_present_experimentId))
+ return false;
+ if (!this.experimentId.equals(that.experimentId))
+ return false;
+ }
+
+ boolean this_present_gatewayId = true && this.isSetGatewayId();
+ boolean that_present_gatewayId = true && that.isSetGatewayId();
+ if (this_present_gatewayId || that_present_gatewayId) {
+ if (!(this_present_gatewayId && that_present_gatewayId))
+ return false;
+ if (!this.gatewayId.equals(that.gatewayId))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ List<Object> list = new ArrayList<Object>();
+
+ boolean present_experimentId = true && (isSetExperimentId());
+ list.add(present_experimentId);
+ if (present_experimentId)
+ list.add(experimentId);
+
+ boolean present_gatewayId = true && (isSetGatewayId());
+ list.add(present_gatewayId);
+ if (present_gatewayId)
+ list.add(gatewayId);
+
+ return list.hashCode();
+ }
+
+ @Override
+ public int compareTo(launchPostProcessingOfExperiment_args other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetExperimentId()).compareTo(other.isSetExperimentId());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetExperimentId()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.experimentId, other.experimentId);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetGatewayId()).compareTo(other.isSetGatewayId());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetGatewayId()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gatewayId, other.gatewayId);
+ 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("launchPostProcessingOfExperiment_args(");
+ boolean first = true;
+
+ sb.append("experimentId:");
+ if (this.experimentId == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.experimentId);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("gatewayId:");
+ if (this.gatewayId == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.gatewayId);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ if (experimentId == null) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'experimentId' was not present! Struct: " + toString());
+ }
+ if (gatewayId == null) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'gatewayId' 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 launchPostProcessingOfExperiment_argsStandardSchemeFactory implements SchemeFactory {
+ public launchPostProcessingOfExperiment_argsStandardScheme getScheme() {
+ return new launchPostProcessingOfExperiment_argsStandardScheme();
+ }
+ }
+
+ private static class launchPostProcessingOfExperiment_argsStandardScheme extends StandardScheme<launchPostProcessingOfExperiment_args> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, launchPostProcessingOfExperiment_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: // EXPERIMENT_ID
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.experimentId = iprot.readString();
+ struct.setExperimentIdIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // GATEWAY_ID
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.gatewayId = iprot.readString();
+ struct.setGatewayIdIsSet(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, launchPostProcessingOfExperiment_args struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.experimentId != null) {
+ oprot.writeFieldBegin(EXPERIMENT_ID_FIELD_DESC);
+ oprot.writeString(struct.experimentId);
+ oprot.writeFieldEnd();
+ }
+ if (struct.gatewayId != null) {
+ oprot.writeFieldBegin(GATEWAY_ID_FIELD_DESC);
+ oprot.writeString(struct.gatewayId);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class launchPostProcessingOfExperiment_argsTupleSchemeFactory implements SchemeFactory {
+ public launchPostProcessingOfExperiment_argsTupleScheme getScheme() {
+ return new launchPostProcessingOfExperiment_argsTupleScheme();
+ }
+ }
+
+ private static class launchPostProcessingOfExperiment_argsTupleScheme extends TupleScheme<launchPostProcessingOfExperiment_args> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, launchPostProcessingOfExperiment_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ oprot.writeString(struct.experimentId);
+ oprot.writeString(struct.gatewayId);
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, launchPostProcessingOfExperiment_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ struct.experimentId = iprot.readString();
+ struct.setExperimentIdIsSet(true);
+ struct.gatewayId = iprot.readString();
+ struct.setGatewayIdIsSet(true);
+ }
+ }
+
+ }
+
+ public static class launchPostProcessingOfExperiment_result implements org.apache.thrift.TBase<launchPostProcessingOfExperiment_result, launchPostProcessingOfExperiment_result._Fields>, java.io.Serializable, Cloneable, Comparable<launchPostProcessingOfExperiment_result> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("launchPostProcessingOfExperiment_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 launchPostProcessingOfExperiment_resultStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new launchPostProcessingOfExperiment_resultTupleSchemeFactory());
+ }
+
+ public boolean 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<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(launchPostProcessingOfExperiment_result.class, metaDataMap);
+ }
+
+ public launchPostProcessingOfExperiment_result() {
+ }
+
+ public launchPostProcessingOfExperiment_result(
+ boolean success)
+ {
+ this();
+ this.success = success;
+ setSuccessIsSet(true);
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public launchPostProcessingOfExperiment_result(launchPostProcessingOfExperiment_result other) {
+ __isset_bitfield = other.__isset_bitfield;
+ this.success = other.success;
+ }
+
+ public launchPostProcessingOfExperiment_result deepCopy() {
+ return new launchPostProcessingOfExperiment_result(this);
+ }
+
+ @Override
+ public void clear() {
+ setSuccessIsSet(false);
+ this.success = false;
+ }
+
+ public boolean isSuccess() {
+ return this.success;
+ }
+
+ public launchPostProcessingOfExperiment_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 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 launchPostProcessingOfExperiment_result)
+ return this.equals((launchPostProcessingOfExperiment_result)that);
+ return false;
+ }
+
+ public boolean equals(launchPostProcessingOfExperiment_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() {
+ List<Object> list = new ArrayList<Object>();
+
+ boolean present_success = true;
+ list.add(present_success);
+ if (present_success)
+ list.add(success);
+
+ return list.hashCode();
+ }
+
+ @Override
+ public int compareTo(launchPostProcessingOfExperiment_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("launchPostProcessingOfExperiment_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 launchPostProcessingOfExperiment_resultStandardSchemeFactory implements SchemeFactory {
+ public launchPostProcessingOfExperiment_resultStandardScheme getScheme() {
+ return new launchPostProcessingOfExperiment_resultStandardScheme();
+ }
+ }
+
+ private static class launchPostProcessingOfExperiment_resultStandardScheme extends StandardScheme<launchPostProcessingOfExperiment_result> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, launchPostProcessingOfExperiment_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, launchPostProcessingOfExperiment_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 launchPostProcessingOfExperiment_resultTupleSchemeFactory implements SchemeFactory {
+ public launchPostProcessingOfExperiment_resultTupleScheme getScheme() {
+ return new launchPostProcessingOfExperiment_resultTupleScheme();
+ }
+ }
+
+ private static class launchPostProcessingOfExperiment_resultTupleScheme extends TupleScheme<launchPostProcessingOfExperiment_result> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, launchPostProcessingOfExperiment_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, launchPostProcessingOfExperiment_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);
+ }
+ }
+ }
+
+ }
+
}
diff --git a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java
index d4997bb..70c947d 100644
--- a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java
+++ b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java
@@ -36,6 +36,7 @@ import org.apache.airavata.model.error.ValidationResults;
import org.apache.airavata.model.error.ValidatorResult;
import org.apache.airavata.model.process.ProcessModel;
import org.apache.airavata.model.experiment.*;
+import org.apache.airavata.model.process.ProcessType;
import org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel;
import org.apache.airavata.model.status.TaskState;
import org.apache.airavata.model.status.TaskStatus;
@@ -265,6 +266,7 @@ public class SimpleOrchestratorImpl extends AbstractOrchestrator{
}
}else {
ProcessModel processModel = ExperimentModelUtil.cloneProcessFromExperiment(experimentModel);
+ processModel.setProcessType(ProcessType.PRIMARY);
String processId = (String)registry.getExperimentCatalog().add(ExpCatChildDataType.PROCESS, processModel, experimentId);
processModel.setProcessId(processId);
processModels.add(processModel);
@@ -326,7 +328,7 @@ public class SimpleOrchestratorImpl extends AbstractOrchestrator{
} else {
taskIdList.addAll(createAndSaveSubmissionTasks(gatewayId, preferredJobSubmissionInterface, processModel, userGivenWallTime));
}
- taskIdList.addAll(createAndSaveOutputDataStagingTasks(processModel, gatewayId));
+ taskIdList.addAll(createAndSaveOutputDataStagingTasks(processModel, gatewayId, null));
}
// update process scheduling
experimentCatalog.update(ExperimentCatalogModelType.PROCESS, processModel, processModel.getProcessId());
@@ -336,7 +338,7 @@ public class SimpleOrchestratorImpl extends AbstractOrchestrator{
}
}
- private String getTaskDag(List<String> taskIdList) {
+ public String getTaskDag(List<String> taskIdList) {
if (taskIdList.isEmpty()) {
return "";
}
@@ -408,8 +410,8 @@ public class SimpleOrchestratorImpl extends AbstractOrchestrator{
return dataStagingTaskIds;
}
- public List<String> createAndSaveOutputDataStagingTasks(ProcessModel processModel, String gatewayId)
- throws RegistryException, AiravataException {
+ public List<String> createAndSaveOutputDataStagingTasks(ProcessModel processModel, String gatewayId,
+ String overrideWorkingDir) throws RegistryException, AiravataException {
List<String> dataStagingTaskIds = new ArrayList<>();
List<OutputDataObjectType> processOutputs = processModel.getProcessOutputs();
@@ -422,16 +424,19 @@ public class SimpleOrchestratorImpl extends AbstractOrchestrator{
if (null == processOutput.getValue() || processOutput.getValue().trim().isEmpty()) {
processOutput.setValue(appName + ".stdout");
}
- createOutputDataSatagingTasks(processModel, gatewayId, dataStagingTaskIds, processOutput);
+ createOutputDataSatagingTasks(processModel, gatewayId, dataStagingTaskIds, processOutput,
+ overrideWorkingDir);
break;
case STDERR:
if (null == processOutput.getValue() || processOutput.getValue().trim().isEmpty()) {
processOutput.setValue(appName + ".stderr");
}
- createOutputDataSatagingTasks(processModel, gatewayId, dataStagingTaskIds, processOutput);
+ createOutputDataSatagingTasks(processModel, gatewayId, dataStagingTaskIds, processOutput,
+ overrideWorkingDir);
break;
case URI:
- createOutputDataSatagingTasks(processModel, gatewayId, dataStagingTaskIds, processOutput);
+ createOutputDataSatagingTasks(processModel, gatewayId, dataStagingTaskIds, processOutput,
+ overrideWorkingDir);
break;
default:
// nothing to do
@@ -462,7 +467,7 @@ public class SimpleOrchestratorImpl extends AbstractOrchestrator{
List<String> dataStagingTaskIds) throws RegistryException, AiravataException {
TaskModel archiveTask = null;
try {
- archiveTask = getOutputDataStagingTask(processModel, null, gatewayId);
+ archiveTask = getOutputDataStagingTask(processModel, null, gatewayId, null);
} catch (TException e) {
throw new RegistryException("Error! DataStaging sub task serialization failed");
}
@@ -476,9 +481,9 @@ public class SimpleOrchestratorImpl extends AbstractOrchestrator{
private void createOutputDataSatagingTasks(ProcessModel processModel,
String gatewayId,
List<String> dataStagingTaskIds,
- OutputDataObjectType processOutput) throws RegistryException, AiravataException {
+ OutputDataObjectType processOutput, String overrideWorkingDir) throws RegistryException, AiravataException {
try {
- TaskModel outputDataStagingTask = getOutputDataStagingTask(processModel, processOutput, gatewayId);
+ TaskModel outputDataStagingTask = getOutputDataStagingTask(processModel, processOutput, gatewayId, overrideWorkingDir);
String taskId = (String) orchestratorContext.getRegistry().getExperimentCatalog()
.add(ExpCatChildDataType.TASK, outputDataStagingTask, processModel.getProcessId());
outputDataStagingTask.setTaskId(taskId);
@@ -598,7 +603,8 @@ public class SimpleOrchestratorImpl extends AbstractOrchestrator{
return taskModel;
}
- private TaskModel getOutputDataStagingTask(ProcessModel processModel, OutputDataObjectType processOutput, String gatewayId) throws RegistryException, TException, AiravataException {
+ private TaskModel getOutputDataStagingTask(ProcessModel processModel, OutputDataObjectType processOutput,
+ String gatewayId, String overrideWorkingDir) throws RegistryException, TException, AiravataException {
try {
// create new task model for this task
@@ -613,8 +619,8 @@ public class SimpleOrchestratorImpl extends AbstractOrchestrator{
ComputeResourceDescription computeResource = orchestratorContext.getRegistry().getAppCatalog()
.getComputeResource().getComputeResource(processModel.getComputeResourceId());
- String workingDir = OrchestratorUtils.getScratchLocation(orchestratorContext,processModel, gatewayId)
- + File.separator + processModel.getProcessId() + File.separator;
+ String workingDir = OrchestratorUtils.getScratchLocation(orchestratorContext,processModel, gatewayId)
+ + File.separator + (overrideWorkingDir != null ? overrideWorkingDir : processModel.getProcessId()) + File.separator;
DataStagingTaskModel submodel = new DataStagingTaskModel();
DataMovementProtocol dataMovementProtocol = OrchestratorUtils.getPreferredDataMovementProtocol(orchestratorContext, processModel, gatewayId);
URI source = null;
diff --git a/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java b/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
index 4cd9b5f..ce8794c 100644
--- a/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
+++ b/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
@@ -41,13 +41,14 @@ import org.apache.airavata.model.data.replica.DataProductModel;
import org.apache.airavata.model.data.replica.DataReplicaLocationModel;
import org.apache.airavata.model.data.replica.ReplicaLocationCategory;
import org.apache.airavata.model.error.LaunchValidationException;
-import org.apache.airavata.model.error.ValidationResults;
import org.apache.airavata.model.experiment.ExperimentModel;
import org.apache.airavata.model.experiment.ExperimentType;
import org.apache.airavata.model.messaging.event.*;
import org.apache.airavata.model.process.ProcessModel;
+import org.apache.airavata.model.process.ProcessType;
import org.apache.airavata.model.status.ExperimentState;
import org.apache.airavata.model.status.ExperimentStatus;
+import org.apache.airavata.model.util.ExperimentModelUtil;
import org.apache.airavata.orchestrator.core.exception.OrchestratorException;
import org.apache.airavata.orchestrator.cpi.OrchestratorService;
import org.apache.airavata.orchestrator.cpi.impl.SimpleOrchestratorImpl;
@@ -58,6 +59,7 @@ import org.apache.airavata.registry.core.app.catalog.resources.AppCatAbstractRes
import org.apache.airavata.registry.core.experiment.catalog.impl.RegistryFactory;
import org.apache.airavata.registry.core.experiment.catalog.resources.AbstractExpCatResource;
import org.apache.airavata.registry.cpi.*;
+import org.apache.airavata.registry.cpi.utils.Constants;
import org.apache.commons.lang.StringUtils;
import org.apache.curator.RetryPolicy;
import org.apache.curator.framework.CuratorFramework;
@@ -150,10 +152,8 @@ public class OrchestratorServerHandler implements OrchestratorService.Iface {
return false;
}
- ComputeResourcePreference computeResourcePreference = appCatalog.getGatewayProfile().
- getComputeResourcePreference(gatewayId,
- experiment.getUserConfigurationData().getComputationalResourceScheduling().getResourceHostId());
- String token = computeResourcePreference.getResourceSpecificCredentialStoreToken();
+ String token = getCredentialsStoreToken(experiment, gatewayId);
+
if (token == null || token.isEmpty()){
// try with gateway profile level token
GatewayResourceProfile gatewayProfile = appCatalog.getGatewayProfile().getGatewayProfile(gatewayId);
@@ -171,51 +171,7 @@ public class OrchestratorServerHandler implements OrchestratorService.Iface {
List<ProcessModel> processes = orchestrator.createProcesses(experimentId, gatewayId);
for (ProcessModel processModel : processes){
- //FIXME Resolving replica if available. This is a very crude way of resolving input replicas. A full featured
- //FIXME replica resolving logic should come here
- ReplicaCatalog replicaCatalog = RegistryFactory.getReplicaCatalog();
- processModel.getProcessInputs().stream().forEach(pi -> {
- if (pi.getType().equals(DataType.URI) && pi.getValue().startsWith("airavata-dp://")) {
- try {
- DataProductModel dataProductModel = replicaCatalog.getDataProduct(pi.getValue());
- Optional<DataReplicaLocationModel> rpLocation = dataProductModel.getReplicaLocations()
- .stream().filter(rpModel -> rpModel.getReplicaLocationCategory().
- equals(ReplicaLocationCategory.GATEWAY_DATA_STORE)).findFirst();
- if (rpLocation.isPresent()) {
- pi.setValue(rpLocation.get().getFilePath());
- pi.setStorageResourceId(rpLocation.get().getStorageResourceId());
- } else {
- log.error("Could not find a replica for the URI " + pi.getValue());
- }
- } catch (ReplicaCatalogException e) {
- log.error(e.getMessage(), e);
- }
- } else if (pi.getType().equals(DataType.URI_COLLECTION) && pi.getValue().contains("airavata-dp://")) {
- try {
- String[] uriList = pi.getValue().split(",");
- final ArrayList<String> filePathList = new ArrayList<>();
- for (String uri : uriList) {
- if (uri.startsWith("airavata-dp://")) {
- DataProductModel dataProductModel = replicaCatalog.getDataProduct(uri);
- Optional<DataReplicaLocationModel> rpLocation = dataProductModel.getReplicaLocations()
- .stream().filter(rpModel -> rpModel.getReplicaLocationCategory().
- equals(ReplicaLocationCategory.GATEWAY_DATA_STORE)).findFirst();
- if (rpLocation.isPresent()) {
- filePathList.add(rpLocation.get().getFilePath());
- } else {
- log.error("Could not find a replica for the URI " + pi.getValue());
- }
- } else {
- // uri is in file path format
- filePathList.add(uri);
- }
- }
- pi.setValue(StringUtils.join(filePathList, ','));
- } catch (ReplicaCatalogException e) {
- log.error(e.getMessage(), e);
- }
- }
- });
+ parseInputOutput(processModel);
String taskDag = orchestrator.createAndSaveTasks(gatewayId, processModel, experiment.getUserConfigurationData().isAiravataAutoSchedule());
processModel.setTaskDag(taskDag);
experimentCatalog.update(ExperimentCatalogModelType.PROCESS, processModel, processModel.getProcessId());
@@ -253,6 +209,103 @@ public class OrchestratorServerHandler implements OrchestratorService.Iface {
return true;
}
+ private String getCredentialsStoreToken(ExperimentModel experiment, String gatewayId) throws AppCatalogException {
+ ComputeResourcePreference computeResourcePreference = appCatalog.getGatewayProfile().
+ getComputeResourcePreference(gatewayId,
+ experiment.getUserConfigurationData().getComputationalResourceScheduling().getResourceHostId());
+ return computeResourcePreference.getResourceSpecificCredentialStoreToken();
+ }
+
+ private void parseInputOutput(ProcessModel processModel) throws ReplicaCatalogException {
+ //FIXME Resolving replica if available. This is a very crude way of resolving input replicas. A full featured
+ //FIXME replica resolving logic should come here
+
+ ReplicaCatalog replicaCatalog = RegistryFactory.getReplicaCatalog();
+ processModel.getProcessInputs().forEach(pi -> {
+ if (pi.getType().equals(DataType.URI) && pi.getValue().startsWith("airavata-dp://")) {
+ try {
+ DataProductModel dataProductModel = replicaCatalog.getDataProduct(pi.getValue());
+ Optional<DataReplicaLocationModel> rpLocation = dataProductModel.getReplicaLocations()
+ .stream().filter(rpModel -> rpModel.getReplicaLocationCategory().
+ equals(ReplicaLocationCategory.GATEWAY_DATA_STORE)).findFirst();
+ if (rpLocation.isPresent()) {
+ pi.setValue(rpLocation.get().getFilePath());
+ pi.setStorageResourceId(rpLocation.get().getStorageResourceId());
+ } else {
+ log.error("Could not find a replica for the URI " + pi.getValue());
+ }
+ } catch (ReplicaCatalogException e) {
+ log.error(e.getMessage(), e);
+ }
+ } else if (pi.getType().equals(DataType.URI_COLLECTION) && pi.getValue().contains("airavata-dp://")) {
+ try {
+ String[] uriList = pi.getValue().split(",");
+ final ArrayList<String> filePathList = new ArrayList<>();
+ for (String uri : uriList) {
+ if (uri.startsWith("airavata-dp://")) {
+ DataProductModel dataProductModel = replicaCatalog.getDataProduct(uri);
+ Optional<DataReplicaLocationModel> rpLocation = dataProductModel.getReplicaLocations()
+ .stream().filter(rpModel -> rpModel.getReplicaLocationCategory().
+ equals(ReplicaLocationCategory.GATEWAY_DATA_STORE)).findFirst();
+ if (rpLocation.isPresent()) {
+ filePathList.add(rpLocation.get().getFilePath());
+ } else {
+ log.error("Could not find a replica for the URI " + pi.getValue());
+ }
+ } else {
+ // uri is in file path format
+ filePathList.add(uri);
+ }
+ }
+ pi.setValue(StringUtils.join(filePathList, ','));
+ } catch (ReplicaCatalogException e) {
+ log.error(e.getMessage(), e);
+ }
+ }
+ });
+ }
+
+ private ProcessModel createAndSavePostProcessingProcess(ExperimentModel experiment, String gatewayId) throws
+ RegistryException, AiravataException, AppCatalogException {
+
+
+ List<Object> processes = experimentCatalog.get(ExperimentCatalogModelType.PROCESS,
+ Constants.FieldConstants.ProcessConstants.EXPERIMENT_ID, experiment.getExperimentId());
+
+ ProcessModel primaryProcess = null;
+ if (processes.size() > 0) {
+ Optional<ProcessModel> primaryProcessOp = processes.stream().map(ProcessModel.class::cast)
+ .filter(processModel -> ProcessType.PRIMARY == processModel.getProcessType()).findFirst();
+ if (primaryProcessOp.isPresent()) {
+ primaryProcess = primaryProcessOp.get();
+ }
+ }
+
+ if (primaryProcess == null) {
+ log.error("Can not create post processing process without the primary process for experiment with id {}",
+ experiment.getExperimentId());
+ throw new AiravataException("Can not create post processing process without the primary process for " +
+ "experiment with id " + experiment.getExperimentId());
+ }
+
+ ProcessModel processModel = ExperimentModelUtil.cloneProcessFromExperiment(experiment);
+ processModel.setProcessType(ProcessType.FORCE_POST_PROCESING);
+
+ String processId = (String)experimentCatalog.add(ExpCatChildDataType.PROCESS, processModel, experiment.getExperimentId());
+ processModel.setProcessId(processId);
+
+ parseInputOutput(processModel);
+
+ List<String> tasks = orchestrator.createAndSaveOutputDataStagingTasks(processModel, gatewayId,
+ primaryProcess.getProcessId()); /* Make the working dir of this process as the working dir of
+ primary process as this is dealing with the content created by primary process */
+
+ String taskDag = orchestrator.getTaskDag(tasks);
+ processModel.setTaskDag(taskDag);
+
+ experimentCatalog.update(ExperimentCatalogModelType.PROCESS, processModel, processModel.getProcessId());
+ return processModel;
+ }
/**
* This method will validate the experiment before launching, if is failed
* we do not run the launch in airavata thrift service (only if validation
@@ -325,7 +378,27 @@ public class OrchestratorServerHandler implements OrchestratorService.Iface {
}
}
- private String getAiravataUserName() {
+ /**
+ * This method will create and launch a force post processing process of an experiment. This newly created
+ * process includes only the output data staging tasks of the experiment.
+ *
+ * @param experimentId target experiment id
+ * @param gatewayId gateway id
+ * @return true if the post processing process launched successfully, false otherwise
+ * @throws TException if the post processing of the experiment failed
+ */
+ @Override
+ public boolean launchPostProcessingOfExperiment(String experimentId, String gatewayId) throws TException {
+ log.info(experimentId, "Launching the post processing of Experiment: {}", experimentId);
+ try {
+ return validateStatesAndStartPostProcessing(experimentId, gatewayId);
+ } catch (Exception e) {
+ log.error("expId : " + experimentId + " :- Error while launching post processing", e);
+ return false;
+ }
+ }
+
+ private String getAiravataUserName() {
return airavataUserName;
}
@@ -410,6 +483,41 @@ public class OrchestratorServerHandler implements OrchestratorService.Iface {
return selectedModuleId;
}
+ private boolean validateStatesAndStartPostProcessing(String experimentId, String gatewayId) throws Exception {
+ ExperimentStatus experimentStatus = OrchestratorUtils.getExperimentStatus(experimentId);
+ switch (experimentStatus.getState()) {
+ case CREATED: case COMPLETED: case CANCELED: case CANCELING: case VALIDATED:
+ log.warn("Can't run post processing of the {} experiment with id {}", experimentStatus.getState().name(), experimentId);
+ return false;
+ case EXECUTING:
+ case LAUNCHED:
+ case SCHEDULED:
+ case FAILED:
+ case FORCE_POST_PROCESSING_COMPLETED:
+ case FORCE_POST_PROCESSING_CANCELED:
+ case FORCE_POST_PROCESSING_EXECUTING:
+ case FORCE_POST_PROCESSING_FAILED:
+
+ log.debug("State validation succeeded for the post processing of eperiment with id {}", experimentId);
+
+ ExperimentModel experiment = (ExperimentModel) experimentCatalog.get(ExperimentCatalogModelType.EXPERIMENT, experimentId);
+
+ if (experiment == null) {
+ log.error("Error retrieving the Experiment by the given experiment id: {} ", experimentId);
+ return false;
+ }
+
+ ProcessModel processModel = createAndSavePostProcessingProcess(experiment, gatewayId);
+ String token = getCredentialsStoreToken(experiment, gatewayId);
+ OrchestratorServerThreadPoolExecutor.getCachedThreadPool()
+ .execute(MDCUtil.wrapWithMDC(new PostProcessingProcessRunner(processModel.getProcessId(), token, gatewayId)));
+ return true;
+ default:
+ log.warn("Invalid state for experiment with id {}", experimentId);
+ return false;
+ }
+ }
+
private boolean validateStatesAndCancel(String experimentId, String gatewayId) throws Exception {
ExperimentStatus experimentStatus = OrchestratorUtils.getExperimentStatus(experimentId);
switch (experimentStatus.getState()) {
@@ -453,6 +561,28 @@ public class OrchestratorServerHandler implements OrchestratorService.Iface {
curatorClient = CuratorFrameworkFactory.newClient(connectionSting, retryPolicy);
curatorClient.start();
}
+
+ private class PostProcessingProcessRunner implements Runnable {
+ String processId;
+ String gatewayId;
+ String airavataCredStoreToken;
+
+ public PostProcessingProcessRunner(String processId, String gatewayId, String airavataCredStoreToken) {
+ this.processId = processId;
+ this.gatewayId = gatewayId;
+ this.airavataCredStoreToken = airavataCredStoreToken;
+ }
+
+ @Override
+ public void run() {
+ try {
+ launchProcess(processId, airavataCredStoreToken, gatewayId);
+ } catch (TException e) {
+ log.error("Error while launching post processing process {}", processId, e);
+ // TODO handle states
+ }
+ }
+ }
private class SingleAppExperimentRunner implements Runnable {
String experimentId;
@@ -514,6 +644,8 @@ public class OrchestratorServerHandler implements OrchestratorService.Iface {
@Override
public void onMessage(MessageContext message) {
if (message.getType().equals(MessageType.PROCESS)) {
+ // TODO: Get a lock for the experiment id as there couldbe multiple processes
+ // including post processing processes updating the status
try {
ProcessStatusChangeEvent processStatusChangeEvent = new ProcessStatusChangeEvent();
TBase event = message.getEvent();
@@ -524,7 +656,25 @@ public class OrchestratorServerHandler implements OrchestratorService.Iface {
log.info("expId: {}, processId: {} :- Process status changed event received for status {}",
processIdentity.getExperimentId(), processIdentity.getProcessId(),
processStatusChangeEvent.getState().name());
- switch (processStatusChangeEvent.getState()) {
+
+ ProcessModel processModel = null;
+ ExperimentModel experimentModel = null;
+
+ try {
+ processModel = (ProcessModel) experimentCatalog.get(ExperimentCatalogModelType.PROCESS, processIdentity.getProcessId());
+ } catch (RegistryException e) {
+ log.error("Failed to find the process with id {}", processIdentity.getProcessId(), e);
+ return;
+ }
+
+ try {
+ experimentModel = (ExperimentModel) experimentCatalog.get(ExperimentCatalogModelType.EXPERIMENT, processIdentity.getExperimentId());
+ } catch (RegistryException e) {
+ log.error("Failed to find the experiment with id {}", processIdentity.getProcessId(), e);
+ return;
+ }
+
+ switch (processStatusChangeEvent.getState()) {
// case CREATED:
// case VALIDATED:
case STARTED:
@@ -535,12 +685,18 @@ public class OrchestratorServerHandler implements OrchestratorService.Iface {
status.setState(ExperimentState.CANCELING);
status.setReason("Process started but experiment cancelling is triggered");
} else {
- status.setState(ExperimentState.EXECUTING);
- status.setReason("process started");
+ if (processModel.getProcessType() == ProcessType.PRIMARY) {
+ status.setState(ExperimentState.EXECUTING);
+ status.setReason("process started");
+
+ } else if (processModel.getProcessType() == ProcessType.FORCE_POST_PROCESING) {
+ status.setState(ExperimentState.FORCE_POST_PROCESSING_EXECUTING);
+ status.setReason("force post processing process started");
+ }
}
} catch (RegistryException e) {
status.setState(ExperimentState.EXECUTING);
- status.setReason("process started");
+ status.setReason("process started");
}
break;
// case PRE_PROCESSING:
@@ -561,12 +717,28 @@ public class OrchestratorServerHandler implements OrchestratorService.Iface {
status.setState(ExperimentState.CANCELED);
status.setReason("Process competed but experiment cancelling is triggered");
} else {
- status.setState(ExperimentState.COMPLETED);
- status.setReason("process completed");
+
+ if (processModel.getProcessType() == ProcessType.PRIMARY) {
+ status.setState(ExperimentState.COMPLETED);
+ status.setReason("process completed");
+ } else if (processModel.getProcessType() == ProcessType.FORCE_POST_PROCESING) {
+
+ if (stat.getState() == ExperimentState.COMPLETED) {
+ // Ignore silently and mark as completed
+ status.setState(ExperimentState.COMPLETED);
+ status.setReason("process completed");
+ } else {
+ // otherwise mark post processing is completed
+ status.setState(ExperimentState.FORCE_POST_PROCESSING_COMPLETED);
+ status.setReason("force post processing process completed");
+ }
+
+ }
}
} catch (RegistryException e) {
+ // TODO dimuthu: is this logic correct?
status.setState(ExperimentState.COMPLETED);
- status.setReason("process completed");
+ status.setReason("process completed");
}
break;
case FAILED:
@@ -577,18 +749,33 @@ public class OrchestratorServerHandler implements OrchestratorService.Iface {
status.setState(ExperimentState.CANCELED);
status.setReason("Process failed but experiment cancelling is triggered");
} else {
- status.setState(ExperimentState.FAILED);
- status.setReason("process failed");
+ if (processModel.getProcessType() == ProcessType.PRIMARY) {
+ status.setState(ExperimentState.FAILED);
+ status.setReason("process failed");
+
+ } else if (processModel.getProcessType() == ProcessType.FORCE_POST_PROCESING) {
+
+ if (stat.getState() != ExperimentState.COMPLETED) {
+ // if experiment completed, silently ignore this
+ status.setState(ExperimentState.FORCE_POST_PROCESSING_FAILED);
+ status.setReason("force post processing process failed");
+ }
+ }
}
} catch (RegistryException e) {
status.setState(ExperimentState.FAILED);
- status.setReason("process failed");
+ status.setReason("process failed");
}
break;
case CANCELED:
// TODO if experiment have more than one process associated with it, then this should be changed.
- status.setState(ExperimentState.CANCELED);
- status.setReason("process cancelled");
+ if (processModel.getProcessType() == ProcessType.PRIMARY) {
+ status.setState(ExperimentState.CANCELED);
+ status.setReason("process cancelled");
+ } else if (processModel.getProcessType() == ProcessType.FORCE_POST_PROCESING) {
+ status.setState(ExperimentState.FORCE_POST_PROCESSING_CANCELED);
+ status.setReason("process cancelled");
+ }
break;
default:
// ignore other status changes, thoes will not affect for experiment status changes
@@ -624,6 +811,9 @@ public class OrchestratorServerHandler implements OrchestratorService.Iface {
case EXPERIMENT_CANCEL:
cancelExperiment(messageContext);
break;
+ case POSTPROCESSING_START:
+ startPostProcessingOfExperiment(messageContext);
+ break;
default:
experimentSubscriber.sendAck(messageContext.getDeliveryTag());
log.error("Orchestrator got un-support message type : " + messageContext.getType());
@@ -632,6 +822,19 @@ public class OrchestratorServerHandler implements OrchestratorService.Iface {
MDC.clear();
}
+ private void startPostProcessingOfExperiment(MessageContext messageContext) {
+ try {
+ byte[] bytes = ThriftUtils.serializeThriftObject(messageContext.getEvent());
+ ExperimentSubmitEvent expEvent = new ExperimentSubmitEvent();
+ ThriftUtils.createThriftFromBytes(bytes, expEvent);
+ log.info("Starting the post processing of the experiment with experimentId: {} gateway Id: {}", expEvent.getExperimentId(), expEvent.getGatewayId());
+ launchPostProcessingOfExperiment(expEvent.getExperimentId(), expEvent.getGatewayId());
+ } catch (TException e) {
+ log.error("Experiment cancellation failed due to Thrift conversion error", e);
+ }finally {
+ experimentSubscriber.sendAck(messageContext.getDeliveryTag());
+ }
+ }
private void cancelExperiment(MessageContext messageContext) {
try {
byte[] bytes = ThriftUtils.serializeThriftObject(messageContext.getEvent());
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java
index f04346d..5b5ed67 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java
@@ -287,6 +287,7 @@ public class ExperimentRegistry {
processResource.setExperimentDataDir(process.getExperimentDataDir());
processResource.setUserName(process.getUserName());
processResource.setUseUserCRPref(process.isUseUserCRPref());
+ processResource.setProcessTypeValue(process.getProcessType().getValue());
if(process.isEnableEmailNotification()){
processResource.setEnableEmailNotification(true);
if(process.getEmailAddresses() != null){
@@ -771,6 +772,7 @@ public class ExperimentRegistry {
processResource.setExperimentDataDir(process.getExperimentDataDir());
processResource.setUserName(process.getUserName());
processResource.setUseUserCRPref(process.isUseUserCRPref());
+ processResource.setProcessTypeValue(process.getProcessType().getValue());
if(process.isEnableEmailNotification()){
processResource.setEnableEmailNotification(true);
if(process.getEmailAddresses() != null){
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Process.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Process.java
index 9707686..c8da85d 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Process.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Process.java
@@ -55,6 +55,7 @@ public class Process {
private String userDn;
private boolean generateCert;
private boolean useUserCRPref;
+ private Integer processTypeValue;
@Id
@Column(name = "PROCESS_ID")
@@ -320,4 +321,13 @@ public class Process {
public void setUseUserCRPref(boolean useUserCRPref) {
this.useUserCRPref = useUserCRPref;
}
+
+ @Column(name = "PROCESS_TYPE")
+ public Integer getProcessTypeValue() {
+ return processTypeValue;
+ }
+
+ public void setProcessTypeValue(Integer processTypeValue) {
+ this.processTypeValue = processTypeValue;
+ }
}
\ No newline at end of file
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResource.java
index 3ba5111..5a00f9b 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResource.java
@@ -56,6 +56,7 @@ public class ProcessResource extends AbstractExpCatResource {
private boolean generateCert;
private String experimentDataDir;
private boolean useUserCRPref;
+ private int processTypeValue;
public String getProcessId() {
return processId;
@@ -201,6 +202,14 @@ public class ProcessResource extends AbstractExpCatResource {
this.useUserCRPref = useUserCRPref;
}
+ public int getProcessTypeValue() {
+ return processTypeValue;
+ }
+
+ public void setProcessTypeValue(int processTypeValue) {
+ this.processTypeValue = processTypeValue;
+ }
+
public ExperimentCatResource create(ResourceType type) throws RegistryException{
switch (type){
case PROCESS_ERROR:
@@ -608,6 +617,7 @@ public class ProcessResource extends AbstractExpCatResource {
process.setExperimentDataDir(experimentDataDir);
process.setUserName(userName);
process.setUseUserCRPref(useUserCRPref);
+ process.setProcessTypeValue(processTypeValue);
if (existingProcess == null){
em.persist(process);
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/Utils.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/Utils.java
index 79080b8..496fead 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/Utils.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/Utils.java
@@ -583,6 +583,7 @@ public class Utils {
processResource.setExperimentDataDir(o.getExperimentDataDir());
processResource.setUserName(o.getUserName());
processResource.setUseUserCRPref(o.isUseUserCRPref());
+ processResource.setProcessTypeValue(o.getProcessTypeValue());
}
return processResource;
}
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/utils/ThriftDataModelConversion.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/utils/ThriftDataModelConversion.java
index 767f587..06b22ad 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/utils/ThriftDataModelConversion.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/utils/ThriftDataModelConversion.java
@@ -50,6 +50,7 @@ import org.apache.airavata.model.experiment.ExperimentSummaryModel;
import org.apache.airavata.model.experiment.UserConfigurationDataModel;
import org.apache.airavata.model.job.JobModel;
import org.apache.airavata.model.process.ProcessModel;
+import org.apache.airavata.model.process.ProcessType;
import org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel;
import org.apache.airavata.model.status.*;
import org.apache.airavata.model.task.TaskModel;
@@ -396,6 +397,7 @@ public class ThriftDataModelConversion {
processModel.setEnableEmailNotification(processResource.getEnableEmailNotification());
processModel.setExperimentDataDir(processResource.getExperimentDataDir());
processModel.setUseUserCRPref(processResource.isUseUserCRPref());
+ processModel.setProcessType(ProcessType.findByValue(processResource.getProcessTypeValue()));
if (processModel.isEnableEmailNotification()){
String notificationEmails = processResource.getEmailAddresses();
processModel.setEmailAddresses(getEmailAddresses(notificationEmails.split(",")));
diff --git a/thrift-interface-descriptions/airavata-apis/airavata_api.thrift b/thrift-interface-descriptions/airavata-apis/airavata_api.thrift
index 0a34ac6..7316c6a 100644
--- a/thrift-interface-descriptions/airavata-apis/airavata_api.thrift
+++ b/thrift-interface-descriptions/airavata-apis/airavata_api.thrift
@@ -1033,6 +1033,54 @@ service Airavata {
4: airavata_errors.AiravataSystemException ase,
5: airavata_errors.AuthorizationException ae)
+ /**
+ *
+ * Executes post processing tasks of an Experiment. Usually post processing tasks are executed once the Experiment is
+ * launched. However this enables the ability for users to forcefully execute these post processing tasks while an
+ * Experiment running.
+ *
+ * @param gatewayId
+ * ID of the gateway which will launch the experiment.
+ *
+ * @param airavataExperimetId
+ * Identifier of the Experiment in which the post processing should be executed
+ *
+ * @return
+ * This method call does not have a return value.
+ *
+ * @throws org.apache.airavata.model.error.InvalidRequestException
+ * For any incorrect forming of the request itself.
+ *
+ * @throws org.apache.airavata.model.error.ExperimentNotFoundException
+ * If the specified experiment is not previously created, then an Experiment Not Found Exception is thrown.
+ *
+ * @throws org.apache.airavata.model.error.AiravataClientException
+ * The following list of exceptions are thrown which Airavata Client can take corrective actions to resolve:
+ *
+ * UNKNOWN_GATEWAY_ID - If a Gateway is not registered with Airavata as a one time administrative
+ * step, then Airavata Registry will not have a provenance area setup. The client has to follow
+ * gateway registration steps and retry this request.
+ *
+ * AUTHENTICATION_FAILURE - How Authentication will be implemented is yet to be determined.
+ * For now this is a place holder.
+ *
+ * INVALID_AUTHORIZATION - This will throw an authorization exception. When a more robust security hand-shake
+ * is implemented, the authorization will be more substantial.
+ *
+ * @throws org.apache.airavata.model.error.AiravataSystemException
+ * This exception will be thrown for any Airavata Server side issues and if the problem cannot be corrected by the client
+ * rather an Airavata Administrator will be notified to take corrective action.
+ *
+ **/
+ void executePostProcessing(1: required security_model.AuthzToken authzToken,
+ 2: required string airavataExperimetId,
+ 3: required string gatewayId)
+ throws (1: airavata_errors.InvalidRequestException ire,
+ 2: airavata_errors.ExperimentNotFoundException enf,
+ 3: airavata_errors.AiravataClientException ace,
+ 4: airavata_errors.AiravataSystemException ase,
+ 5: airavata_errors.AuthorizationException ae)
+
/**
*
* Get Experiment Status
diff --git a/thrift-interface-descriptions/airavata-apis/messaging_events.thrift b/thrift-interface-descriptions/airavata-apis/messaging_events.thrift
index b1ea9b5..bf5fc1d 100644
--- a/thrift-interface-descriptions/airavata-apis/messaging_events.thrift
+++ b/thrift-interface-descriptions/airavata-apis/messaging_events.thrift
@@ -43,7 +43,8 @@ enum MessageType {
LAUNCHPROCESS,
TERMINATEPROCESS,
PROCESSOUTPUT,
- DB_EVENT
+ DB_EVENT,
+ POSTPROCESSING_START
}
struct ExperimentStatusChangeEvent {
diff --git a/thrift-interface-descriptions/component-cpis/orchestrator-cpi.thrift b/thrift-interface-descriptions/component-cpis/orchestrator-cpi.thrift
index 65b6cd7..ec18096 100644
--- a/thrift-interface-descriptions/component-cpis/orchestrator-cpi.thrift
+++ b/thrift-interface-descriptions/component-cpis/orchestrator-cpi.thrift
@@ -77,4 +77,6 @@ service OrchestratorService {
*
**/
bool terminateExperiment (1: required string experimentId, 2: required string gatewayId)
+
+ bool launchPostProcessingOfExperiment(1: required string experimentId, 2: required string gatewayId)
}
diff --git a/thrift-interface-descriptions/data-models/experiment-catalog-models/process_model.thrift b/thrift-interface-descriptions/data-models/experiment-catalog-models/process_model.thrift
index b2bce73..105b776 100644
--- a/thrift-interface-descriptions/data-models/experiment-catalog-models/process_model.thrift
+++ b/thrift-interface-descriptions/data-models/experiment-catalog-models/process_model.thrift
@@ -64,4 +64,10 @@ struct ProcessModel {
22: optional string experimentDataDir,
23: optional string userName,
24: optional bool useUserCRPref;
+ 25: required ProcessType processType;
+}
+
+enum ProcessType {
+ PRIMARY,
+ FORCE_POST_PROCESING
}
\ No newline at end of file
diff --git a/thrift-interface-descriptions/data-models/experiment-catalog-models/status_models.thrift b/thrift-interface-descriptions/data-models/experiment-catalog-models/status_models.thrift
index 2f3a4a6..51e380c 100644
--- a/thrift-interface-descriptions/data-models/experiment-catalog-models/status_models.thrift
+++ b/thrift-interface-descriptions/data-models/experiment-catalog-models/status_models.thrift
@@ -32,7 +32,11 @@ enum ExperimentState {
CANCELING,
CANCELED,
COMPLETED,
- FAILED
+ FAILED,
+ FORCE_POST_PROCESSING_EXECUTING,
+ FORCE_POST_PROCESSING_COMPLETED,
+ FORCE_POST_PROCESSING_FAILED,
+ FORCE_POST_PROCESSING_CANCELED,
}
enum TaskState {
--
To stop receiving notification emails like this one, please contact
"commits@airavata.apache.org" <co...@airavata.apache.org>.