hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject svn commit: r1171734 - in /hbase/trunk: CHANGES.txt src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java
Date Fri, 16 Sep 2011 19:04:13 GMT
Author: tedyu
Date: Fri Sep 16 19:04:12 2011
New Revision: 1171734

URL: http://svn.apache.org/viewvc?rev=1171734&view=rev
Log:
HBASE-4417  HBaseAdmin.checkHBaseAvailable() doesn't close ZooKeeper connections
               (Stefan Seelmann)

Modified:
    hbase/trunk/CHANGES.txt
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
    hbase/trunk/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java

Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1171734&r1=1171733&r2=1171734&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Fri Sep 16 19:04:12 2011
@@ -275,6 +275,8 @@ Release 0.91.0 - Unreleased
    HBASE-4322  HBASE-4322 [hbck] Update checkIntegrity/checkRegionChain
                to present more accurate region split problem 
                (Jon Hseih)
+   HBASE-4417  HBaseAdmin.checkHBaseAvailable() doesn't close ZooKeeper connections
+               (Stefan Seelmann)
 
   IMPROVEMENTS
    HBASE-3290  Max Compaction Size (Nicolas Spiegelberg via Stack)  

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java?rev=1171734&r1=1171733&r2=1171734&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java Fri Sep 16 19:04:12
2011
@@ -1576,7 +1576,12 @@ public class HBaseAdmin implements Abort
   throws MasterNotRunningException, ZooKeeperConnectionException {
     Configuration copyOfConf = HBaseConfiguration.create(conf);
     copyOfConf.setInt("hbase.client.retries.number", 1);
-    new HBaseAdmin(copyOfConf);
+    HBaseAdmin admin = new HBaseAdmin(copyOfConf);
+    try {
+      admin.close();
+    } catch (IOException ioe) {
+      admin.LOG.info("Failed to close connection", ioe);
+    }
   }
 
   /**

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java?rev=1171734&r1=1171733&r2=1171734&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java Fri Sep 16 19:04:12
2011
@@ -1268,4 +1268,15 @@ public class TestAdmin {
     return regionServer;
   }
   
+  /**
+   * HBASE-4417 checkHBaseAvailable() doesn't close zk connections
+   */
+  @Test
+  public void testCheckHBaseAvailableClosesConnection() throws Exception {
+    Configuration conf = TEST_UTIL.getConfiguration();
+    for(int i=0; i<1000;i++) {
+      HBaseAdmin.checkHBaseAvailable(conf);
+    }
+  }
+  
 }



Mime
View raw message