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(); } }