Skip to content

Commit

Permalink
HBASE-28357 MoveWithAck#isSuccessfulScan for Region movement should u…
Browse files Browse the repository at this point in the history
…se Region End Key for limiting scan to one region only. (#5677)

Signed-off-by: Viraj Jasani <[email protected]>
  • Loading branch information
mihir6692 authored Feb 13, 2024
1 parent 3e281bd commit e2ff158
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,9 @@ private static String getTimeDiffInSec(long startTime) {
* Tries to scan a row from passed region
*/
private void isSuccessfulScan(RegionInfo region) throws IOException {
Scan scan = new Scan().withStartRow(region.getStartKey()).setRaw(true).setOneRowLimit()
.setMaxResultSize(1L).setCaching(1).setFilter(new FirstKeyOnlyFilter()).setCacheBlocks(false);
Scan scan = new Scan().withStartRow(region.getStartKey()).withStopRow(region.getEndKey(), false)
.setRaw(true).setOneRowLimit().setMaxResultSize(1L).setCaching(1)
.setFilter(new FirstKeyOnlyFilter()).setCacheBlocks(false);
try (Table table = conn.getTable(region.getTable());
ResultScanner scanner = table.getScanner(scan)) {
scanner.next();
Expand Down

0 comments on commit e2ff158

Please sign in to comment.