@@ -220,11 +220,14 @@ protected Scan prepareDataTableScan(Collection<byte[]> dataRowKeys,
220
220
protected boolean scanIndexTableRows (List <Cell > result ,
221
221
final long startTime ,
222
222
final byte [] actualStartKey ,
223
- final int offset ) throws IOException {
223
+ final int offset ,
224
+ ScannerContext scannerContext ) throws IOException {
224
225
boolean hasMore = false ;
225
226
if (actualStartKey != null ) {
226
227
do {
227
- hasMore = innerScanner .nextRaw (result );
228
+ hasMore = scannerContext != null
229
+ ? innerScanner .nextRaw (result , scannerContext )
230
+ : innerScanner .nextRaw (result );
228
231
if (result .isEmpty ()) {
229
232
return hasMore ;
230
233
}
@@ -249,7 +252,9 @@ protected boolean scanIndexTableRows(List<Cell> result,
249
252
do {
250
253
List <Cell > row = new ArrayList <Cell >();
251
254
if (result .isEmpty ()) {
252
- hasMore = innerScanner .nextRaw (row );
255
+ hasMore = scannerContext != null
256
+ ? innerScanner .nextRaw (row , scannerContext )
257
+ : innerScanner .nextRaw (row );
253
258
} else {
254
259
row .addAll (result );
255
260
result .clear ();
@@ -289,8 +294,9 @@ protected boolean scanIndexTableRows(List<Cell> result,
289
294
}
290
295
291
296
protected boolean scanIndexTableRows (List <Cell > result ,
292
- final long startTime ) throws IOException {
293
- return scanIndexTableRows (result , startTime , null , 0 );
297
+ final long startTime ,
298
+ ScannerContext scannerContext ) throws IOException {
299
+ return scanIndexTableRows (result , startTime , null , 0 , scannerContext );
294
300
}
295
301
296
302
private boolean verifyIndexRowAndRepairIfNecessary (Result dataRow , byte [] indexRowKey ,
@@ -381,8 +387,8 @@ protected boolean getNextCoveredIndexRow(List<Cell> result) throws IOException {
381
387
}
382
388
}
383
389
384
- public boolean next (List <Cell > result , ScannerContext scannerContext ) throws IOException {
385
- return next (result );
390
+ public boolean next (List <Cell > result ) throws IOException {
391
+ return next (result , null );
386
392
}
387
393
388
394
/**
@@ -399,7 +405,7 @@ public boolean next(List<Cell> result, ScannerContext scannerContext) throws IOE
399
405
* @throws IOException
400
406
*/
401
407
@ Override
402
- public boolean next (List <Cell > result ) throws IOException {
408
+ public boolean next (List <Cell > result , ScannerContext scannerContext ) throws IOException {
403
409
long startTime = EnvironmentEdgeManager .currentTimeMillis ();
404
410
boolean hasMore ;
405
411
region .startRegionOperation ();
@@ -416,7 +422,7 @@ public boolean next(List<Cell> result) throws IOException {
416
422
state = State .SCANNING_INDEX ;
417
423
}
418
424
if (state == State .SCANNING_INDEX ) {
419
- hasMore = scanIndexTableRows (result , startTime );
425
+ hasMore = scanIndexTableRows (result , startTime , scannerContext );
420
426
if (isDummy (result )) {
421
427
updateDummyWithPrevRowKey (result , initStartRowKey , includeInitStartRowKey ,
422
428
scan );
0 commit comments