HBASE-25016 Should close ResultScanner in MetaTableAccessor.scanByRegionEncodedName

Closes #2390

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

View File

@ -365,8 +365,9 @@ public class MetaTableAccessor {
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();
}
}
/**