hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r883185 - in /hadoop/hbase/branches/0.20: CHANGES.txt src/java/org/apache/hadoop/hbase/client/HConnectionManager.java
Date Sun, 22 Nov 2009 23:30:10 GMT
Author: stack
Date: Sun Nov 22 23:30:09 2009
New Revision: 883185

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

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

Modified: hadoop/hbase/branches/0.20/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/CHANGES.txt?rev=883185&r1=883184&r2=883185&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/CHANGES.txt (original)
+++ hadoop/hbase/branches/0.20/CHANGES.txt Sun Nov 22 23:30:09 2009
@@ -4,6 +4,8 @@
   INCOMPATIBLE CHANGES
 
   BUG FIXES
+   HBASE-1999 When HTable goes away, close zk session in shutdown hook or
+              something...
 
   IMPROVEMENTS
 

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java?rev=883185&r1=883184&r2=883185&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java
(original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java
Sun Nov 22 23:30:09 2009
@@ -67,7 +67,18 @@
 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);
+        System.out.println("Shutdown hook -- remove");
+      }
+    });
+  }
+
   /*
    * Not instantiable.
    */



Mime
View raw message