You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by la...@apache.org on 2014/03/12 21:03:01 UTC
git commit: Fixing monitoring with new state - CG as completed -
AIRAVATA-1023
Repository: airavata
Updated Branches:
refs/heads/master cbf5b686c -> dde86a59a
Fixing monitoring with new state - CG as completed - AIRAVATA-1023
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/dde86a59
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/dde86a59
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/dde86a59
Branch: refs/heads/master
Commit: dde86a59a8a233b89e193901f478147333147e21
Parents: cbf5b68
Author: lahiru <la...@apache.org>
Authored: Wed Mar 12 16:02:53 2014 -0400
Committer: lahiru <la...@apache.org>
Committed: Wed Mar 12 16:02:53 2014 -0400
----------------------------------------------------------------------
.../main/java/org/apache/airavata/job/monitor/MonitorID.java | 6 ++++++
.../java/org/apache/airavata/job/monitor/MonitorManager.java | 1 +
.../airavata/job/monitor/impl/pull/qstat/QstatMonitor.java | 2 +-
.../job/monitor/impl/pull/qstat/ResourceConnection.java | 6 ++----
.../job/monitor/impl/push/amqp/JSONMessageParser.java | 7 +++++--
5 files changed, 15 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/dde86a59/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/MonitorID.java
----------------------------------------------------------------------
diff --git a/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/MonitorID.java b/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/MonitorID.java
index d7c3da4..f65241a 100644
--- a/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/MonitorID.java
+++ b/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/MonitorID.java
@@ -195,6 +195,12 @@ public class MonitorID {
break;
}
} else {
+ try {
+ // when state becomes unknown we sleep for a while
+ Thread.sleep(10000);
+ } catch (InterruptedException e) {
+ e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
setFailedCount(getFailedCount() + 1);
}
} else {
http://git-wip-us.apache.org/repos/asf/airavata/blob/dde86a59/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/MonitorManager.java
----------------------------------------------------------------------
diff --git a/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/MonitorManager.java b/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/MonitorManager.java
index f1e27b1..3515a68 100644
--- a/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/MonitorManager.java
+++ b/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/MonitorManager.java
@@ -162,6 +162,7 @@ public class MonitorManager {
*/
public void launchMonitor() throws AiravataMonitorException {
//no push monitor is configured so we launch pull monitor
+ int index = 0;
for (PullMonitor monitor : pullMonitors) {
(new Thread(monitor)).start();
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/dde86a59/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/impl/pull/qstat/QstatMonitor.java
----------------------------------------------------------------------
diff --git a/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/impl/pull/qstat/QstatMonitor.java b/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/impl/pull/qstat/QstatMonitor.java
index 232d14d..ee1e6fe 100644
--- a/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/impl/pull/qstat/QstatMonitor.java
+++ b/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/impl/pull/qstat/QstatMonitor.java
@@ -74,7 +74,7 @@ public class QstatMonitor extends PullMonitor {
try {
startPulling();
// After finishing one iteration of the full queue this thread sleeps 1 second
- Thread.sleep(30000);
+ Thread.sleep(10000);
} catch (Exception e){
// we catch all the exceptions here because no matter what happens we do not stop running this
// thread, but ideally we should report proper error messages, but this is handled in startPulling
http://git-wip-us.apache.org/repos/asf/airavata/blob/dde86a59/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/impl/pull/qstat/ResourceConnection.java
----------------------------------------------------------------------
diff --git a/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/impl/pull/qstat/ResourceConnection.java b/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/impl/pull/qstat/ResourceConnection.java
index 821cd19..ade4420 100644
--- a/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/impl/pull/qstat/ResourceConnection.java
+++ b/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/impl/pull/qstat/ResourceConnection.java
@@ -69,15 +69,13 @@ public class ResourceConnection {
private JobState getStatusFromString(String status) {
log.info("parsing the job status returned : " + status);
if(status != null){
- if("C".equals(status) || "CD".equals(status)){
- return JobState.COMPLETE;
- }else if("E".equals(status)){
+ if("C".equals(status) || "CD".equals(status)|| "E".equals(status) || "CG".equals(status)){
return JobState.COMPLETE;
}else if("H".equals(status)){
return JobState.HELD;
}else if("Q".equals(status)){
return JobState.QUEUED;
- }else if("R".equals(status) || "CG".equals(status) || "CF".equals(status)){
+ }else if("R".equals(status) || "CF".equals(status)){
return JobState.ACTIVE;
}else if ("T".equals(status)) {
return JobState.HELD;
http://git-wip-us.apache.org/repos/asf/airavata/blob/dde86a59/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/impl/push/amqp/JSONMessageParser.java
----------------------------------------------------------------------
diff --git a/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/impl/push/amqp/JSONMessageParser.java b/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/impl/push/amqp/JSONMessageParser.java
index 577e9ed..dd9d2e4 100644
--- a/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/impl/push/amqp/JSONMessageParser.java
+++ b/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/impl/push/amqp/JSONMessageParser.java
@@ -20,6 +20,8 @@
*/
package org.apache.airavata.job.monitor.impl.push.amqp;
+import com.fasterxml.jackson.databind.DeserializationConfig;
+import com.fasterxml.jackson.databind.DeserializationFeature;
import org.apache.airavata.ComputingActivity;
import org.apache.airavata.job.monitor.MonitorID;
import org.apache.airavata.job.monitor.core.MessageParser;
@@ -41,9 +43,10 @@ public class JSONMessageParser implements MessageParser {
logger.info("Mesage parse invoked");
System.out.println(message);
// JSONParser parser = new JSONParser();
- ObjectMapper mapper = new ObjectMapper();
+ ObjectMapper objectMapper = new ObjectMapper();
+ objectMapper.configure(org.codehaus.jackson.map.DeserializationConfig.Feature.UNWRAP_ROOT_VALUE, true);
try {
- ComputingActivity computingActivity = mapper.readValue(message.getBytes(), ComputingActivity.class);
+ ComputingActivity computingActivity = objectMapper.readValue(message.getBytes(), ComputingActivity.class);
logger.info(computingActivity.getIDFromEndpoint());
List<String> stateList = computingActivity.getState();
for (String aState : stateList) {