accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r1336400 - in /accumulo/trunk: ./ core/ server/ server/src/main/java/org/apache/accumulo/server/util/Initialize.java src/
Date Wed, 09 May 2012 21:09:42 GMT
Author: vines
Date: Wed May  9 21:09:41 2012
New Revision: 1336400

URL: http://svn.apache.org/viewvc?rev=1336400&view=rev
Log:
Merged ACCUMULO-459

Modified:
    accumulo/trunk/   (props changed)
    accumulo/trunk/core/   (props changed)
    accumulo/trunk/server/   (props changed)
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/Initialize.java
    accumulo/trunk/src/   (props changed)

Propchange: accumulo/trunk/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.4/src:r1336329-1336398
  Merged /accumulo/branches/1.4:r1336329-1336398

Propchange: accumulo/trunk/core/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.4/core:r1336329-1336398
  Merged /accumulo/branches/1.4/src/core:r1336329-1336398

Propchange: accumulo/trunk/server/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.4/server:r1336329-1336398
  Merged /accumulo/branches/1.4/src/server:r1336329-1336398

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/Initialize.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/Initialize.java?rev=1336400&r1=1336399&r2=1336400&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/Initialize.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/Initialize.java Wed
May  9 21:09:41 2012
@@ -115,6 +115,11 @@ public class Initialize {
     
     log.info("Accumulo data dir is " + ServerConstants.getBaseDir());
     log.info("Zookeeper server is " + ServerConfiguration.getSiteConfiguration().get(Property.INSTANCE_ZK_HOST));
+    log.info("Checking if Zookeeper is available. If this hangs, then you need to make sure
zookeeper is running");
+    if (!zookeeperAvailable()) {
+      log.fatal("Zookeeper needs to be up and running in order to init. Exiting ...");
+      return false;
+    }
     if (ServerConfiguration.getSiteConfiguration().get(Property.INSTANCE_SECRET).equals(Property.INSTANCE_SECRET.getDefaultValue()))
{
       ConsoleReader c = getConsoleReader();
       c.beep();
@@ -180,6 +185,20 @@ public class Initialize {
     return true;
   }
   
+  /**
+   * @return
+   */
+  private static boolean zookeeperAvailable() {
+    IZooReaderWriter zoo = ZooReaderWriter.getInstance();
+    try {
+      return zoo.exists("/");
+    } catch (KeeperException e) {
+      return false;
+    } catch (InterruptedException e) {
+      return false;
+    }
+  }
+
   private static void initFileSystem(FileSystem fs, Configuration conf, UUID uuid) throws
IOException {
     FileStatus fstat;
     

Propchange: accumulo/trunk/src/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.4/src:r1336329-1336398
  Merged /accumulo/branches/1.4/src/src:r1336329-1336398



Mime
View raw message