airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ramin...@apache.org
Subject git commit: passed the install path to get the command only
Date Thu, 14 Aug 2014 03:32:44 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 34e0b87e2 -> 538e37f0e


passed the install path to get the command only

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

Branch: refs/heads/master
Commit: 538e37f0efef020ed0d34c7519a1744798524ebd
Parents: 34e0b87
Author: raminder <raminder@apache.org>
Authored: Wed Aug 13 23:32:23 2014 -0400
Committer: raminder <raminder@apache.org>
Committed: Wed Aug 13 23:32:23 2014 -0400

----------------------------------------------------------------------
 .../gsi/ssh/api/job/JobManagerConfiguration.java  | 18 ++++++++++--------
 .../gsi/ssh/impl/GSISSHAbstractCluster.java       | 10 +++++-----
 .../airavata/gsi/ssh/impl/RawCommandInfo.java     |  4 ++--
 3 files changed, 17 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/538e37f0/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/JobManagerConfiguration.java
----------------------------------------------------------------------
diff --git a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/JobManagerConfiguration.java
b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/JobManagerConfiguration.java
index f31b6f5..f68ba29 100644
--- a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/JobManagerConfiguration.java
+++ b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/JobManagerConfiguration.java
@@ -17,24 +17,26 @@
  * specific language governing permissions and limitations
  * under the License.
  *
-*/
+ */
 package org.apache.airavata.gsi.ssh.api.job;
 
 import org.apache.airavata.gsi.ssh.impl.RawCommandInfo;
 
 public interface JobManagerConfiguration {
 
-    public RawCommandInfo getCancelCommand(String jobID);
+	public RawCommandInfo getCancelCommand(String jobID);
 
-    public String getJobDescriptionTemplateName();
+	public String getJobDescriptionTemplateName();
 
-    public RawCommandInfo getMonitorCommand(String jobID);
+	public RawCommandInfo getMonitorCommand(String jobID);
 
-    public RawCommandInfo getUserBasedMonitorCommand(String userName);
+	public RawCommandInfo getUserBasedMonitorCommand(String userName);
 
-    public String getScriptExtension();
+	public String getScriptExtension();
 
-     public RawCommandInfo getSubmitCommand(String workingDirectory,String pbsFilePath);
+	public RawCommandInfo getSubmitCommand(String workingDirectory, String pbsFilePath);
 
-    public OutputParser getParser();
+	public OutputParser getParser();
+	
+	public String getInstalledPath();
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/538e37f0/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/GSISSHAbstractCluster.java
----------------------------------------------------------------------
diff --git a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/GSISSHAbstractCluster.java
b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/GSISSHAbstractCluster.java
index cf65a7f..713d33d 100644
--- a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/GSISSHAbstractCluster.java
+++ b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/GSISSHAbstractCluster.java
@@ -222,7 +222,7 @@ public class GSISSHAbstractCluster implements Cluster {
 
         StandardOutReader stdOutReader = new StandardOutReader();
         CommandExecutor.executeCommand(rawCommandInfo, this.getSession(), stdOutReader);
-        String outputifAvailable = getOutputifAvailable(stdOutReader, "Error reading output
of job submission",rawCommandInfo.getBaseCommand());
+        String outputifAvailable = getOutputifAvailable(stdOutReader, "Error reading output
of job submission",rawCommandInfo.getBaseCommand(jobManagerConfiguration.getInstalledPath()));
         // this might not be the case for all teh resources, if so Cluster implementation
can override this method
         // because here after cancelling we try to get the job description and return it
back
         JobDescriptor jobById = this.getJobDescriptorById(jobID);
@@ -250,7 +250,7 @@ public class GSISSHAbstractCluster implements Cluster {
         //Check whether pbs submission is successful or not, if it failed throw and exception
in submitJob method
         // with the error thrown in qsub command
         //
-        String outputifAvailable = getOutputifAvailable(standardOutReader,"Error reading
output of job submission",rawCommandInfo.getBaseCommand());
+        String outputifAvailable = getOutputifAvailable(standardOutReader,"Error reading
output of job submission",rawCommandInfo.getBaseCommand(jobManagerConfiguration.getInstalledPath()));
         OutputParser outputParser = jobManagerConfiguration.getParser();
         return  outputParser.parse(outputifAvailable);
     }
@@ -315,7 +315,7 @@ public class GSISSHAbstractCluster implements Cluster {
         RawCommandInfo rawCommandInfo = jobManagerConfiguration.getMonitorCommand(jobID);
         StandardOutReader stdOutReader = new StandardOutReader();
         CommandExecutor.executeCommand(rawCommandInfo, this.getSession(), stdOutReader);
-        String result = getOutputifAvailable(stdOutReader, "Error getting job information
from the resource !",rawCommandInfo.getBaseCommand());
+        String result = getOutputifAvailable(stdOutReader, "Error getting job information
from the resource !",rawCommandInfo.getBaseCommand(jobManagerConfiguration.getInstalledPath()));
         JobDescriptor jobDescriptor = new JobDescriptor();
         jobManagerConfiguration.getParser().parse(jobDescriptor,result);
         return jobDescriptor;
@@ -325,7 +325,7 @@ public class GSISSHAbstractCluster implements Cluster {
         RawCommandInfo rawCommandInfo = jobManagerConfiguration.getMonitorCommand(jobID);
         StandardOutReader stdOutReader = new StandardOutReader();
         CommandExecutor.executeCommand(rawCommandInfo, this.getSession(), stdOutReader);
-        String result = getOutputifAvailable(stdOutReader, "Error getting job information
from the resource !", rawCommandInfo.getBaseCommand());
+        String result = getOutputifAvailable(stdOutReader, "Error getting job information
from the resource !", rawCommandInfo.getBaseCommand(jobManagerConfiguration.getInstalledPath()));
         return jobManagerConfiguration.getParser().parse(jobID, result);
     }
 
@@ -427,7 +427,7 @@ public class GSISSHAbstractCluster implements Cluster {
         RawCommandInfo rawCommandInfo = jobManagerConfiguration.getUserBasedMonitorCommand(userName);
         StandardOutReader stdOutReader = new StandardOutReader();
         CommandExecutor.executeCommand(rawCommandInfo, this.getSession(), stdOutReader);
-        String result = getOutputifAvailable(stdOutReader, "Error getting job information
from the resource !", rawCommandInfo.getBaseCommand());
+        String result = getOutputifAvailable(stdOutReader, "Error getting job information
from the resource !", rawCommandInfo.getBaseCommand(jobManagerConfiguration.getInstalledPath()));
         jobManagerConfiguration.getParser().parse(userName,jobIDs, result);
     }
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/538e37f0/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/RawCommandInfo.java
----------------------------------------------------------------------
diff --git a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/RawCommandInfo.java
b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/RawCommandInfo.java
index 7f68036..ac88fe7 100644
--- a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/RawCommandInfo.java
+++ b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/RawCommandInfo.java
@@ -51,8 +51,8 @@ public class RawCommandInfo implements CommandInfo {
     /*
      * To get command without the path and other parameters. This is required to read errors

      */
-    public String getBaseCommand() {
-        return rawCommand.substring(rawCommand.lastIndexOf("/")+1, rawCommand.indexOf(" "));
+    public String getBaseCommand(String installPath) {
+        return rawCommand.substring(rawCommand.lastIndexOf(installPath)+1, rawCommand.indexOf("
"));
     }
     
     public void setRawCommand(String rawCommand) {


Mime
View raw message