HBASE-25016 Should close ResultScanner in MetaTableAccessor.scanByRegionEncodedName
Closes #2390 Signed-off-by: Viraj Jasani <vjasani@apache.org>
This commit is contained in:
parent
fe776306d0
commit
a393fc594c
|
@ -244,13 +244,14 @@ public final class MetaTableAccessor {
|
|||
* @throws IOException if any errors occur while querying META.
|
||||
*/
|
||||
public static Result scanByRegionEncodedName(Connection connection, String regionEncodedName)
|
||||
throws IOException {
|
||||
throws IOException {
|
||||
RowFilter rowFilter =
|
||||
new RowFilter(CompareOperator.EQUAL, new SubstringComparator(regionEncodedName));
|
||||
new RowFilter(CompareOperator.EQUAL, new SubstringComparator(regionEncodedName));
|
||||
Scan scan = getMetaScan(connection, 1);
|
||||
scan.setFilter(rowFilter);
|
||||
ResultScanner resultScanner = getMetaHTable(connection).getScanner(scan);
|
||||
return resultScanner.next();
|
||||
try (ResultScanner resultScanner = getMetaHTable(connection).getScanner(scan)) {
|
||||
return resultScanner.next();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue