Class ScrollableHitSource

Direct Known Subclasses:

public abstract class ScrollableHitSource extends Object
A scrollable source of results. Pumps data out into the passed onResponse consumer. Same data may come out several times in case of failures during searching (though not yet). Once the onResponse consumer is done, it should call AsyncResponse.isDone(time) to receive more data (only receives one response at a time).
  • Field Details

    • logger

      protected final org.apache.logging.log4j.Logger logger
    • backoffPolicy

      protected final BackoffPolicy backoffPolicy
    • threadPool

      protected final ThreadPool threadPool
    • countSearchRetry

      protected final Runnable countSearchRetry
    • fail

      protected final Consumer<Exception> fail
  • Constructor Details

  • Method Details

    • start

      public final void start()
    • startNextScroll

      public final void startNextScroll(TimeValue extraKeepAlive)
    • close

      public final void close(Runnable onCompletion)
    • doStart

      protected abstract void doStart(RejectAwareActionListener<ScrollableHitSource.Response> searchListener)
    • doStartNextScroll

      protected abstract void doStartNextScroll(String scrollId, TimeValue extraKeepAlive, RejectAwareActionListener<ScrollableHitSource.Response> searchListener)
    • clearScroll

      protected abstract void clearScroll(String scrollId, Runnable onCompletion)
      Called to clear a scroll id.
      scrollId - the id to clear
      onCompletion - implementers must call this after completing the clear whether they are successful or not
    • cleanup

      protected abstract void cleanup(Runnable onCompletion)
      Called after the process has been totally finished to clean up any resources the process needed like remote connections.
      onCompletion - implementers must call this after completing the cleanup whether they are successful or not
    • setScroll

      public final void setScroll(String scrollId)
      Set the id of the last scroll. Used for debugging.