airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ramin...@apache.org
Subject git commit: Fixed naming the stdout/error with experimentid and date. AIRAVATA-1421
Date Mon, 01 Sep 2014 15:22:09 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 9e713abf2 -> 0cc27dfcb


Fixed naming the stdout/error with experimentid and date. AIRAVATA-1421

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

Branch: refs/heads/master
Commit: 0cc27dfcb4bc5a57291336ed33f740f03f50473c
Parents: 9e713ab
Author: raminder <raminder@apache.org>
Authored: Mon Sep 1 11:21:45 2014 -0400
Committer: raminder <raminder@apache.org>
Committed: Mon Sep 1 11:21:45 2014 -0400

----------------------------------------------------------------------
 .../apache/airavata/gfac/core/utils/GFacUtils.java    |  4 ++--
 .../gfac/gram/handler/GridFTPOutputHandler.java       |  2 +-
 .../gfac/gsissh/handler/GSISSHOutputHandler.java      |  6 +++---
 .../airavata/gfac/ssh/handler/SSHOutputHandler.java   | 14 +++++++-------
 4 files changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/0cc27dfc/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/GFacUtils.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/GFacUtils.java
b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/GFacUtils.java
index 6c364df..1582f62 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/GFacUtils.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/GFacUtils.java
@@ -140,11 +140,11 @@ public class GFacUtils {
 					.equals(appHost));
 	}
 
-	public static String createUniqueNameForService(String serviceName) {
+	public static String createUniqueNameWithDate(String name) {
 		String date = new Date().toString();
 		date = date.replaceAll(" ", "_");
 		date = date.replaceAll(":", "_");
-		return serviceName + "_" + date + "_" + UUID.randomUUID();
+		return name + "_" + date;
 	}
 
 	public static String createGsiftpURIAsString(String host, String localPath)

http://git-wip-us.apache.org/repos/asf/airavata/blob/0cc27dfc/modules/gfac/gfac-gram/src/main/java/org/apache/airavata/gfac/gram/handler/GridFTPOutputHandler.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-gram/src/main/java/org/apache/airavata/gfac/gram/handler/GridFTPOutputHandler.java
b/modules/gfac/gfac-gram/src/main/java/org/apache/airavata/gfac/gram/handler/GridFTPOutputHandler.java
index edc1b11..a424da0 100644
--- a/modules/gfac/gfac-gram/src/main/java/org/apache/airavata/gfac/gram/handler/GridFTPOutputHandler.java
+++ b/modules/gfac/gfac-gram/src/main/java/org/apache/airavata/gfac/gram/handler/GridFTPOutputHandler.java
@@ -132,7 +132,7 @@ public class GridFTPOutputHandler extends AbstractHandler {
                         logDir.mkdir();
                     }
 
-                    String timeStampedServiceName = GFacUtils.createUniqueNameForService(jobExecutionContext
+                    String timeStampedServiceName = GFacUtils.createUniqueNameWithDate(jobExecutionContext
                             .getServiceName());
                     File localStdOutFile = File.createTempFile(timeStampedServiceName, "stdout");
                     localStdErrFile = File.createTempFile(timeStampedServiceName, "stderr");

http://git-wip-us.apache.org/repos/asf/airavata/blob/0cc27dfc/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/handler/GSISSHOutputHandler.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/handler/GSISSHOutputHandler.java
b/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/handler/GSISSHOutputHandler.java
index 635d0a2..ee10187 100644
--- a/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/handler/GSISSHOutputHandler.java
+++ b/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/handler/GSISSHOutputHandler.java
@@ -140,7 +140,7 @@ public class GSISSHOutputHandler extends AbstractRecoverableHandler {
                 }
             }
 
-            String timeStampedServiceName = GFacUtils.createUniqueNameForService(jobExecutionContext.getServiceName());
+            String timeStampedExperimentID = GFacUtils.createUniqueNameWithDate(jobExecutionContext.getExperimentID());
 
             TaskDetails taskData = jobExecutionContext.getTaskData();
             String outputDataDir = null;
@@ -161,7 +161,7 @@ public class GSISSHOutputHandler extends AbstractRecoverableHandler {
                 localStdOutFile = new File(oldFiles.get(index));
                 data.append(oldFiles.get(index++)).append(",");
             } else {
-                localStdOutFile = new File(outputDataDir + File.separator + timeStampedServiceName
+ "stdout");
+                localStdOutFile = new File(outputDataDir + File.separator + timeStampedExperimentID
+ "stdout");
                 cluster.scpFrom(app.getStandardOutput(), localStdOutFile.getAbsolutePath());
                 Thread.sleep(1000);
                 StringBuffer temp = new StringBuffer(data.append(localStdOutFile.getAbsolutePath()).append(",").toString());
@@ -171,7 +171,7 @@ public class GSISSHOutputHandler extends AbstractRecoverableHandler {
                 localStdErrFile = new File(oldFiles.get(index));
                 data.append(oldFiles.get(index++)).append(",");
             } else {
-                localStdErrFile = new File(outputDataDir + File.separator + timeStampedServiceName
+ "stderr");
+                localStdErrFile = new File(outputDataDir + File.separator + timeStampedExperimentID
+ "stderr");
                 cluster.scpFrom(app.getStandardError(), localStdErrFile.getAbsolutePath());
                 Thread.sleep(1000);
                 StringBuffer temp = new StringBuffer(data.append(localStdErrFile.getAbsolutePath()).append(",").toString());

http://git-wip-us.apache.org/repos/asf/airavata/blob/0cc27dfc/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/handler/SSHOutputHandler.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/handler/SSHOutputHandler.java
b/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/handler/SSHOutputHandler.java
index 35ae508..37f6c5e 100644
--- a/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/handler/SSHOutputHandler.java
+++ b/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/handler/SSHOutputHandler.java
@@ -117,16 +117,16 @@ public class SSHOutputHandler extends AbstractHandler {
             }
 
             // Get the Stdouts and StdErrs
-            String timeStampedServiceName = GFacUtils.createUniqueNameForService(jobExecutionContext.getServiceName());
+            String timeStampedExperimentID = GFacUtils.createUniqueNameWithDate(jobExecutionContext.getExperimentID());
 
             TaskDetails taskData = jobExecutionContext.getTaskData();
             String outputDataDir = null;
             File localStdOutFile;
             File localStdErrFile;
-
-            if (taskData.getAdvancedOutputDataHandling() != null) {
-                outputDataDir = taskData.getAdvancedOutputDataHandling().getOutputDataDir();
-            }
+            //FIXME: AdvancedOutput is remote location and third party transfer should work
to make this work 
+//            if (taskData.getAdvancedOutputDataHandling() != null) {
+//                outputDataDir = taskData.getAdvancedOutputDataHandling().getOutputDataDir();
+//            }
             if (outputDataDir == null) {
                 outputDataDir = File.separator + "tmp";
             }
@@ -134,8 +134,8 @@ public class SSHOutputHandler extends AbstractHandler {
             (new File(outputDataDir)).mkdirs();
 
 
-            localStdOutFile = new File(outputDataDir + File.separator + timeStampedServiceName
+ "stdout");
-            localStdErrFile = new File(outputDataDir + File.separator + timeStampedServiceName
+ "stderr");
+            localStdOutFile = new File(outputDataDir + File.separator + timeStampedExperimentID
+ "stdout");
+            localStdErrFile = new File(outputDataDir + File.separator + timeStampedExperimentID
+ "stderr");
 //            cluster.makeDirectory(outputDataDir);
             cluster.scpFrom(app.getStandardOutput(), localStdOutFile.getAbsolutePath());
             Thread.sleep(1000);


Mime
View raw message