HBASE-9746 Addendum.

This commit is contained in:
Lars Hofhansl 2014-08-26 10:51:08 -07:00
parent aada70053b
commit e27a427f9b
1 changed files with 5 additions and 3 deletions

View File

@ -130,7 +130,7 @@ public class RecoverableZooKeeper {
/**
* Try to create a Zookeeper connection. Turns any exception encountered into a
* {@link KeeperException.OperationTimeoutException} so it can retried.
* KeeperException.OperationTimeoutException so it can retried.
* @return The created Zookeeper connection object
* @throws KeeperException
*/
@ -138,8 +138,8 @@ public class RecoverableZooKeeper {
if (this.zk == null) {
try {
this.zk = new ZooKeeper(quorumServers, sessionTimeout, watcher);
} catch (Exception uhe) {
LOG.warn("Unable to create ZooKeeper Connection", uhe);
} catch (IOException ex) {
LOG.warn("Unable to create ZooKeeper Connection", ex);
throw new KeeperException.OperationTimeoutException();
}
}
@ -152,6 +152,8 @@ public class RecoverableZooKeeper {
LOG.info("Closing dead ZooKeeper connection, session" +
" was: 0x"+Long.toHexString(zk.getSessionId()));
zk.close();
// reset the Zookeeper connection
zk = null;
}
checkZk();
LOG.info("Recreated a ZooKeeper, session" +