Interface AdvancedScanResultConsumer.ScanController

All Known Implementing Classes:
AsyncScanSingleRegionRpcRetryingCaller.ScanControllerImpl
Enclosing interface:
AdvancedScanResultConsumer

@Public public static interface AdvancedScanResultConsumer.ScanController
Used to suspend or stop a scan, or get a scan cursor if available.

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.

  • Method Details

    • suspend

      Suspend the scan.

      This means we will stop fetching data in background, i.e., will not call onNext any more before you resume the scan.

      Returns:
      A resumer used to resume the scan later.
    • terminate

      void terminate()
      Terminate the scan.

      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.

    • cursor

      Get the scan cursor if available.
      Returns:
      The scan cursor.