airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject [1/2] airavata git commit: fixing issue in widlcard output file transfer
Date Fri, 30 Jun 2017 17:22:20 GMT
Repository: airavata
Updated Branches:
  refs/heads/develop fa8924435 -> 867135d41


fixing issue in widlcard output file transfer


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

Branch: refs/heads/develop
Commit: 2e667f25bfc64b6b642e3217796747da7c02ea33
Parents: 51005a1
Author: scnakandala <supun.nakandala@gmail.com>
Authored: Fri Jun 30 13:21:20 2017 -0400
Committer: scnakandala <supun.nakandala@gmail.com>
Committed: Fri Jun 30 13:21:20 2017 -0400

----------------------------------------------------------------------
 .../apache/airavata/gfac/core/GFacUtils.java    |  6 -----
 .../gfac/impl/task/SCPDataStageTask.java        | 26 +++++++++++++++++++-
 2 files changed, 25 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/2e667f25/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
index 37cbea3..1bb9e6f 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
@@ -71,7 +71,6 @@ import java.net.URISyntaxException;
 import java.net.URL;
 import java.net.UnknownHostException;
 import java.nio.ByteBuffer;
-import java.nio.file.Paths;
 import java.security.SecureRandom;
 import java.util.*;
 import java.util.regex.Matcher;
@@ -967,11 +966,6 @@ public class GFacUtils {
 
                         ReplicaCatalog replicaCatalog = RegistryFactory.getReplicaCatalog();
                         String productUri = replicaCatalog.registerDataProduct(dataProductModel);
-
-                        if(expOutput.getName().contains("*")){
-                            String actualFileName = Paths.get(outputVal).getFileName().toString();
-                            expOutput.setName(actualFileName);
-                        }
                         expOutput.setValue(productUri);
                     }
                 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/2e667f25/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 dd7acaf..eb902a5 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
@@ -40,11 +40,16 @@ import org.apache.airavata.model.appcatalog.storageresource.StorageResourceDescr
 import org.apache.airavata.model.application.io.InputDataObjectType;
 import org.apache.airavata.model.application.io.OutputDataObjectType;
 import org.apache.airavata.model.commons.ErrorModel;
+import org.apache.airavata.model.experiment.ExperimentModel;
+import org.apache.airavata.model.process.ProcessModel;
 import org.apache.airavata.model.status.ProcessState;
 import org.apache.airavata.model.status.TaskState;
 import org.apache.airavata.model.status.TaskStatus;
 import org.apache.airavata.model.task.DataStagingTaskModel;
 import org.apache.airavata.model.task.TaskTypes;
+import org.apache.airavata.registry.cpi.ExperimentCatalog;
+import org.apache.airavata.registry.cpi.ExperimentCatalogModelType;
+import org.apache.airavata.registry.cpi.RegistryException;
 import org.apache.thrift.TException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -163,6 +168,15 @@ public class SCPDataStageTask implements Task {
                 String sourceParentPath = (new File(sourceURI.getPath())).getParentFile().getPath();
                 List<String> fileNames = taskContext.getParentProcessContext().getDataMovementRemoteCluster()
                         .getFileNameFromExtension(fileName, sourceParentPath, sshSession);
+
+                ExperimentCatalog experimentCatalog = processContext.getExperimentCatalog();
+
+                String experimentId = processContext.getExperimentId();
+                ExperimentModel experiment = (ExperimentModel)experimentCatalog.get(ExperimentCatalogModelType.EXPERIMENT,
experimentId);
+
+                String processId = processContext.getProcessId();
+                ProcessModel processModel = processContext.getProcessModel();
+
                 for(int i=0; i<fileNames.size(); i++){
                     String temp = fileNames.get(i);
                     if(temp != null && temp != ""){
@@ -176,6 +190,16 @@ public class SCPDataStageTask implements Task {
 
                     //Wildcard support is only enabled for output data staging
                     if (processState == ProcessState.OUTPUT_DATA_STAGING) {
+                        OutputDataObjectType outputDataObjectType = new OutputDataObjectType();
+                        outputDataObjectType.setName(fileName);
+                        experiment.addToExperimentOutputs(outputDataObjectType);
+                        processModel.addToProcessOutputs(outputDataObjectType);
+
+                        experimentCatalog.update(ExperimentCatalogModelType.EXPERIMENT, experiment,
experimentId);
+                        experimentCatalog.update(ExperimentCatalogModelType.PROCESS, processModel,
processId);
+
+                        taskContext.setProcessOutput(outputDataObjectType);
+
                         makeDir(taskContext, destinationURI);
                         // TODO - save updated subtask model with new destination
                         outputDataStaging(taskContext, sshSession, sourceURI, destinationURI);
@@ -254,7 +278,7 @@ public class SCPDataStageTask implements Task {
             errorModel.setActualErrorMessage(e.getMessage());
             errorModel.setUserFriendlyMessage(msg);
             taskContext.getTaskModel().setTaskErrors(Arrays.asList(errorModel));
-        } catch (GFacException e) {
+        } catch (RegistryException | GFacException e) {
             String msg = "Data staging failed";
             log.error(msg, e);
             status.setState(TaskState.FAILED);


Mime
View raw message