@InterfaceAudience.Public public static interface AdvancedScanResultConsumer.ScanController
Notice that, you should only call the suspend()
or terminate()
inside onNext
or onHeartbeat method. A IllegalStateException will be thrown if you call them at other places.
You can only call one of the suspend()
and terminate()
methods(of course you
are free to not call them both), and the methods are not reentrant. An IllegalStateException
will be thrown if you have already called one of the methods.
Modifier and Type | Method and Description |
---|---|
Optional<Cursor> |
cursor()
Get the scan cursor if available.
|
AdvancedScanResultConsumer.ScanResumer |
suspend()
Suspend the scan.
|
void |
terminate()
Terminate the scan.
|
AdvancedScanResultConsumer.ScanResumer suspend()
This means we will stop fetching data in background, i.e., will not call onNext any more before you resume the scan.
void terminate()
This is useful when you have got enough results and want to stop the scan in onNext method, or you want to stop the scan in onHeartbeat method because it has spent too many time.
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.