HBASE-16090 ResultScanner is not closed in SyncTable#finishRemainingHashRanges()

This commit is contained in:
tedyu 2016-06-23 07:28:35 -07:00
parent d66316fd80
commit 9cd097cfac
1 changed files with 10 additions and 3 deletions

View File

@ -655,9 +655,16 @@ public class SyncTable extends Configured implements Tool {
scan.setStopRow(nextSourceKey.copyBytes());
}
ResultScanner targetScanner = targetTable.getScanner(scan);
for (Result row : targetScanner) {
targetHasher.hashResult(row);
ResultScanner targetScanner = null;
try {
targetScanner = targetTable.getScanner(scan);
for (Result row : targetScanner) {
targetHasher.hashResult(row);
}
} finally {
if (targetScanner != null) {
targetScanner.close();
}
}
} // else current batch ends exactly at split end row