airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject airavata git commit: fixing some fixmes
Date Thu, 17 Sep 2015 15:28:22 GMT
Repository: airavata
Updated Branches:
  refs/heads/master e2132b680 -> 303630d32


fixing some fixmes


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

Branch: refs/heads/master
Commit: 303630d32893bef5477312cd0eb554fea1be9746
Parents: e2132b6
Author: Chathuri Wimalasena <chathuri@apache.org>
Authored: Thu Sep 17 11:28:16 2015 -0400
Committer: Chathuri Wimalasena <chathuri@apache.org>
Committed: Thu Sep 17 11:28:16 2015 -0400

----------------------------------------------------------------------
 .../java/org/apache/airavata/gfac/impl/GFacEngineImpl.java   | 5 ++---
 .../airavata/gfac/impl/task/AdvancedSCPDataStageTask.java    | 1 -
 .../org/apache/airavata/gfac/impl/task/SCPDataStageTask.java | 8 +++++++-
 3 files changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/303630d3/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacEngineImpl.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacEngineImpl.java
b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacEngineImpl.java
index ff1ec8b..007678a 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacEngineImpl.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacEngineImpl.java
@@ -595,7 +595,7 @@ public class GFacEngineImpl implements GFacEngine {
 			}
 		}
 		if (jsInterface == null) {
-			// TODO: throw an exception.
+	        throw new GFacException("Job Submission interface cannot be empty at this point");
 		} else if (jsInterface.getJobSubmissionProtocol() == JobSubmissionProtocol.SSH) {
 			SSHJobSubmission sshJobSubmission = Factory.getDefaultAppCatalog().getComputeResource().getSSHJobSubmission
 					(jsInterface.getJobSubmissionInterfaceId());
@@ -612,13 +612,12 @@ public class GFacEngineImpl implements GFacEngine {
 			processCtx.setMonitorMode(sshJobSubmission.getMonitorMode()); // fixme - Move this to
populate process
 			resourceJobManager = sshJobSubmission.getResourceJobManager();
 		} else {
-			// TODO : throw an not supported jobsubmission protocol exception. we only support SSH
and LOCAL
 			throw new GFacException("Unsupported JobSubmissionProtocol - " + jsInterface.getJobSubmissionProtocol()
 					.name());
 		}
 
 		if (resourceJobManager == null) {
-			// TODO throw an exception
+			throw new GFacException("Resource Job Manager is empty.");
 		}
 		return resourceJobManager;
 	}

http://git-wip-us.apache.org/repos/asf/airavata/blob/303630d3/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/AdvancedSCPDataStageTask.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/AdvancedSCPDataStageTask.java
b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/AdvancedSCPDataStageTask.java
index f94a8ed..3220c86 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/AdvancedSCPDataStageTask.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/AdvancedSCPDataStageTask.java
@@ -285,7 +285,6 @@ public class AdvancedSCPDataStageTask implements Task{
 
 	@Override
 	public TaskStatus recover(TaskContext taskContext) {
-        // FIXME - Recover gives NPE s because of this
         TaskState state = taskContext.getTaskStatus().getState();
         if (state == TaskState.EXECUTING || state == TaskState.CREATED) {
             return execute(taskContext);

http://git-wip-us.apache.org/repos/asf/airavata/blob/303630d3/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/SCPDataStageTask.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/SCPDataStageTask.java
b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/SCPDataStageTask.java
index a653963..9ffa6f2 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/SCPDataStageTask.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/SCPDataStageTask.java
@@ -110,7 +110,13 @@ public class SCPDataStageTask implements Task {
 
 	@Override
 	public TaskStatus recover(TaskContext taskContext) {
-		return null;
+        TaskState state = taskContext.getTaskStatus().getState();
+        if (state == TaskState.EXECUTING || state == TaskState.CREATED) {
+            return execute(taskContext);
+        } else {
+            // files already transferred or failed
+            return taskContext.getTaskStatus();
+        }
 	}
 
 	@Override


Mime
View raw message