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:17:47 UTC

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


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

commit 79eee6affc03839b749cad4955725fe6911388da
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 a9ade35..7cf6bb1 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
@@ -365,7 +365,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();
     }
   }