fluo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [fluo] jkosh44 commented on a change in pull request #1088: Use LeaderLatch to determine if oracle exists
Date Sat, 07 Mar 2020 02:44:52 GMT
jkosh44 commented on a change in pull request #1088: Use LeaderLatch to determine if oracle
exists
URL: https://github.com/apache/fluo/pull/1088#discussion_r389220643
 
 

 ##########
 File path: modules/core/src/main/java/org/apache/fluo/core/client/FluoAdminImpl.java
 ##########
 @@ -505,30 +505,28 @@ private String getJarsFromClasspath() {
   }
 
   public static boolean oracleExists(CuratorFramework curator) {
-    try {
-      return curator.checkExists().forPath(ZookeeperPath.ORACLE_SERVER) != null
-          && !curator.getChildren().forPath(ZookeeperPath.ORACLE_SERVER).isEmpty();
-    } catch (Exception e) {
-      throw new RuntimeException(e);
-    }
+    return numOracles(curator) > 0;
   }
 
   public boolean oracleExists() {
     return oracleExists(getAppCurator());
   }
 
-  public int numOracles() {
-    CuratorFramework curator = getAppCurator();
-    if (oracleExists(curator)) {
-      try {
+  public static int numOracles(CuratorFramework curator) {
+    int numOracles = 0;
+    try {
+      if (curator.checkExists().forPath(ZookeeperPath.ORACLE_SERVER) != null) {
 
 Review comment:
   @keith-turner just opened #1089 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message