hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ecl...@apache.org
Subject [37/52] [abbrv] hbase git commit: HBASE-15606 Limit creating zk connection in HBaseAdmin#getCompactionState() only to case when 'hbase:meta' is checked.
Date Fri, 08 Apr 2016 19:32:29 GMT
HBASE-15606 Limit creating zk connection in HBaseAdmin#getCompactionState() only to case when
'hbase:meta' is checked.

Signed-off-by: stack <stack@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/d393603d
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/d393603d
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/d393603d

Branch: refs/heads/HBASE-14850
Commit: d393603dea23306cd3f18f6dbd1cf14561d45bd0
Parents: ac8cd37
Author: Samir Ahmic <samir@personal.com>
Authored: Thu Apr 7 21:52:51 2016 +0200
Committer: stack <stack@apache.org>
Committed: Thu Apr 7 14:25:49 2016 -0700

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hbase/client/HBaseAdmin.java   | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/d393603d/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
index aea86b9..a900abd 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
@@ -3017,12 +3017,12 @@ public class HBaseAdmin implements Admin {
         break;
       case NORMAL:
       default:
-        ZooKeeperWatcher zookeeper =
-                new ZooKeeperWatcher(conf, ZK_IDENTIFIER_PREFIX + connection.toString(),
-                        new ThrowableAbortable());
+        ZooKeeperWatcher zookeeper = null;
         try {
           List<Pair<HRegionInfo, ServerName>> pairs;
           if (TableName.META_TABLE_NAME.equals(tableName)) {
+            zookeeper = new ZooKeeperWatcher(conf, ZK_IDENTIFIER_PREFIX + connection.toString(),
+              new ThrowableAbortable());
             pairs = new MetaTableLocator().getMetaRegionsAndLocations(zookeeper);
           } else {
             pairs = MetaTableAccessor.getTableRegionsAndLocations(connection, tableName);
@@ -3074,7 +3074,9 @@ public class HBaseAdmin implements Admin {
         } catch (ServiceException se) {
           throw ProtobufUtil.getRemoteException(se);
         } finally {
-          zookeeper.close();
+          if (zookeeper != null) {
+            zookeeper.close();
+          }
         }
         break;
     }


Mime
View raw message