Repository: airavata Updated Branches: refs/heads/master 2d9ea1f4a -> a6c7a1f71
http://git-wip-us.apache.org/repos/asf/airavata/blob/cc4286b2/modules/messaging/core/src/main/java/org/apache/airavata/messaging/core/impl/RabbitMQStatusConsumer.java ---------------------------------------------------------------------- diff --git a/modules/messaging/core/src/main/java/org/apache/airavata/messaging/core/impl/RabbitMQStatusConsumer.java b/modules/messaging/core/src/main/java/org/apache/airavata/messaging/core/impl/RabbitMQStatusConsumer.java index c723f01..4f3868f 100644 --- a/modules/messaging/core/src/main/java/org/apache/airavata/messaging/core/impl/RabbitMQStatusConsumer.java +++ b/modules/messaging/core/src/main/java/org/apache/airavata/messaging/core/impl/RabbitMQStatusConsumer.java @@ -162,13 +162,13 @@ public class RabbitMQStatusConsumer implements Consumer { event = experimentStatusChangeEvent; gatewayId = experimentStatusChangeEvent.getGatewayId(); } else if (message.getMessageType().equals(MessageType.WORKFLOWNODE)) { - WorkflowNodeStatusChangeEvent wfnStatusChangeEvent = new WorkflowNodeStatusChangeEvent(); + /* WorkflowNodeStatusChangeEvent wfnStatusChangeEvent = new WorkflowNodeStatusChangeEvent(); ThriftUtils.createThriftFromBytes(message.getEvent(), wfnStatusChangeEvent); log.debug(" Message Received with message id '" + message.getMessageId() + "' and with message type '" + message.getMessageType() + "' with status " + wfnStatusChangeEvent.getState()); event = wfnStatusChangeEvent; - gatewayId = wfnStatusChangeEvent.getWorkflowNodeIdentity().getGatewayId(); + gatewayId = wfnStatusChangeEvent.getWorkflowNodeIdentity().getGatewayId();*/ } else if (message.getMessageType().equals(MessageType.TASK)) { TaskStatusChangeEvent taskStatusChangeEvent = new TaskStatusChangeEvent(); ThriftUtils.createThriftFromBytes(message.getEvent(), taskStatusChangeEvent); http://git-wip-us.apache.org/repos/asf/airavata/blob/cc4286b2/modules/messaging/core/src/main/java/org/apache/airavata/messaging/core/impl/RabbitMQStatusPublisher.java ---------------------------------------------------------------------- diff --git a/modules/messaging/core/src/main/java/org/apache/airavata/messaging/core/impl/RabbitMQStatusPublisher.java b/modules/messaging/core/src/main/java/org/apache/airavata/messaging/core/impl/RabbitMQStatusPublisher.java index 2ba7a19..a578148 100644 --- a/modules/messaging/core/src/main/java/org/apache/airavata/messaging/core/impl/RabbitMQStatusPublisher.java +++ b/modules/messaging/core/src/main/java/org/apache/airavata/messaging/core/impl/RabbitMQStatusPublisher.java @@ -79,9 +79,9 @@ public class RabbitMQStatusPublisher implements Publisher { routingKey = gatewayId + "." + event.getTaskIdentity().getExperimentId() + "." + event.getTaskIdentity().getWorkflowNodeId() + "." + event.getTaskIdentity().getTaskId(); } else if (msgCtx.getType() == MessageType.WORKFLOWNODE) { - WorkflowNodeStatusChangeEvent event = (WorkflowNodeStatusChangeEvent) msgCtx.getEvent(); + /*WorkflowNodeStatusChangeEvent event = (WorkflowNodeStatusChangeEvent) msgCtx.getEvent(); WorkflowIdentifier workflowNodeIdentity = event.getWorkflowNodeIdentity(); - routingKey = gatewayId + "." + workflowNodeIdentity.getExperimentId() + "." + workflowNodeIdentity.getWorkflowNodeId(); + routingKey = gatewayId + "." + workflowNodeIdentity.getExperimentId() + "." + workflowNodeIdentity.getWorkflowNodeId();*/ } else if (msgCtx.getType() == MessageType.JOB) { JobStatusChangeEvent event = (JobStatusChangeEvent) msgCtx.getEvent(); JobIdentifier identity = event.getJobIdentity(); http://git-wip-us.apache.org/repos/asf/airavata/blob/cc4286b2/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactory.java ---------------------------------------------------------------------- diff --git a/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactory.java b/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactory.java index c2a31cc..ff4629e 100644 --- a/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactory.java +++ b/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/client/OrchestratorClientFactory.java @@ -21,7 +21,7 @@ package org.apache.airavata.orchestrator.client; -import org.apache.airavata.model.error.AiravataClientConnectException; +import org.apache.airavata.model.error.AiravataClientException; import org.apache.airavata.orchestrator.cpi.OrchestratorService; import org.apache.thrift.protocol.TBinaryProtocol; import org.apache.thrift.protocol.TProtocol; @@ -31,14 +31,14 @@ import org.apache.thrift.transport.TTransportException; public class OrchestratorClientFactory { - public static OrchestratorService.Client createOrchestratorClient(String serverHost, int serverPort) throws AiravataClientConnectException{ + public static OrchestratorService.Client createOrchestratorClient(String serverHost, int serverPort) throws AiravataClientException { try { TTransport transport = new TSocket(serverHost, serverPort); transport.open(); TProtocol protocol = new TBinaryProtocol(transport); return new OrchestratorService.Client(protocol); } catch (TTransportException e) { - throw new AiravataClientConnectException("Unable to connect to the server at "+serverHost+":"+serverPort); + throw new AiravataClientException(); } } } http://git-wip-us.apache.org/repos/asf/airavata/blob/cc4286b2/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/cpi/OrchestratorService.java ---------------------------------------------------------------------- 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 ad3edb3..d80ffeb 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 @@ -15,7 +15,7 @@ * limitations under the License. */ /** - * Autogenerated by Thrift Compiler (0.9.1) + * Autogenerated by Thrift Compiler (0.9.2) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @@ -45,10 +45,13 @@ import java.util.Collections; import java.util.BitSet; import java.nio.ByteBuffer; import java.util.Arrays; +import javax.annotation.Generated; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -@SuppressWarnings("all") public class OrchestratorService { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-6-18") +public class OrchestratorService { public interface Iface { @@ -884,7 +887,7 @@ import org.slf4j.LoggerFactory; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum { + public enum _Fields implements org.apache.thrift.TFieldIdEnum { ; private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -1002,7 +1005,9 @@ import org.slf4j.LoggerFactory; @Override public int hashCode() { - return 0; + List<Object> list = new ArrayList<Object>(); + + return list.hashCode(); } @Override @@ -1132,7 +1137,7 @@ import org.slf4j.LoggerFactory; public String success; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum { + public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -1313,7 +1318,14 @@ import org.slf4j.LoggerFactory; @Override public int hashCode() { - return 0; + List<Object> list = new ArrayList<Object>(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); } @Override @@ -1488,7 +1500,7 @@ import org.slf4j.LoggerFactory; public String airavataCredStoreToken; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum { + public enum _Fields implements org.apache.thrift.TFieldIdEnum { EXPERIMENT_ID((short)1, "experimentId"), AIRAVATA_CRED_STORE_TOKEN((short)2, "airavataCredStoreToken"); @@ -1726,7 +1738,19 @@ import org.slf4j.LoggerFactory; @Override public int hashCode() { - return 0; + List<Object> list = new ArrayList<Object>(); + + boolean present_experimentId = true && (isSetExperimentId()); + list.add(present_experimentId); + if (present_experimentId) + list.add(experimentId); + + boolean present_airavataCredStoreToken = true && (isSetAiravataCredStoreToken()); + list.add(present_airavataCredStoreToken); + if (present_airavataCredStoreToken) + list.add(airavataCredStoreToken); + + return list.hashCode(); } @Override @@ -1929,7 +1953,7 @@ import org.slf4j.LoggerFactory; public boolean success; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum { + public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -2112,7 +2136,14 @@ import org.slf4j.LoggerFactory; @Override public int hashCode() { - return 0; + List<Object> list = new ArrayList<Object>(); + + boolean present_success = true; + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); } @Override @@ -2285,7 +2316,7 @@ import org.slf4j.LoggerFactory; public String airavataCredStoreToken; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum { + public enum _Fields implements org.apache.thrift.TFieldIdEnum { TASK_ID((short)1, "taskId"), AIRAVATA_CRED_STORE_TOKEN((short)2, "airavataCredStoreToken"); @@ -2523,7 +2554,19 @@ import org.slf4j.LoggerFactory; @Override public int hashCode() { - return 0; + List<Object> list = new ArrayList<Object>(); + + boolean present_taskId = true && (isSetTaskId()); + list.add(present_taskId); + if (present_taskId) + list.add(taskId); + + boolean present_airavataCredStoreToken = true && (isSetAiravataCredStoreToken()); + list.add(present_airavataCredStoreToken); + if (present_airavataCredStoreToken) + list.add(airavataCredStoreToken); + + return list.hashCode(); } @Override @@ -2726,7 +2769,7 @@ import org.slf4j.LoggerFactory; public boolean success; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum { + public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -2909,7 +2952,14 @@ import org.slf4j.LoggerFactory; @Override public int hashCode() { - return 0; + List<Object> list = new ArrayList<Object>(); + + boolean present_success = true; + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); } @Override @@ -3080,7 +3130,7 @@ import org.slf4j.LoggerFactory; public String experimentId; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum { + public enum _Fields implements org.apache.thrift.TFieldIdEnum { EXPERIMENT_ID((short)1, "experimentId"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -3261,7 +3311,14 @@ import org.slf4j.LoggerFactory; @Override public int hashCode() { - return 0; + List<Object> list = new ArrayList<Object>(); + + boolean present_experimentId = true && (isSetExperimentId()); + list.add(present_experimentId); + if (present_experimentId) + list.add(experimentId); + + return list.hashCode(); } @Override @@ -3429,7 +3486,7 @@ import org.slf4j.LoggerFactory; public org.apache.airavata.model.error.LaunchValidationException lve; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum { + public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"), LVE((short)1, "lve"); @@ -3669,7 +3726,19 @@ import org.slf4j.LoggerFactory; @Override public int hashCode() { - return 0; + List<Object> list = new ArrayList<Object>(); + + boolean present_success = true; + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_lve = true && (isSetLve()); + list.add(present_lve); + if (present_lve) + list.add(lve); + + return list.hashCode(); } @Override @@ -3885,7 +3954,7 @@ import org.slf4j.LoggerFactory; public String tokenId; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum { + public enum _Fields implements org.apache.thrift.TFieldIdEnum { EXPERIMENT_ID((short)1, "experimentId"), TOKEN_ID((short)2, "tokenId"); @@ -4123,7 +4192,19 @@ import org.slf4j.LoggerFactory; @Override public int hashCode() { - return 0; + List<Object> list = new ArrayList<Object>(); + + boolean present_experimentId = true && (isSetExperimentId()); + list.add(present_experimentId); + if (present_experimentId) + list.add(experimentId); + + boolean present_tokenId = true && (isSetTokenId()); + list.add(present_tokenId); + if (present_tokenId) + list.add(tokenId); + + return list.hashCode(); } @Override @@ -4326,7 +4407,7 @@ import org.slf4j.LoggerFactory; public boolean success; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum { + public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -4509,7 +4590,14 @@ import org.slf4j.LoggerFactory; @Override public int hashCode() { - return 0; + List<Object> list = new ArrayList<Object>(); + + boolean present_success = true; + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); } @Override http://git-wip-us.apache.org/repos/asf/airavata/blob/cc4286b2/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/cpi/orchestrator_cpi_serviceConstants.java ---------------------------------------------------------------------- diff --git a/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/cpi/orchestrator_cpi_serviceConstants.java b/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/cpi/orchestrator_cpi_serviceConstants.java index 3fa2946..691c696 100644 --- a/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/cpi/orchestrator_cpi_serviceConstants.java +++ b/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/cpi/orchestrator_cpi_serviceConstants.java @@ -15,7 +15,7 @@ * limitations under the License. */ /** - * Autogenerated by Thrift Compiler (0.9.1) + * Autogenerated by Thrift Compiler (0.9.2) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @@ -45,10 +45,12 @@ import java.util.Collections; import java.util.BitSet; import java.nio.ByteBuffer; import java.util.Arrays; +import javax.annotation.Generated; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -@SuppressWarnings("all") public class orchestrator_cpi_serviceConstants { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +public class orchestrator_cpi_serviceConstants { public static final String ORCHESTRATOR_CPI_VERSION = "0.13.0"; http://git-wip-us.apache.org/repos/asf/airavata/blob/cc4286b2/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/sample/OrchestratorClientSample.java ---------------------------------------------------------------------- diff --git a/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/sample/OrchestratorClientSample.java b/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/sample/OrchestratorClientSample.java index 754bc82..e8f6bec 100644 --- a/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/sample/OrchestratorClientSample.java +++ b/modules/orchestrator/orchestrator-client/src/main/java/org/apache/airavata/orchestrator/sample/OrchestratorClientSample.java @@ -26,13 +26,13 @@ package org.apache.airavata.orchestrator.sample; //import org.apache.airavata.client.api.exception.AiravataAPIInvocationException; //import org.apache.airavata.client.tools.DocumentCreator; -import org.apache.airavata.model.appcatalog.appinterface.DataType; -import org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType; -import org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType; -import org.apache.airavata.model.util.ExperimentModelUtil; -import org.apache.airavata.model.experiment.ComputationalResourceScheduling; +import org.apache.airavata.model.application.io.DataType; +import org.apache.airavata.model.application.io.InputDataObjectType; +import org.apache.airavata.model.application.io.OutputDataObjectType; import org.apache.airavata.model.experiment.ExperimentModel; -import org.apache.airavata.model.experiment.UserConfigurationData; +import org.apache.airavata.model.experiment.UserConfigurationDataModel; +import org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel; +import org.apache.airavata.model.util.ExperimentModelUtil; import org.apache.airavata.orchestrator.cpi.OrchestratorService; import org.apache.thrift.TException; @@ -103,14 +103,14 @@ public class OrchestratorClientSample { output.setValue(""); exOut.add(output); - Experiment simpleExperiment = ExperimentModelUtil.createSimpleExperiment("default", "admin", "echoExperiment", "SimpleEcho2", "SimpleEcho2", exInputs); + ExperimentModel simpleExperiment = ExperimentModelUtil.createSimpleExperiment("default", "admin", "echoExperiment", "SimpleEcho2", "SimpleEcho2", exInputs); simpleExperiment.setExperimentOutputs(exOut); - ComputationalResourceScheduling scheduling = ExperimentModelUtil.createComputationResourceScheduling("trestles.sdsc.edu", 1, 1, 1, "normal", 0, 0, 1, "sds128"); + ComputationalResourceSchedulingModel scheduling = ExperimentModelUtil.createComputationResourceScheduling("trestles.sdsc.edu", 1, 1, 1, "normal", 0, 0); scheduling.setResourceHostId("gsissh-trestles"); - UserConfigurationData userConfigurationData = new UserConfigurationData(); - userConfigurationData.setComputationalResourceScheduling(scheduling); - simpleExperiment.setUserConfigurationData(userConfigurationData); + UserConfigurationDataModel userConfigurationDataModel = new UserConfigurationDataModel(); + userConfigurationDataModel.setComputationalResourceScheduling(scheduling); + simpleExperiment.setUserConfigurationData(userConfigurationDataModel); String expId = null; try { // expId = (String) registry.add(ParentDataType.EXPERIMENT, simpleExperiment); http://git-wip-us.apache.org/repos/asf/airavata/blob/cc4286b2/modules/orchestrator/orchestrator-service/pom.xml ---------------------------------------------------------------------- diff --git a/modules/orchestrator/orchestrator-service/pom.xml b/modules/orchestrator/orchestrator-service/pom.xml index f43b758..c55589f 100644 --- a/modules/orchestrator/orchestrator-service/pom.xml +++ b/modules/orchestrator/orchestrator-service/pom.xml @@ -75,6 +75,11 @@ <artifactId>airavata-server-configuration</artifactId> <scope>test</scope> </dependency> + <dependency> + <groupId>org.apache.airavata</groupId> + <artifactId>airavata-commons</artifactId> + <version>${project.version}</version> + </dependency> </dependencies> <properties> http://git-wip-us.apache.org/repos/asf/airavata/blob/cc4286b2/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServer.java ---------------------------------------------------------------------- diff --git a/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServer.java b/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServer.java index 78957ac..e2c5eaf 100644 --- a/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServer.java +++ b/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServer.java @@ -35,7 +35,7 @@ import org.apache.thrift.transport.TTransportException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class OrchestratorServer implements IServer{ +public class OrchestratorServer implements IServer { private final static Logger logger = LoggerFactory.getLogger(OrchestratorServer.class); private static final String SERVER_NAME = "Orchestrator Server"; @@ -52,7 +52,7 @@ public class OrchestratorServer implements IServer{ public void StartOrchestratorServer(OrchestratorService.Processor<OrchestratorServerHandler> orchestratorServerHandlerProcessor) throws Exception { try { - final int serverPort = Integer.parseInt(ServerSettings.getSetting(Constants.ORCHESTRATOT_SERVER_PORT,"8940")); + final int serverPort = Integer.parseInt(ServerSettings.getSetting(Constants.ORCHESTRATOT_SERVER_PORT, "8940")); final String serverHost = ServerSettings.getSetting(Constants.ORCHESTRATOT_SERVER_HOST, null); http://git-wip-us.apache.org/repos/asf/airavata/blob/cc4286b2/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/WorkerResource.java ---------------------------------------------------------------------- diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/WorkerResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/WorkerResource.java index 8a532c1..861c6bd 100644 --- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/WorkerResource.java +++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/WorkerResource.java @@ -21,7 +21,7 @@ package org.apache.airavata.registry.core.experiment.catalog.resources; -import org.apache.airavata.model.experiment.ExperimentState; +import org.apache.airavata.model.status.ExperimentState; import org.apache.airavata.registry.core.experiment.catalog.ExpCatResourceUtils; import org.apache.airavata.registry.core.experiment.catalog.ExperimentCatResource; import org.apache.airavata.registry.core.experiment.catalog.ResourceType; http://git-wip-us.apache.org/repos/asf/airavata/blob/cc4286b2/modules/registry/registry-core/src/test/java/org/apache/airavata/app/catalog/AppInterfaceTest.java ---------------------------------------------------------------------- diff --git a/modules/registry/registry-core/src/test/java/org/apache/airavata/app/catalog/AppInterfaceTest.java b/modules/registry/registry-core/src/test/java/org/apache/airavata/app/catalog/AppInterfaceTest.java index 41ab78d..2488f63 100644 --- a/modules/registry/registry-core/src/test/java/org/apache/airavata/app/catalog/AppInterfaceTest.java +++ b/modules/registry/registry-core/src/test/java/org/apache/airavata/app/catalog/AppInterfaceTest.java @@ -26,9 +26,9 @@ import org.apache.airavata.common.exception.ApplicationSettingsException; import org.apache.airavata.common.utils.ServerSettings; import org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule; import org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription; -import org.apache.airavata.model.appcatalog.appinterface.DataType; -import org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType; -import org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType; +import org.apache.airavata.model.application.io.DataType; +import org.apache.airavata.model.application.io.InputDataObjectType; +import org.apache.airavata.model.application.io.OutputDataObjectType; import org.apache.airavata.registry.core.app.catalog.resources.AppCatAbstractResource; import org.apache.airavata.registry.core.experiment.catalog.impl.RegistryFactory; import org.apache.airavata.registry.cpi.AppCatalog; http://git-wip-us.apache.org/repos/asf/airavata/blob/cc4286b2/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentUseCaseTest.java ---------------------------------------------------------------------- diff --git a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentUseCaseTest.java b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentUseCaseTest.java index 056f666..75b347d 100644 --- a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentUseCaseTest.java +++ b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentUseCaseTest.java @@ -24,10 +24,14 @@ import junit.framework.Assert; import org.apache.airavata.common.exception.ApplicationSettingsException; import org.apache.airavata.common.utils.ServerSettings; import org.apache.airavata.experiment.catalog.util.Initialize; -import org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType; -import org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType; +import org.apache.airavata.model.application.io.InputDataObjectType; +import org.apache.airavata.model.application.io.OutputDataObjectType; +import org.apache.airavata.model.experiment.ExperimentModel; +import org.apache.airavata.model.experiment.ExperimentSummaryModel; +import org.apache.airavata.model.experiment.UserConfigurationDataModel; +import org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel; +import org.apache.airavata.model.status.ExperimentState; import org.apache.airavata.model.workspace.Project; -import org.apache.airavata.model.experiment.*; import org.apache.airavata.registry.core.experiment.catalog.impl.RegistryFactory; import org.apache.airavata.registry.cpi.*; import org.apache.airavata.registry.cpi.utils.Constants; @@ -182,25 +186,25 @@ public class ExperimentUseCaseTest { inputDataObjectType.setName("Input_to_Echo"); inputDataObjectType.setValue("Hello World"); - ComputationalResourceScheduling scheduling = new ComputationalResourceScheduling(); + ComputationalResourceSchedulingModel scheduling = new ComputationalResourceSchedulingModel(); scheduling.setResourceHostId(UUID.randomUUID().toString()); - scheduling.setComputationalProjectAccount("TG-STA110014S"); +// scheduling.setComputationalProjectAccount("TG-STA110014S"); scheduling.setTotalCPUCount(1); scheduling.setNodeCount(1); scheduling.setWallTimeLimit(15); scheduling.setQueueName("normal"); - UserConfigurationData userConfigurationData = new UserConfigurationData(); + UserConfigurationDataModel userConfigurationData = new UserConfigurationDataModel(); userConfigurationData.setAiravataAutoSchedule(false); userConfigurationData.setOverrideManualScheduledParams(false); userConfigurationData.setComputationalResourceScheduling(scheduling); - Experiment experiment = new Experiment(); - experiment.setProjectID(projectId1); + ExperimentModel experiment = new ExperimentModel(); + experiment.setProjectId(projectId1); experiment.setUserName("TestUser" + TAG); - experiment.setName("TestExperiment"+TAG); + experiment.setExperimentName("TestExperiment" + TAG); experiment.setDescription("Test 1 experiment"); - experiment.setApplicationId(UUID.randomUUID().toString()); + experiment.setExecutionId(UUID.randomUUID().toString()); experiment.setUserConfigurationData(userConfigurationData); experiment.addToExperimentInputs(inputDataObjectType); @@ -208,18 +212,18 @@ public class ExperimentUseCaseTest { Assert.assertNotNull(experimentId1); //retrieving the stored experiment - Experiment retrievedExperiment = (Experiment) experimentCatalog.get(ExperimentCatalogModelType.EXPERIMENT, + ExperimentModel retrievedExperiment = (ExperimentModel) experimentCatalog.get(ExperimentCatalogModelType.EXPERIMENT, experimentId1); Assert.assertNotNull(retrievedExperiment); - Assert.assertEquals(retrievedExperiment.getProjectID(), experiment.getProjectID()); + Assert.assertEquals(retrievedExperiment.getProjectId(), experiment.getProjectId()); Assert.assertEquals(retrievedExperiment.getDescription(), experiment.getDescription()); - Assert.assertEquals(retrievedExperiment.getName(), experiment.getName()); - Assert.assertEquals(retrievedExperiment.getApplicationId(), experiment.getApplicationId()); + Assert.assertEquals(retrievedExperiment.getExperimentName(), experiment.getExperimentName()); + Assert.assertEquals(retrievedExperiment.getExecutionId(), experiment.getExecutionId()); Assert.assertNotNull(retrievedExperiment.getUserConfigurationData()); Assert.assertNotNull(retrievedExperiment.getExperimentInputs()); //updating an existing experiment - experiment.setName("NewExperimentName"+TAG); + experiment.setExperimentName("NewExperimentName" + TAG); OutputDataObjectType outputDataObjectType = new OutputDataObjectType(); outputDataObjectType.setName("Output_to_Echo"); outputDataObjectType.setValue("Hello World"); @@ -227,24 +231,24 @@ public class ExperimentUseCaseTest { experimentCatalog.update(ExperimentCatalogModelType.EXPERIMENT, experiment, experimentId1); //creating more experiments - experiment = new Experiment(); - experiment.setProjectID(projectId1); + experiment = new ExperimentModel(); + experiment.setProjectId(projectId1); experiment.setUserName("TestUser" + TAG); - experiment.setName("TestExperiment2" + TAG); + experiment.setExperimentName("TestExperiment2" + TAG); experiment.setDescription("Test 2 experiment"); - experiment.setApplicationId(UUID.randomUUID().toString()); + experiment.setExecutionId(UUID.randomUUID().toString()); experiment.setUserConfigurationData(userConfigurationData); experiment.addToExperimentInputs(inputDataObjectType); String experimentId2 = (String) experimentCatalog.add(ExpCatParentDataType.EXPERIMENT, experiment, gatewayId); Assert.assertNotNull(experimentId2); - experiment = new Experiment(); - experiment.setProjectID(projectId1); + experiment = new ExperimentModel(); + experiment.setProjectId(projectId1); experiment.setUserName("TestUser" + TAG); - experiment.setName("TestExperiment3"+TAG); + experiment.setExperimentName("TestExperiment3" + TAG); experiment.setDescription("Test 3 experiment"); - experiment.setApplicationId(UUID.randomUUID().toString()); + experiment.setExecutionId(UUID.randomUUID().toString()); experiment.setUserConfigurationData(userConfigurationData); experiment.addToExperimentInputs(inputDataObjectType); @@ -281,8 +285,8 @@ public class ExperimentUseCaseTest { list = experimentCatalog.search(ExperimentCatalogModelType.EXPERIMENT, filters, 2, 1, Constants.FieldConstants.ExperimentConstants.CREATION_TIME, ResultOrderType.DESC); Assert.assertTrue(list.size()==2); - ExperimentSummary exp1 = (ExperimentSummary)list.get(0); - ExperimentSummary exp2 = (ExperimentSummary)list.get(1); + ExperimentSummaryModel exp1 = (ExperimentSummaryModel)list.get(0); + ExperimentSummaryModel exp2 = (ExperimentSummaryModel)list.get(1); Assert.assertTrue(exp1.getCreationTime()-exp2.getCreationTime() > 0); } catch (RegistryException e) { http://git-wip-us.apache.org/repos/asf/airavata/blob/cc4286b2/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/TaskDetailResourceTest.java ---------------------------------------------------------------------- diff --git a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/TaskDetailResourceTest.java b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/TaskDetailResourceTest.java index ace4af6..b50910b 100644 --- a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/TaskDetailResourceTest.java +++ b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/TaskDetailResourceTest.java @@ -24,7 +24,7 @@ import static org.junit.Assert.*; import java.sql.Timestamp; import java.util.Date; -import org.apache.airavata.model.experiment.ExecutionUnit; +import org.apache.airavata.model.experiment.ExperimentType; import org.apache.airavata.registry.core.experiment.catalog.ResourceType; import org.apache.airavata.registry.core.experiment.catalog.resources.ExperimentResource; import org.apache.airavata.registry.core.experiment.catalog.resources.TaskDetailResource; @@ -61,7 +61,7 @@ public class TaskDetailResourceTest extends AbstractResourceTest{ nodeDetailResource.setNodeInstanceId(nodeID); nodeDetailResource.setNodeName(nodeID); nodeDetailResource.setCreationTime(creationTime); - nodeDetailResource.setExecutionUnit(ExecutionUnit.APPLICATION.toString()); + nodeDetailResource.setExecutionUnit(ExperimentType.SINGLE_APPLICATION.toString()); nodeDetailResource.save(); taskDetailResource = (TaskDetailResource)nodeDetailResource.create(ResourceType.TASK_DETAIL); http://git-wip-us.apache.org/repos/asf/airavata/blob/cc4286b2/thrift-interface-descriptions/airavata-api/airavata_errors.thrift ---------------------------------------------------------------------- diff --git a/thrift-interface-descriptions/airavata-api/airavata_errors.thrift b/thrift-interface-descriptions/airavata-api/airavata_errors.thrift index c445ec1..e0849a1 100644 --- a/thrift-interface-descriptions/airavata-api/airavata_errors.thrift +++ b/thrift-interface-descriptions/airavata-api/airavata_errors.thrift @@ -139,6 +139,21 @@ exception AiravataClientException { 2: optional string parameter } +struct ValidatorResult { + 1: required bool result, + 2: optional string errorDetails +} + +struct ValidationResults { + 1: required bool validationState, + 2: required list<ValidatorResult> validationResultList +} + +exception LaunchValidationException { + 1: required ValidationResults validationResult; + 2: optional string errorMessage; +} + /** * This exception is thrown by Airavata Services when a call fails as a result of * a problem in the service that could not be changed through client's action. http://git-wip-us.apache.org/repos/asf/airavata/blob/cc4286b2/thrift-interface-descriptions/gfac-cpi/generate-gfac-stubs.sh ---------------------------------------------------------------------- diff --git a/thrift-interface-descriptions/gfac-cpi/generate-gfac-stubs.sh b/thrift-interface-descriptions/gfac-cpi/generate-gfac-stubs.sh index 9a660e5..34cb4f2 100755 --- a/thrift-interface-descriptions/gfac-cpi/generate-gfac-stubs.sh +++ b/thrift-interface-descriptions/gfac-cpi/generate-gfac-stubs.sh @@ -38,11 +38,6 @@ add_license_header() { # Fetch the generated code directory passed as the argument GENERATED_CODE_DIR=$1 - # For all generated thrift code, add the suppress all warnings annotation - # NOTE: In order to save the orginal file as a backup, use sed -i.orig in place of sed -i '' - find ${GENERATED_CODE_DIR} -name '*.java' -print0 | xargs -0 sed -i '' -e 's/public class /@SuppressWarnings("all") public class /' - find ${GENERATED_CODE_DIR} -name '*.java' -print0 | xargs -0 sed -i '' -e 's/public enum /@SuppressWarnings("all") public enum /' - # For each java file within the genrated directory, add the ASF V2 LICENSE header for f in $(find ${GENERATED_CODE_DIR} -name '*.java'); do cat - ${f} >${f}-with-license <<EOF @@ -118,8 +113,6 @@ rm -rf ${JAVA_GEN_DIR} # Using thrify Java generator, generate the java classes based on Airavata API. This # The airavata_api.thrift includes rest of data models. thrift ${THRIFT_ARGS} --gen java gfac.cpi.service.thrift || fail unable to generate java thrift classes -thrift ${THRIFT_ARGS} --gen java gfacDataModel.thrift || fail unable to generate java thrift classes - # For the generated java classes add the ASF V2 License header add_license_header $JAVA_GEN_DIR http://git-wip-us.apache.org/repos/asf/airavata/blob/cc4286b2/thrift-interface-descriptions/gfac-cpi/gfacDataModel.thrift ---------------------------------------------------------------------- diff --git a/thrift-interface-descriptions/gfac-cpi/gfacDataModel.thrift b/thrift-interface-descriptions/gfac-cpi/gfacDataModel.thrift deleted file mode 100644 index 883528e..0000000 --- a/thrift-interface-descriptions/gfac-cpi/gfacDataModel.thrift +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -include "applicationCatalogDataModel.thrift" - -namespace java org.apache.airavata.gfac.states - -/* - * This file describes the definitions of the Gfac Framework level Experiment Data Structures. Each of the - * language specific Airavata Client SDK's will translate this neutral data model into an - * appropriate form for passing to the Airavata Server Execution API Calls. - * - * This data-model will not be visible to the outside users but it will be used inside GFAc to recover - * the failed jobs or hanged jobs. - * -*/ - -const string DEFAULT_ID = "DO_NOT_SET_AT_CLIENTS" -const string DEFAULT_PROJECT_NAME = "DEFAULT" -const string SINGLE_APP_NODE_NAME = "SINGLE_APP_NODE" - -enum GfacExperimentState { - LAUNCHED, - ACCEPTED, - INHANDLERSINVOKING, - INHANDLERSINVOKED, - PROVIDERINVOKING, - JOBSUBMITTED, - PROVIDERINVOKED, - OUTHANDLERSINVOKING, - OUTHANDLERSINVOKED, - COMPLETED, - FAILED, - UNKNOWN -} - -enum GfacHandlerState { - INVOKING, - INVOKED, - COMPLETED, - UNKNOWN -} - -struct GfacExperimentStatus { - 1: required GfacExperimentState gfacExperimentState, - 2: optional i64 timeOfStateChange -} http://git-wip-us.apache.org/repos/asf/airavata/blob/cc4286b2/thrift-interface-descriptions/orchestrator-cpi/generate-orchestrator-stubs.sh ---------------------------------------------------------------------- diff --git a/thrift-interface-descriptions/orchestrator-cpi/generate-orchestrator-stubs.sh b/thrift-interface-descriptions/orchestrator-cpi/generate-orchestrator-stubs.sh index 2137370..4b83cef 100755 --- a/thrift-interface-descriptions/orchestrator-cpi/generate-orchestrator-stubs.sh +++ b/thrift-interface-descriptions/orchestrator-cpi/generate-orchestrator-stubs.sh @@ -38,11 +38,6 @@ add_license_header() { # Fetch the generated code directory passed as the argument GENERATED_CODE_DIR=$1 - # For all generated thrift code, add the suppress all warnings annotation - # NOTE: In order to save the orginal file as a backup, use sed -i.orig in place of sed -i '' - find ${GENERATED_CODE_DIR} -name '*.java' -print0 | xargs -0 sed -i '' -e 's/public class /@SuppressWarnings("all") public class /' - find ${GENERATED_CODE_DIR} -name '*.java' -print0 | xargs -0 sed -i '' -e 's/public enum /@SuppressWarnings("all") public enum /' - # For each java file within the genrated directory, add the ASF V2 LICENSE header for f in $(find ${GENERATED_CODE_DIR} -name '*.java'); do cat - ${f} >${f}-with-license <<EOF @@ -119,6 +114,10 @@ rm -rf ${JAVA_GEN_DIR} # The airavata_api.thrift includes rest of data models. thrift ${THRIFT_ARGS} --gen java orchestrator.cpi.service.thrift || fail unable to generate java thrift classes +# Remove generated model classes, airavata api thrift file will generate those. +echo "Remove generated model classes ${JAVA_GEN_DIR}/org/airavata/apache/model" +rm -rf ${JAVA_GEN_DIR}/org/apache/airavata/model + # For the generated java classes add the ASF V2 License header add_license_header $JAVA_GEN_DIR
