airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject airavata git commit: more improvements to zk implementation
Date Wed, 29 Apr 2015 18:40:36 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 1e040e42b -> 6c06aaac6


more improvements to zk implementation


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

Branch: refs/heads/master
Commit: 6c06aaac6608855d108b53606d5c2388af04af79
Parents: 1e040e4
Author: Lahiru Gunathilake <glahiru@gmail.com>
Authored: Wed Apr 29 14:40:31 2015 -0400
Committer: Lahiru Gunathilake <glahiru@gmail.com>
Committed: Wed Apr 29 14:40:31 2015 -0400

----------------------------------------------------------------------
 .../client/samples/CreateLaunchExperiment.java      |  4 ++--
 .../airavata/gfac/server/GfacServerHandler.java     | 16 ++++++++--------
 .../airavata/gfac/core/cpi/BetterGfacImpl.java      | 16 ++++++++++++++--
 3 files changed, 24 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/6c06aaac/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
index a8d2653..1aa16f5 100644
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
@@ -166,9 +166,9 @@ public class CreateLaunchExperiment {
 //                final String expId = createExperimentForSSHHost(airavata);
 //                final String expId = createEchoExperimentForFSD(airavataClient);
 //                final String expId = createMPIExperimentForFSD(airavataClient);
-//               final String expId = createEchoExperimentForStampede(airavataClient);
+               final String expId = createEchoExperimentForStampede(airavataClient);
 //                final String expId = createEchoExperimentForTrestles(airavataClient);
-                final String expId = createExperimentEchoForLocalHost(airavataClient);
+//                final String expId = createExperimentEchoForLocalHost(airavataClient);
 //                final String expId = createExperimentWRFTrestles(airavataClient);
 //                final String expId = createExperimentForBR2(airavataClient);
 //                final String expId = createExperimentForBR2Amber(airavataClient);

http://git-wip-us.apache.org/repos/asf/airavata/blob/6c06aaac/modules/gfac/airavata-gfac-service/src/main/java/org/apache/airavata/gfac/server/GfacServerHandler.java
----------------------------------------------------------------------
diff --git a/modules/gfac/airavata-gfac-service/src/main/java/org/apache/airavata/gfac/server/GfacServerHandler.java
b/modules/gfac/airavata-gfac-service/src/main/java/org/apache/airavata/gfac/server/GfacServerHandler.java
index 799bff0..9b282db 100644
--- a/modules/gfac/airavata-gfac-service/src/main/java/org/apache/airavata/gfac/server/GfacServerHandler.java
+++ b/modules/gfac/airavata-gfac-service/src/main/java/org/apache/airavata/gfac/server/GfacServerHandler.java
@@ -192,14 +192,14 @@ public class GfacServerHandler implements GfacService.Iface, Watcher
{
                     mutex.notify();
                     break;
                 case Expired:case Disconnected:
-//                   logger.info("ZK Connection is "+ state.toString());
-//                    try {
-//                        zk = new ZooKeeper(AiravataZKUtils.getZKhostPort(), AiravataZKUtils.getZKTimeout(),
this);
-//                    } catch (IOException e) {
-//                        logger.error(e.getMessage(), e);
-//                    } catch (ApplicationSettingsException e) {
-//                        logger.error(e.getMessage(), e);
-//                    }
+                   logger.info("ZK Connection is "+ state.toString());
+                    try {
+                        zk = new ZooKeeper(AiravataZKUtils.getZKhostPort(), AiravataZKUtils.getZKTimeout(),
this);
+                    } catch (IOException e) {
+                        logger.error(e.getMessage(), e);
+                    } catch (ApplicationSettingsException e) {
+                        logger.error(e.getMessage(), e);
+                    }
 //                    synchronized (mutex) {
 //                        mutex.wait(5000);  // waiting for the syncConnected event
 //                    }

http://git-wip-us.apache.org/repos/asf/airavata/blob/6c06aaac/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
index 515b51d..fcb1394 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
@@ -966,6 +966,7 @@ public class BetterGfacImpl implements GFac,Watcher {
                     closeZK(jobExecutionContext);
                 }
                 jobExecutionContext.setZk(new ZooKeeper(AiravataZKUtils.getZKhostPort(),
AiravataZKUtils.getZKTimeout(), this));
+                zk = jobExecutionContext.getZk();
                 log.info("Waiting until zookeeper client connect to the server...");
                 synchronized (mutex) {
                     mutex.wait(5000);  // waiting for the syncConnected event
@@ -1005,7 +1006,7 @@ public class BetterGfacImpl implements GFac,Watcher {
                         Class<? extends GFacHandler> handlerClass;
                         GFacHandler handler;
                         try {
-                            GFacUtils.createPluginZnode(zk, jobExecutionContext, handlerClassName.getClassName());
+                            GFacUtils.createPluginZnode(jobExecutionContext.getZk(), jobExecutionContext,
handlerClassName.getClassName());
                             handlerClass = Class.forName(handlerClassName.getClassName().trim()).asSubclass(GFacHandler.class);
                             handler = handlerClass.newInstance();
                             handler.initProperties(handlerClassName.getProperties());
@@ -1148,6 +1149,7 @@ public class BetterGfacImpl implements GFac,Watcher {
         String experimentPath = null;
         try {
             jobExecutionContext.setZk(new ZooKeeper(AiravataZKUtils.getZKhostPort(), AiravataZKUtils.getZKTimeout(),
this));
+            zk = jobExecutionContext.getZk();
             log.info("Waiting for zookeeper to connect to the server");
             synchronized (mutex) {
                 mutex.wait(5000);  // waiting for the syncConnected event
@@ -1324,8 +1326,17 @@ public class BetterGfacImpl implements GFac,Watcher {
                     mutex.notify();
                     break;
                 case Expired:
+                    try {
+                        zk = new ZooKeeper(AiravataZKUtils.getZKhostPort(), AiravataZKUtils.getZKTimeout(),
this);
+                    } catch (IOException e) {
+                        log.error(e.getMessage(), e);
+                    } catch (ApplicationSettingsException e) {
+                        log.error(e.getMessage(), e);
+                    }
+//                    synchronized (mutex) {
+//                        mutex.wait(5000);  // waiting for the syncConnected event
+//                    }
                 case Disconnected:
-                    log.info("ZK Connection is " + state.toString());
 //                    try {
 //                        zk = new ZooKeeper(AiravataZKUtils.getZKhostPort(), AiravataZKUtils.getZKTimeout(),
this);
 //                    } catch (IOException e) {
@@ -1336,6 +1347,7 @@ public class BetterGfacImpl implements GFac,Watcher {
 //                    synchronized (mutex) {
 //                        mutex.wait(5000);  // waiting for the syncConnected event
 //                    }
+                    log.info("ZK Connection is " + state.toString());
             }
         }
     }


Mime
View raw message