MINOR: Close ZKDatabase in EmbeddedZookeeper
And remove redundant call. Closing ZKDatabase is necessary to allow the data
directory to be deleted when running on Windows.
Reviewers: Ismael Juma
@@ -49,7 +49,7 @@ class EmbeddedZookeeper() extends Logging {
val port = zookeeper.getClientPort
def shutdown(): Unit = {
- CoreUtils.swallow(zookeeper.shutdown(), this)
+ // Also shuts down ZooKeeperServer
CoreUtils.swallow(factory.shutdown(), this)
def isDown(): Boolean = {
@@ -60,6 +60,7 @@ class EmbeddedZookeeper() extends Logging {
}
Iterator.continually(isDown()).exists(identity)
+ CoreUtils.swallow(zookeeper.getZKDatabase().close(), this)
Utils.delete(logDir)
Utils.delete(snapshotDir)
