airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ramin...@apache.org
Subject git commit: To retry output finding 3 times and handle multile output case.
Date Fri, 03 Oct 2014 17:55:15 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 1ef608cd6 -> cbfeb2c36


To retry output finding 3 times and handle multile output case.

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

Branch: refs/heads/master
Commit: cbfeb2c36d563743894402ffc4b0c870485f3b98
Parents: 1ef608c
Author: raminder <raminder@apache.org>
Authored: Fri Oct 3 13:54:53 2014 -0400
Committer: raminder <raminder@apache.org>
Committed: Fri Oct 3 13:54:53 2014 -0400

----------------------------------------------------------------------
 .../gfac/gsissh/handler/GSISSHOutputHandler.java   | 15 ++++++++++++---
 .../gfac/ssh/handler/SSHOutputHandler.java         | 17 +++++++++++++----
 2 files changed, 25 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/cbfeb2c3/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 dd2e5e6..b7e3097 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
@@ -213,8 +213,17 @@ public class GSISSHOutputHandler extends AbstractRecoverableHandler {
                 ActualParameter actualParameter = (ActualParameter) output.get(paramName);
                 if ("URI".equals(actualParameter.getType().getType().toString())) {
 
-                    List<String> outputList = cluster.listDirectory(app.getOutputDataDirectory());
-                    if (outputList.size() == 0 || outputList.get(0).isEmpty()) {
+                    List<String> outputList = null;
+                    int retry=3;
+                    while(retry>0){
+                    	 outputList = cluster.listDirectory(app.getOutputDataDirectory());
+                    	 if(outputList.size() > 0){
+                    		 break;
+                    	 }	
+                    	 retry--;
+                    	 Thread.sleep(2000);
+                    }
+                    if (outputList.size() == 0 || outputList.get(0).isEmpty() || outputList.size()
> 1) {
                         OutputUtils.fillOutputFromStdout(output, stdOutStr, stdErrStr, outputArray);
                         Set<String> strings = output.keySet();
                         outputArray.clear();
@@ -243,7 +252,7 @@ public class GSISSHOutputHandler extends AbstractRecoverableHandler {
                             }
                         }
                         break;
-                    } else {
+                    } else if(outputList.size() == 1) { //FIXME: this is ultrascan specific
                         String valueList = outputList.get(0);
                         String outputFile;
                         if (index < oldIndex) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/cbfeb2c3/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 dbbb388..328ad32 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
@@ -176,9 +176,18 @@ public class SSHOutputHandler extends AbstractHandler {
             for (String paramName : keys) {
                 ActualParameter actualParameter = (ActualParameter) output.get(paramName);
                 if ("URI".equals(actualParameter.getType().getType().toString())) {
-
-                    List<String> outputList = cluster.listDirectory(app.getOutputDataDirectory());
-                    if (outputList.size() == 0 || outputList.get(0).isEmpty()) {
+                    List<String> outputList = null;
+                    int retry=3;
+                    while(retry>0){
+                    	 outputList = cluster.listDirectory(app.getOutputDataDirectory());
+                    	 if(outputList.size() > 0){
+                    		 break;
+                    	 }	
+                    	 retry--;
+                    	 Thread.sleep(2000);
+                    }
+                  
+                    if (outputList.size() == 0 || outputList.get(0).isEmpty() || outputList.size()
> 0) {
                         OutputUtils.fillOutputFromStdout(output, stdOutStr, stdErrStr,outputArray);
                         Set<String> strings = output.keySet();
                         outputArray.clear();
@@ -200,7 +209,7 @@ public class SSHOutputHandler extends AbstractHandler {
                         }
                     
                         break;
-                    } else {
+                    } else if( outputList.size() == 0) {//FIXME: Ultrascan case
                         String valueList = outputList.get(0);
                         cluster.scpFrom(app.getOutputDataDirectory() + File.separator + valueList,
outputDataDir);
                         String outputPath = outputDataDir + File.separator + valueList;


Mime
View raw message