Class ScrollableHitSource

  • Direct Known Subclasses:
    ClientScrollableHitSource

    public abstract class ScrollableHitSource
    extends java.lang.Object
    A scrollable source of results.
    • Field Detail

      • logger

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

        protected final ThreadPool threadPool
      • countSearchRetry

        protected final java.lang.Runnable countSearchRetry
      • fail

        protected final java.util.function.Consumer<java.lang.Exception> fail
    • Constructor Detail

      • ScrollableHitSource

        public ScrollableHitSource​(org.apache.logging.log4j.Logger logger,
                                   BackoffPolicy backoffPolicy,
                                   ThreadPool threadPool,
                                   java.lang.Runnable countSearchRetry,
                                   java.util.function.Consumer<java.lang.Exception> fail)
    • Method Detail

      • doStartNextScroll

        protected abstract void doStartNextScroll​(java.lang.String scrollId,
                                                  TimeValue extraKeepAlive,
                                                  java.util.function.Consumer<? super ScrollableHitSource.Response> onResponse)
      • close

        public final void close​(java.lang.Runnable onCompletion)
      • clearScroll

        protected abstract void clearScroll​(java.lang.String scrollId,
                                            java.lang.Runnable onCompletion)
        Called to clear a scroll id.
        Parameters:
        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​(java.lang.Runnable onCompletion)
        Called after the process has been totally finished to clean up any resources the process needed like remote connections.
        Parameters:
        onCompletion - implementers must call this after completing the cleanup whether they are successful or not
      • setScroll

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