java.lang.Object
org.elasticsearch.index.reindex.ScrollableHitSource
- Direct Known Subclasses:
- ClientScrollableHitSource
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).
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic interfacestatic classAn implementation of ScrollableHitSource.Hit that uses getters and setters.static interfaceA document returned as part of the response.static classResponse from each scroll batch.static classA failure during search.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final BackoffPolicyprotected final Runnableprotected final org.apache.logging.log4j.Loggerprotected final ThreadPool
- 
Constructor SummaryConstructorsConstructorDescriptionScrollableHitSource(org.apache.logging.log4j.Logger logger, BackoffPolicy backoffPolicy, ThreadPool threadPool, Runnable countSearchRetry, Consumer<ScrollableHitSource.AsyncResponse> onResponse, Consumer<Exception> fail) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected abstract voidCalled after the process has been totally finished to clean up any resources the process needed like remote connections.protected abstract voidclearScroll(String scrollId, Runnable onCompletion) Called to clear a scroll id.final voidprotected abstract voiddoStart(RejectAwareActionListener<ScrollableHitSource.Response> searchListener) protected abstract voiddoStartNextScroll(String scrollId, TimeValue extraKeepAlive, RejectAwareActionListener<ScrollableHitSource.Response> searchListener) final booleanfinal voidSet the id of the last scroll.final voidstart()final voidstartNextScroll(TimeValue extraKeepAlive) 
- 
Field Details- 
loggerprotected final org.apache.logging.log4j.Logger logger
- 
backoffPolicy
- 
threadPool
- 
countSearchRetry
- 
fail
 
- 
- 
Constructor Details- 
ScrollableHitSourcepublic ScrollableHitSource(org.apache.logging.log4j.Logger logger, BackoffPolicy backoffPolicy, ThreadPool threadPool, Runnable countSearchRetry, Consumer<ScrollableHitSource.AsyncResponse> onResponse, Consumer<Exception> fail) 
 
- 
- 
Method Details- 
startpublic final void start()
- 
startNextScroll
- 
close
- 
doStartprotected abstract void doStart(RejectAwareActionListener<ScrollableHitSource.Response> searchListener) 
- 
doStartNextScrollprotected abstract void doStartNextScroll(String scrollId, TimeValue extraKeepAlive, RejectAwareActionListener<ScrollableHitSource.Response> searchListener) 
- 
clearScrollCalled 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
 
- 
cleanupCalled 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
 
- 
setScrollSet the id of the last scroll. Used for debugging.
- 
hasScrollpublic final boolean hasScroll()
 
-