From 79eee6affc03839b749cad4955725fe6911388da Mon Sep 17 00:00:00 2001 From: niuyulin Date: Mon, 14 Sep 2020 12:38:01 +0530 Subject: [PATCH] HBASE-25016 addendum: should also close the Table which is returned by calling getMetaHTable Closes #2393 Signed-off-by: Viraj Jasani --- .../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 a9ade3592b9..7cf6bb13831 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(); } }