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:23:43 +05:30 committed by Viraj Jasani
parent 0f00e1c7c7
commit dcba4930d4
No known key found for this signature in database
GPG Key ID: B3D6C0B41C8ADFD5
1 changed files with 2 additions and 1 deletions

View File

@ -249,7 +249,8 @@ public final class MetaTableAccessor {
new RowFilter(CompareOperator.EQUAL, 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();
}
}