hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e...@apache.org
Subject svn commit: r1407287 - /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java
Date Thu, 08 Nov 2012 22:09:20 GMT
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;



Mime
View raw message