HBASE-6820. [WINDOWS] MiniZookeeperCluster should ensure that ZKDatabase is closed upon shutdown()
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1407287 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3b07b3fdc3
commit
85d0b8f3bc
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue