hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anoopsamj...@apache.org
Subject hbase git commit: HBASE-18473 VC.listLabels() erroneously closes any connection.
Date Sun, 30 Jul 2017 10:20:53 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.2 670e9431d -> 79c8031eb


HBASE-18473 VC.listLabels() erroneously closes any connection.


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

Branch: refs/heads/branch-1.2
Commit: 79c8031ebf2d11214f60a8fd0bf32195cd44c273
Parents: 670e943
Author: anoopsamjohn <anoopsamjohn@gmail.com>
Authored: Sun Jul 30 15:50:31 2017 +0530
Committer: anoopsamjohn <anoopsamjohn@gmail.com>
Committed: Sun Jul 30 15:50:31 2017 +0530

----------------------------------------------------------------------
 .../hbase/security/visibility/VisibilityClient.java     | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/79c8031e/hbase-client/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityClient.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityClient.java
b/hbase-client/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityClient.java
index f8c7b0a..fd1a9d5 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityClient.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityClient.java
@@ -261,9 +261,7 @@ public class VisibilityClient {
    */
   public static ListLabelsResponse listLabels(Connection connection, final String regex)
       throws Throwable {
-    Table table = null;
-    try {
-      table = connection.getTable(LABELS_TABLE_NAME);
+    try (Table table = connection.getTable(LABELS_TABLE_NAME)) {
       Batch.Call<VisibilityLabelsService, ListLabelsResponse> callable =
           new Batch.Call<VisibilityLabelsService, ListLabelsResponse>() {
             ServerRpcController controller = new ServerRpcController();
@@ -291,14 +289,6 @@ public class VisibilityClient {
       return result.values().iterator().next(); // There will be exactly one region for labels
       // table and so one entry in result Map.
     }
-    finally {
-      if (table != null) {
-        table.close();
-      }
-      if (connection != null) {
-        connection.close();
-      }
-    }
   }
 
   /**


Mime
View raw message