HBASE-25016 addendum: should also close the Table which is returned by calling getMetaHTable

Closes #2393

Signed-off-by: Viraj Jasani <vjasani@apache.org>
This commit is contained in:
niuyulin 2020-09-14 12:38:01 +05:30 committed by Viraj Jasani
parent 67233dcb42
commit 79eee6affc
No known key found for this signature in database
GPG Key ID: B3D6C0B41C8ADFD5
1 changed files with 2 additions and 1 deletions

View File

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