HBASE-16090 ResultScanner is not closed in SyncTable#finishRemainingHashRanges()
This commit is contained in:
parent
339cb81747
commit
857ec2f448
|
@ -654,9 +654,16 @@ public class SyncTable extends Configured implements Tool {
|
||||||
scan.setStopRow(nextSourceKey.copyBytes());
|
scan.setStopRow(nextSourceKey.copyBytes());
|
||||||
}
|
}
|
||||||
|
|
||||||
ResultScanner targetScanner = targetTable.getScanner(scan);
|
ResultScanner targetScanner = null;
|
||||||
for (Result row : targetScanner) {
|
try {
|
||||||
targetHasher.hashResult(row);
|
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
|
} // else current batch ends exactly at split end row
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue