You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by en...@apache.org on 2012/11/08 23:09:20 UTC

svn commit: r1407287 - /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java

Author: enis
Date: Thu Nov  8 22:09:20 2012
New Revision: 1407287

URL: http://svn.apache.org/viewvc?rev=1407287&view=rev
Log:
HBASE-6820. [WINDOWS] MiniZookeeperCluster should ensure that ZKDatabase is closed upon shutdown()

Modified:
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java?rev=1407287&r1=1407286&r2=1407287&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java (original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java Thu Nov  8 22:09:20 2012
@@ -201,7 +201,9 @@ public class MiniZooKeeperCluster {
 
   private void recreateDir(File dir) throws IOException {
     if (dir.exists()) {
-      FileUtil.fullyDelete(dir);
+      if(!FileUtil.fullyDelete(dir)) {
+        throw new IOException("Could not delete zk base directory: " + dir);
+      }
     }
     try {
       dir.mkdirs();
@@ -217,6 +219,7 @@ public class MiniZooKeeperCluster {
     if (!started) {
       return;
     }
+
     // shut down all the zk servers
     for (int i = 0; i < standaloneServerFactoryList.size(); i++) {
       NIOServerCnxnFactory standaloneServerFactory =
@@ -228,6 +231,10 @@ public class MiniZooKeeperCluster {
         throw new IOException("Waiting for shutdown of standalone server");
       }
     }
+    for (ZooKeeperServer zkServer: zooKeeperServers) {
+      //explicitly close ZKDatabase since ZookeeperServer does not close them
+      zkServer.getZKDatabase().close();
+    }
 
     // clear everything
     started = false;