Repository: hbase Updated Branches: refs/heads/HBASE-18426 d5c00c9c6 -> 0bacb03ab (forced update) refs/heads/branch-1.1-HBASE-18426 2c362a104 -> adb2752e8 (forced update) refs/heads/branch-1.2-HBASE-18426 67a2a4397 -> 6666aaee9 (forced update)
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/5c47cb5d Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/5c47cb5d Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/5c47cb5d Branch: refs/heads/HBASE-18426 Commit: 5c47cb5d491f78c00df0b09ed3899c9334c7fd85 Parents: 2d06a06 Author: anoopsamjohn <anoopsamj...@gmail.com> Authored: Sun Jul 30 14:49:38 2017 +0530 Committer: anoopsamjohn <anoopsamj...@gmail.com> Committed: Sun Jul 30 14:49:38 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/5c47cb5d/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 d99f454..dbcc13f 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 @@ -259,9 +259,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(); @@ -289,14 +287,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(); - } - } } /**