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:18:05 UTC

[hbase] branch branch-2.3 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 branch-2.3
in repository https://gitbox.apache.org/repos/asf/hbase.git


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

commit d85ccb3af05f8036e4075799f893a7a7bbb9f358
Author: niuyulin <ny...@163.com>
AuthorDate: Mon Sep 14 12:38:01 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-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java
index 50f3666..486d5e7 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java
@@ -368,7 +368,8 @@ public class MetaTableAccessor {
       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();
     }
   }