hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r883189 - in /hadoop/hbase/trunk: CHANGES.txt src/java/org/apache/hadoop/hbase/client/HConnectionManager.java
Date Sun, 22 Nov 2009 23:36:00 GMT
Author: stack
Date: Sun Nov 22 23:36:00 2009
New Revision: 883189

URL: http://svn.apache.org/viewvc?rev=883189&view=rev
Log:
HBASE-1999 When HTable goes away, close zk session in shutdown hook or something...

Modified:
    hadoop/hbase/trunk/CHANGES.txt
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java

Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=883189&r1=883188&r2=883189&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Sun Nov 22 23:36:00 2009
@@ -114,6 +114,8 @@
    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

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java?rev=883189&r1=883188&r2=883189&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java Sun
Nov 22 23:36:00 2009
@@ -67,7 +67,17 @@
 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.
    */



Mime
View raw message