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 #1087: Add Oracle count functionality
Date Sun, 01 Mar 2020 01:24:18 GMT
jkosh44 commented on a change in pull request #1087: Add Oracle count functionality
URL: https://github.com/apache/fluo/pull/1087#discussion_r386060512
 
 

 ##########
 File path: modules/core/src/main/java/org/apache/fluo/core/client/FluoAdminImpl.java
 ##########
 @@ -516,6 +516,22 @@ public boolean oracleExists() {
     return oracleExists(getAppCurator());
   }
 
+  public static int numOracles(CuratorFramework curator) {
+    int numOracles = 0;
+    if (oracleExists(curator)) {
+      try {
+        numOracles += curator.getChildren().forPath(ZookeeperPath.ORACLE_SERVER).size();
 
 Review comment:
   This might not actually be the best idea because it relies on the Curator LeaderLatch implementation.
   The docs seem to advise against using the paths given to Curator Recipes: https://cwiki.apache.org/confluence/display/CURATOR/TN7
   
   Another possible option could be maintaining some count in zookeeper that is incremented
and decremented when the oracle starts and stops 

----------------------------------------------------------------
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