HBASE-1999 When HTable goes away, close zk session in shutdown hook or something...

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@883189 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2009-11-22 23:36:00 +00:00
parent 969df0a469
commit 41bfe09a49
2 changed files with 13 additions and 1 deletions

View File

@ -114,6 +114,8 @@ Release 0.21.0 - Unreleased
HBASE-1979 MurmurHash does not yield the same results as the reference C++
implementation when size % 4 >= 2 (Olivier Gillet via Andrew
Purtell)
HBASE-1999 When HTable goes away, close zk session in shutdown hook or
something...
IMPROVEMENTS
HBASE-1760 Cleanup TODOs in HTable

View File

@ -67,7 +67,17 @@ import org.apache.zookeeper.Watcher.Event.KeeperState;
public class HConnectionManager implements HConstants {
private static final Delete [] DELETE_ARRAY_TYPE = new Delete[0];
private static final Put [] PUT_ARRAY_TYPE = new Put[0];
// Register a shutdown hook, one that cleans up RPC and closes zk sessions.
static {
Runtime.getRuntime().addShutdownHook(new Thread("HCM.shutdownHook") {
@Override
public void run() {
HConnectionManager.deleteAllConnections(true);
}
});
}
/*
* Not instantiable.
*/