airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject git commit: fixing expired connection issue in pull monitoring
Date Mon, 25 Aug 2014 17:56:12 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 36d0b7620 -> acac1b01a


fixing expired connection issue in pull monitoring


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

Branch: refs/heads/master
Commit: acac1b01a6136ee198e9f6b305f58214c561d9f1
Parents: 36d0b76
Author: lahiru <lahiru@apache.org>
Authored: Mon Aug 25 23:25:48 2014 +0530
Committer: lahiru <lahiru@apache.org>
Committed: Mon Aug 25 23:25:48 2014 +0530

----------------------------------------------------------------------
 .../gfac/monitor/impl/pull/qstat/HPCPullMonitor.java        | 9 +++++++--
 .../gfac/monitor/impl/pull/qstat/ResourceConnection.java    | 5 +++++
 2 files changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/acac1b01/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/HPCPullMonitor.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/HPCPullMonitor.java
b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/HPCPullMonitor.java
index 4d9e4b6..93e1aa9 100644
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/HPCPullMonitor.java
+++ b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/HPCPullMonitor.java
@@ -160,8 +160,13 @@ public class HPCPullMonitor extends PullMonitor {
                     String hostName =  iHostMonitorData.getHost().getType().getHostAddress();
                     ResourceConnection connection = null;
                     if (connections.containsKey(hostName)) {
-                        logger.debug("We already have this connection so not going to create
one");
-                        connection = connections.get(hostName);
+                        if(!connections.get(hostName).isConnected()){
+                            connection = new ResourceConnection(iHostMonitorData,getAuthenticationInfo());
+                            connections.put(hostName, connection);
+                        }else{
+                            logger.debug("We already have this connection so not going to
create one");
+                            connection = connections.get(hostName);
+                        }
                     } else {
                         connection = new ResourceConnection(iHostMonitorData,getAuthenticationInfo());
                         connections.put(hostName, connection);

http://git-wip-us.apache.org/repos/asf/airavata/blob/acac1b01/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/ResourceConnection.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/ResourceConnection.java
b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/ResourceConnection.java
index ac5feb8..fc6e930 100644
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/ResourceConnection.java
+++ b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/ResourceConnection.java
@@ -97,6 +97,7 @@ public class ResourceConnection {
         String userName = cluster.getServerInfo().getUserName();
         //todo so currently we execute the qstat for each job but we can use user based monitoring
         //todo or we should concatenate all the commands and execute them in one go and parse
the response
+        //
         cluster.getJobStatuses(userName, treeMap);
         for (String key : treeMap.keySet()) {
             treeMap1.put(key, getStatusFromString(treeMap.get(key).toString()));
@@ -141,4 +142,8 @@ public class ResourceConnection {
     public void setCluster(PBSCluster cluster) {
         this.cluster = cluster;
     }
+
+    public boolean isConnected(){
+        this.cluster.getSession().isConnected();
+    }
 }


Mime
View raw message