airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shame...@apache.org
Subject airavata git commit: Show most recent experiment state to client
Date Tue, 04 Aug 2015 00:34:09 GMT
Repository: airavata
Updated Branches:
  refs/heads/master f903d6014 -> a68eb1823


Show most recent experiment state to client


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

Branch: refs/heads/master
Commit: a68eb18235b9f41069ad7801b4103fe8a6444b3b
Parents: f903d60
Author: Shameera Rathanyaka <shameerainfo@gmail.com>
Authored: Mon Aug 3 20:33:52 2015 -0400
Committer: Shameera Rathanyaka <shameerainfo@gmail.com>
Committed: Mon Aug 3 20:33:52 2015 -0400

----------------------------------------------------------------------
 .../server/OrchestratorServerHandler.java          | 17 +++++++++++++++--
 .../orchestrator/util/OrchestratorUtils.java       |  2 --
 .../resources/ExperimentStatusResource.java        |  3 ++-
 3 files changed, 17 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/a68eb182/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
----------------------------------------------------------------------
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 15f7133..8427d0c 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
@@ -505,10 +505,21 @@ public class OrchestratorServerHandler implements OrchestratorService.Iface
{
 					ExperimentStatus status = new ExperimentStatus();
 					ProcessIdentifier processIdentity = processStatusChangeEvent.getProcessIdentity();
 					switch (processStatusChangeEvent.getState()) {
-						case PRE_PROCESSING:
+//						case CREATED:
+//						case VALIDATED:
+//						case PRE_PROCESSING:
+//							break;
+						case CONFIGURING_WORKSPACE:
 							status.setState(ExperimentState.EXECUTING);
 							status.setReason("process  started");
 							break;
+//						case INPUT_DATA_STAGING:
+//						case EXECUTING:
+//						case MONITORING:
+//						case OUTPUT_DATA_STAGING:
+//						case POST_PROCESSING:
+//						case CANCELLING:
+//							break;
 						case COMPLETED:
 							status.setState(ExperimentState.COMPLETED);
 							status.setReason("process  completed");
@@ -526,8 +537,10 @@ public class OrchestratorServerHandler implements OrchestratorService.Iface
{
 							return;
 					}
 					if (status.getState() != null) {
+						status.setTimeOfStateChange(AiravataUtils.getCurrentTimestamp().getTime());
 						OrchestratorUtils.updageExperimentStatus(processIdentity.getExperimentId(), status);
-						log.info("expId : " + processIdentity.getExperimentId() + " :- Experiment status updated
to ", status.getState());
+						log.info("expId : " + processIdentity.getExperimentId() + " :- Experiment status updated
to " +
+								status.getState());
 					}
 				} catch (TException e) {
 					log.error("Message Id : " + message.getMessageId() + ", Message type : " + message.getType()
+

http://git-wip-us.apache.org/repos/asf/airavata/blob/a68eb182/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/util/OrchestratorUtils.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/util/OrchestratorUtils.java
b/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/util/OrchestratorUtils.java
index 5b2cab9..4d4b04e 100644
--- a/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/util/OrchestratorUtils.java
+++ b/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/util/OrchestratorUtils.java
@@ -33,8 +33,6 @@ public class OrchestratorUtils {
 	private static final Logger log = LoggerFactory.getLogger(OrchestratorUtils.class);
 
 	public static void updageExperimentStatus(String experimentId, ExperimentStatus status)
{
-		status.setState(ExperimentState.FAILED);
-		status.setTimeOfStateChange(AiravataUtils.getCurrentTimestamp().getTime());
 		try {
 			RegistryFactory.getDefaultExpCatalog().update(ExperimentCatalogModelType.EXPERIMENT_STATUS,
status,
 					experimentId);

http://git-wip-us.apache.org/repos/asf/airavata/blob/a68eb182/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentStatusResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentStatusResource.java
b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentStatusResource.java
index 9cb4747..103a69e 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentStatusResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentStatusResource.java
@@ -126,7 +126,8 @@ public class ExperimentStatusResource extends AbstractExpCatResource {
             experimentStatus.setExperimentId(experimentId);
             experimentStatus.setState(state);
             experimentStatus.setReason(reason);
-            em.persist(experimentStatus);
+	        experimentStatus.setTimeOfStateChange(timeOfStateChange);
+	        em.persist(experimentStatus);
             em.getTransaction().commit();
             em.close();
         } catch (Exception e) {


Mime
View raw message