You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by vj...@apache.org on 2020/09/14 07:00:25 UTC

[hbase] branch master updated: HBASE-25016 addendum: should also close the Table which is returned by calling getMetaHTable

This is an automated email from the ASF dual-hosted git repository.

vjasani pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/master by this push:
     new dcba493  HBASE-25016 addendum: should also close the Table which is returned by calling getMetaHTable
dcba493 is described below

commit dcba4930d4691c70e6ff4b15c2ddfb2a8002d18d
Author: niuyulin <ny...@163.com>
AuthorDate: Mon Sep 14 12:23:43 2020 +0530

    HBASE-25016 addendum: should also close the Table which is returned by calling getMetaHTable
    
    Closes #2393
    
    Signed-off-by: Viraj Jasani <vj...@apache.org>
---
 .../src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java       | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hbase-balancer/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java b/hbase-balancer/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java
index 4b226d9..c7f7ec1 100644
--- a/hbase-balancer/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java
+++ b/hbase-balancer/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java
@@ -249,7 +249,8 @@ public final class MetaTableAccessor {
         new RowFilter(CompareOperator.EQUAL, new SubstringComparator(regionEncodedName));
     Scan scan = getMetaScan(connection, 1);
     scan.setFilter(rowFilter);
-    try (ResultScanner resultScanner = getMetaHTable(connection).getScanner(scan)) {
+    try (Table table = getMetaHTable(connection);
+        ResultScanner resultScanner = table.getScanner(scan)) {
       return resultScanner.next();
     }
   }