airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject git commit: fixing clone experiment issue - AIRAVATA-1207
Date Tue, 13 May 2014 16:11:47 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 3ba8cfa9c -> 5e6040c61


fixing clone experiment issue - AIRAVATA-1207


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/5e6040c6
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/5e6040c6
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/5e6040c6

Branch: refs/heads/master
Commit: 5e6040c6175df6c975723f2489af2f52d0c46228
Parents: 3ba8cfa
Author: Chathuri Wimalasena <kamalasini@gmail.com>
Authored: Tue May 13 12:11:42 2014 -0400
Committer: Chathuri Wimalasena <kamalasini@gmail.com>
Committed: Tue May 13 12:11:42 2014 -0400

----------------------------------------------------------------------
 .../client/samples/CreateLaunchExperiment.java  | 10 ++--
 .../registry/jpa/impl/ExperimentRegistry.java   | 55 +++++++++++---------
 2 files changed, 36 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/5e6040c6/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
index 4d04dc2..3ee45dc 100644
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
@@ -61,7 +61,7 @@ public class CreateLaunchExperiment {
             AiravataUtils.setExecutionAsClient();
             final Airavata.Client airavata = AiravataClientFactory.createAiravataClient(THRIFT_SERVER_HOST,
THRIFT_SERVER_PORT);
             System.out.println("API version is " + airavata.GetAPIVersion());
-//            addDescriptors();
+            addDescriptors();
 
 //            final String expId = createExperimentForSSHHost(airavata);
 //            final String expId = createExperimentForSSHHost(airavata);
@@ -69,8 +69,7 @@ public class CreateLaunchExperiment {
 //            final String expId = createExperimentForStampede(airavata);
             final String expId = createExperimentForLocalHost(airavata);
             System.out.println("Experiment ID : " + expId);
-            String clonedExpId = cloneExperiment(airavata, expId);
-            System.out.println("Cloned Experiment ID : " + clonedExpId);
+
             launchExperiment(airavata, expId);
             System.out.println("Launched successfully");
             List<Experiment> experiments = getExperimentsForUser(airavata, "admin");
@@ -110,6 +109,7 @@ public class CreateLaunchExperiment {
                              e.printStackTrace();  //To change body of catch statement use
File | Settings | File Templates.
                          }
                      }
+
                  }
             });
             monitor.start();
@@ -132,6 +132,8 @@ public class CreateLaunchExperiment {
                 
 				
 			}
+            String clonedExpId = cloneExperiment(airavata, expId);
+            System.out.println("Cloned Experiment ID : " + clonedExpId);
 //            System.out.println("retrieved exp id : " + experiment.getExperimentID());
         } catch (Exception e) {
             logger.error("Error while connecting with server", e.getMessage());
@@ -250,7 +252,7 @@ public class CreateLaunchExperiment {
                     ExperimentModelUtil.createSimpleExperiment(projectId, "admin", "echoExperiment",
"SimpleEcho0", "SimpleEcho0", exInputs);
             simpleExperiment.setExperimentOutputs(exOut);
 
-            ComputationalResourceScheduling scheduling = ExperimentModelUtil.createComputationResourceScheduling("localhost",
1, 1, 1, "normal", 0, 0, 1, "sds128");
+            ComputationalResourceScheduling scheduling = ExperimentModelUtil.createComputationResourceScheduling("localhost",
1, 1, 1, "normal", 0, 0, 1, "");
             scheduling.setResourceHostId("localhost");
             UserConfigurationData userConfigurationData = new UserConfigurationData();
             userConfigurationData.setAiravataAutoSchedule(false);

http://git-wip-us.apache.org/repos/asf/airavata/blob/5e6040c6/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
index 3c0e1b5..78b198f 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
@@ -90,17 +90,20 @@ public class ExperimentRegistry {
 
             List<DataObjectType> experimentOutputs = experiment.getExperimentOutputs();
             if (experimentOutputs != null && !experimentOutputs.isEmpty()){
+                for (DataObjectType output : experimentOutputs){
+                    output.setValue("");
+                }
                 addExpOutputs(experimentOutputs, experimentID);
             }
 
-            ExperimentStatus experimentStatus = experiment.getExperimentStatus();
-            if (experimentStatus != null){
-                updateExperimentStatus(experimentStatus, experimentID);
-            }else {
-                experimentStatus = new ExperimentStatus();
-                experimentStatus.setExperimentState(ExperimentState.CREATED);
-                updateExperimentStatus(experimentStatus, experimentID);
-            }
+//            ExperimentStatus experimentStatus = experiment.getExperimentStatus();
+//            if (experimentStatus != null){
+//                updateExperimentStatus(experimentStatus, experimentID);
+//            }else {
+            ExperimentStatus experimentStatus = new ExperimentStatus();
+            experimentStatus.setExperimentState(ExperimentState.CREATED);
+            updateExperimentStatus(experimentStatus, experimentID);
+//            }
 
             List<WorkflowNodeDetails> workflowNodeDetailsList = experiment.getWorkflowNodeDetailsList();
             if (workflowNodeDetailsList != null && !workflowNodeDetailsList.isEmpty()){
@@ -444,6 +447,9 @@ public class ExperimentRegistry {
             ExperimentResource experiment = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT);
             WorkflowNodeDetailResource workflowNode = experiment.getWorkflowNode(nodeId);
             StatusResource statusResource = workflowNode.getWorkflowNodeStatus();
+            if (statusResource == null){
+                statusResource = (StatusResource)workflowNode.create(ResourceType.STATUS);
+            }
             statusResource.setExperimentResource(workflowNode.getExperimentResource());
             statusResource.setWorkflowNodeDetail(workflowNode);
             statusResource.setStatusType(StatusType.WORKFLOW_NODE.toString());
@@ -686,23 +692,22 @@ public class ExperimentRegistry {
             }
             WorkflowNodeStatus workflowNodeStatus = nodeDetails.getWorkflowNodeStatus();
             CompositeIdentifier ids = new CompositeIdentifier(expId, nodeId);
-            if (workflowNodeStatus != null ){
-                if (workflowNodeStatus.getWorkflowNodeState() != null){
-                    WorkflowNodeStatus status = getWorkflowNodeStatus(nodeId);
-                    if (status != null){
-                        updateWorkflowNodeStatus(workflowNodeStatus, nodeId);
-                    }else {
-                        addWorkflowNodeStatus(workflowNodeStatus,ids);
-                    }
-                }else {
-                    workflowNodeStatus.setWorkflowNodeState(WorkflowNodeState.UNKNOWN);
-                    addWorkflowNodeStatus(workflowNodeStatus, ids);
-                }
-            }else {
-                WorkflowNodeStatus status = new WorkflowNodeStatus();
-                status.setWorkflowNodeState(WorkflowNodeState.UNKNOWN);
-                addWorkflowNodeStatus(status, ids);
-            }
+            if (workflowNodeStatus == null ){
+                workflowNodeStatus = new WorkflowNodeStatus();
+            }
+//                if (workflowNodeStatus.getWorkflowNodeState() != null){
+//                    WorkflowNodeStatus status = getWorkflowNodeStatus(nodeId);
+//                    if (status != null){
+//                        updateWorkflowNodeStatus(workflowNodeStatus, nodeId);
+//                    }else {
+//                        addWorkflowNodeStatus(workflowNodeStatus,ids);
+//                    }
+//                }else {
+//                    workflowNodeStatus.setWorkflowNodeState(WorkflowNodeState.UNKNOWN);
+//                    addWorkflowNodeStatus(workflowNodeStatus, ids);
+//                }
+            workflowNodeStatus.setWorkflowNodeState(WorkflowNodeState.UNKNOWN);
+            addWorkflowNodeStatus(workflowNodeStatus, ids);
             List<TaskDetails> taskDetails = nodeDetails.getTaskDetailsList();
             if (taskDetails != null && !taskDetails.isEmpty()){
                 for (TaskDetails task : taskDetails){


Mime
View raw message