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/05/21 21:34:19 UTC
git commit: fixing monitoring error
Repository: airavata
Updated Branches:
refs/heads/master 2ce716cd8 -> 452419f17
fixing monitoring error
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/452419f1
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/452419f1
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/452419f1
Branch: refs/heads/master
Commit: 452419f170cd2e3b0d4bc05f018a53224a8929bd
Parents: 2ce716c
Author: lahiru <la...@apache.org>
Authored: Wed May 21 15:34:03 2014 -0400
Committer: lahiru <la...@apache.org>
Committed: Wed May 21 15:34:03 2014 -0400
----------------------------------------------------------------------
.../airavata/gfac/core/monitor/MonitorID.java | 8 -
.../airavata/gfac/monitor/HPCMonitorID.java | 200 ++-----------------
2 files changed, 20 insertions(+), 188 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/452419f1/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/MonitorID.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/MonitorID.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/MonitorID.java
index dfd9de9..84978f1 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/MonitorID.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/MonitorID.java
@@ -212,12 +212,4 @@ public class MonitorID {
public void setJobExecutionContext(JobExecutionContext jobExecutionContext) {
this.jobExecutionContext = jobExecutionContext;
}
-
- // public String getWorkflowNodeID() {
-// return workflowNodeID;
-// }
-//
-// public void setWorkflowNodeID(String workflowNodeID) {
-// this.workflowNodeID = workflowNodeID;
-// }
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/452419f1/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/HPCMonitorID.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/HPCMonitorID.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/HPCMonitorID.java
index cc6ab30..9439a28 100644
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/HPCMonitorID.java
+++ b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/HPCMonitorID.java
@@ -35,41 +35,18 @@ import java.util.Map;
public class HPCMonitorID extends MonitorID {
private final static Logger logger = LoggerFactory.getLogger(HPCMonitorID.class);
- private String userName;
-
- private Timestamp jobStartedTime;
-
- private Timestamp lastMonitored;
-
- private HostDescription host;
private AuthenticationInfo authenticationInfo = null;
- private Map<String, Object> parameters;
-
- private String experimentID;
-
- private String workflowNodeID;
-
- private String taskID;
-
- private String jobID;
-
- private int failedCount = 0;
-
- private JobState state;
-
- private JobExecutionContext jobExecutionContext;
-
- public HPCMonitorID(HostDescription host, String jobID,String taskID, String workflowNodeID, String experimentID, String userName) {
- super(host,jobID,taskID,workflowNodeID,experimentID,userName);
- this.host = host;
- this.jobStartedTime = new Timestamp((new Date()).getTime());
- this.userName = userName;
- this.jobID = jobID;
- this.taskID = taskID;
- this.experimentID = experimentID;
- this.workflowNodeID = workflowNodeID;
+ public HPCMonitorID(HostDescription host, String jobID, String taskID, String workflowNodeID, String experimentID, String userName) {
+ super(host, jobID, taskID, workflowNodeID, experimentID, userName);
+ setHost(host);
+ setJobStartedTime(new Timestamp((new Date()).getTime()));
+ setUserName(userName);
+ setJobID(jobID);
+ setTaskID(taskID);
+ setExperimentID(experimentID);
+ setWorkflowNodeID(workflowNodeID);
}
public HPCMonitorID(AuthenticationInfo authenticationInfo, JobExecutionContext jobExecutionContext) {
@@ -77,60 +54,21 @@ public class HPCMonitorID extends MonitorID {
this.authenticationInfo = authenticationInfo;
}
- public HPCMonitorID(HostDescription host, String jobID,String taskID, String workflowNodeID, String experimentID, String userName,AuthenticationInfo authenticationInfo) {
- this.host = host;
- this.jobStartedTime = new Timestamp((new Date()).getTime());
+ public HPCMonitorID(HostDescription host, String jobID, String taskID, String workflowNodeID, String experimentID, String userName, AuthenticationInfo authenticationInfo) {
+ setHost(host);
+ setJobStartedTime(new Timestamp((new Date()).getTime()));
this.authenticationInfo = authenticationInfo;
- this.userName = userName;
// if we give myproxyauthenticationInfo, so we try to use myproxy user as the user
- if(this.authenticationInfo != null){
- if(this.authenticationInfo instanceof MyProxyAuthenticationInfo){
- this.userName = ((MyProxyAuthenticationInfo)this.authenticationInfo).getUserName();
+ if (this.authenticationInfo != null) {
+ if (this.authenticationInfo instanceof MyProxyAuthenticationInfo) {
+ setUserName(((MyProxyAuthenticationInfo) this.authenticationInfo).getUserName());
}
}
- this.workflowNodeID = workflowNodeID;
- this.jobID = jobID;
- this.taskID = taskID;
- this.experimentID = experimentID;
- }
- public HostDescription getHost() {
- return host;
- }
-
- public void setHost(HostDescription host) {
- this.host = host;
- }
-
- public Timestamp getLastMonitored() {
- return lastMonitored;
- }
-
- public void setLastMonitored(Timestamp lastMonitored) {
- this.lastMonitored = lastMonitored;
- }
-
- public String getUserName() {
- return userName;
- }
-
- public void setUserName(String userName) {
- this.userName = userName;
- }
-
- public String getJobID() {
- return jobID;
- }
-
- public void setJobID(String jobID) {
- this.jobID = jobID;
- }
-
- public Timestamp getJobStartedTime() {
- return jobStartedTime;
- }
-
- public void setJobStartedTime(Timestamp jobStartedTime) {
- this.jobStartedTime = jobStartedTime;
+ setUserName(userName);
+ setJobID(jobID);
+ setTaskID(taskID);
+ setExperimentID(experimentID);
+ setWorkflowNodeID(workflowNodeID);
}
public AuthenticationInfo getAuthenticationInfo() {
@@ -140,102 +78,4 @@ public class HPCMonitorID extends MonitorID {
public void setAuthenticationInfo(AuthenticationInfo authenticationInfo) {
this.authenticationInfo = authenticationInfo;
}
-
- public void addParameter(String key,Object value) {
- this.parameters.put(key, value);
- }
-
- public Object getParameter(String key) {
- return this.parameters.get(key);
- }
-
- public Map<String, Object> getParameters() {
- return parameters;
- }
-
- public void setParameters(Map<String, Object> parameters) {
- this.parameters = parameters;
- }
-
- public String getExperimentID() {
- return experimentID;
- }
-
- public void setExperimentID(String experimentID) {
- this.experimentID = experimentID;
- }
-
- public String getTaskID() {
- return taskID;
- }
-
- public void setTaskID(String taskID) {
- this.taskID = taskID;
- }
-
- public int getFailedCount() {
- return failedCount;
- }
-
- public void setFailedCount(int failedCount) {
- this.failedCount = failedCount;
- }
-
- public JobState getStatus() {
- return state;
- }
-
- public void setStatus(JobState status) {
- // this logic is going to be useful for fast finishing jobs
- // because in some machines job state vanishes quicckly when the job is done
- // during that case job state comes as unknown.so we handle it here.
- if (this.state != null && status.equals(JobState.UNKNOWN)) {
- if (getFailedCount() > 2) {
- switch (this.state) {
- case ACTIVE:
- this.state = JobState.COMPLETE;
- break;
- case QUEUED:
- this.state = JobState.COMPLETE;
- 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 {
- // normal scenario
- this.state = status;
- }
- }
-
- public String getWorkflowNodeID() {
- return workflowNodeID;
- }
-
- public void setWorkflowNodeID(String workflowNodeID) {
- this.workflowNodeID = workflowNodeID;
- }
-
- public JobExecutionContext getJobExecutionContext() {
- return jobExecutionContext;
- }
-
- public void setJobExecutionContext(JobExecutionContext jobExecutionContext) {
- this.jobExecutionContext = jobExecutionContext;
- }
-
- // public String getWorkflowNodeID() {
-// return workflowNodeID;
-// }
-//
-// public void setWorkflowNodeID(String workflowNodeID) {
-// this.workflowNodeID = workflowNodeID;
-// }
-
}