Package org.elasticsearch.index.reindex
Class ScrollableHitSource
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 Summary
Modifier and TypeClassDescriptionstatic interface
static class
An implementation of ScrollableHitSource.Hit that uses getters and setters.static interface
A document returned as part of the response.static class
Response from each scroll batch.static class
A failure during search. -
Field Summary
Modifier and TypeFieldDescriptionprotected BackoffPolicy
protected Runnable
protected org.apache.logging.log4j.Logger
protected ThreadPool
-
Constructor Summary
ConstructorDescriptionScrollableHitSource(org.apache.logging.log4j.Logger logger, BackoffPolicy backoffPolicy, ThreadPool threadPool, Runnable countSearchRetry, Consumer<ScrollableHitSource.AsyncResponse> onResponse, Consumer<Exception> fail)
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
Called after the process has been totally finished to clean up any resources the process needed like remote connections.protected abstract void
clearScroll(String scrollId, Runnable onCompletion)
Called to clear a scroll id.void
protected abstract void
doStart(RejectAwareActionListener<ScrollableHitSource.Response> searchListener)
protected abstract void
doStartNextScroll(String scrollId, org.elasticsearch.core.TimeValue extraKeepAlive, RejectAwareActionListener<ScrollableHitSource.Response> searchListener)
void
Set the id of the last scroll.void
start()
-
Field Details
-
logger
protected final org.apache.logging.log4j.Logger logger -
backoffPolicy
-
threadPool
-
countSearchRetry
-
fail
-
-
Constructor Details
-
ScrollableHitSource
public ScrollableHitSource(org.apache.logging.log4j.Logger logger, BackoffPolicy backoffPolicy, ThreadPool threadPool, Runnable countSearchRetry, Consumer<ScrollableHitSource.AsyncResponse> onResponse, Consumer<Exception> fail)
-
-
Method Details
-
start
public final void start() -
close
-
doStart
protected abstract void doStart(RejectAwareActionListener<ScrollableHitSource.Response> searchListener) -
doStartNextScroll
protected abstract void doStartNextScroll(String scrollId, org.elasticsearch.core.TimeValue extraKeepAlive, RejectAwareActionListener<ScrollableHitSource.Response> searchListener) -
clearScroll
Called to clear a scroll id.- Parameters:
scrollId
- the id to clearonCompletion
- implementers must call this after completing the clear whether they are successful or not
-
cleanup
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
Set the id of the last scroll. Used for debugging.
-