airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shame...@apache.org
Subject airavata git commit: Fixed output staging issue AIRAVATA-2290
Date Tue, 27 Dec 2016 16:14:58 GMT
Repository: airavata
Updated Branches:
  refs/heads/develop 7e141b098 -> 6a63e1860


Fixed output staging issue AIRAVATA-2290


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

Branch: refs/heads/develop
Commit: 6a63e1860091cd2f40960f9b8294a5594ad88a3c
Parents: 7e141b0
Author: Shameera Rathnayaka <shameerainfo@gmail.com>
Authored: Tue Dec 27 11:14:43 2016 -0500
Committer: Shameera Rathnayaka <shameerainfo@gmail.com>
Committed: Tue Dec 27 11:14:43 2016 -0500

----------------------------------------------------------------------
 .../airavata/gfac/impl/task/SCPDataStageTask.java   | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/6a63e186/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 a578fb0..8ab8ae2 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
@@ -37,8 +37,6 @@ import org.apache.airavata.gfac.core.context.TaskContext;
 import org.apache.airavata.gfac.core.task.Task;
 import org.apache.airavata.gfac.core.task.TaskException;
 import org.apache.airavata.gfac.impl.Factory;
-import org.apache.airavata.gfac.impl.SSHUtils;
-import org.apache.airavata.model.appcatalog.gatewayprofile.StoragePreference;
 import org.apache.airavata.model.appcatalog.storageresource.StorageResourceDescription;
 import org.apache.airavata.model.application.io.InputDataObjectType;
 import org.apache.airavata.model.application.io.OutputDataObjectType;
@@ -161,8 +159,7 @@ public class SCPDataStageTask implements Task {
                 inputDataStaging(taskContext, sshSession, sourceURI, destinationURI);
                 status.setReason("Successfully staged input data");
             } else if (processState == ProcessState.OUTPUT_DATA_STAGING) {
-                String targetPath = destinationURI.getPath().substring(0, destinationURI.getPath().lastIndexOf('/'));
-                SSHUtils.makeDirectory(targetPath, sshSession);
+                makeDir(taskContext, destinationURI);
                 // TODO - save updated subtask model with new destination
                 outputDataStaging(taskContext, sshSession, sourceURI, destinationURI);
                 status.setReason("Successfully staged output data");
@@ -224,7 +221,7 @@ public class SCPDataStageTask implements Task {
             errorModel.setUserFriendlyMessage(msg);
             taskContext.getTaskModel().setTaskErrors(Arrays.asList(errorModel));
         } catch (GFacException e) {
-            String msg = "Failed update experiment and process inputs and outputs";
+            String msg = "Data staging failed";
             log.error(msg, e);
             status.setState(TaskState.FAILED);
             status.setReason(msg);
@@ -266,6 +263,15 @@ public class SCPDataStageTask implements Task {
 
     }
 
+    private void makeDir(TaskContext taskContext, URI pathURI) throws GFacException {
+        int endIndex = pathURI.getPath().lastIndexOf('/');
+        if (endIndex < 1) {
+            return;
+        }
+        String targetPath = pathURI.getPath().substring(0, endIndex);
+        taskContext.getParentProcessContext().getDataMovementRemoteCluster().makeDirectory(targetPath);
+    }
+
     @Override
     public TaskStatus recover(TaskContext taskContext) {
         TaskState state = taskContext.getTaskStatus().getState();


Mime
View raw message