public abstract class ScrollableHitSource
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ScrollableHitSource.BasicHit
An implementation of ScrollableHitSource.Hit that uses getters and setters.
|
static interface |
ScrollableHitSource.Hit
A document returned as part of the response.
|
static class |
ScrollableHitSource.Response
Response from each scroll batch.
|
static class |
ScrollableHitSource.SearchFailure
A failure during search.
|
Modifier and Type | Field and Description |
---|---|
protected BackoffPolicy |
backoffPolicy |
protected java.lang.Runnable |
countSearchRetry |
protected java.util.function.Consumer<java.lang.Exception> |
fail |
protected org.apache.logging.log4j.Logger |
logger |
protected ThreadPool |
threadPool |
Constructor and Description |
---|
ScrollableHitSource(org.apache.logging.log4j.Logger logger,
BackoffPolicy backoffPolicy,
ThreadPool threadPool,
java.lang.Runnable countSearchRetry,
java.util.function.Consumer<java.lang.Exception> fail) |
Modifier and Type | Method and Description |
---|---|
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.
|
protected abstract void |
clearScroll(java.lang.String scrollId,
java.lang.Runnable onCompletion)
Called to clear a scroll id.
|
void |
close(java.lang.Runnable onCompletion) |
protected abstract void |
doStart(java.util.function.Consumer<? super ScrollableHitSource.Response> onResponse) |
protected abstract void |
doStartNextScroll(java.lang.String scrollId,
TimeValue extraKeepAlive,
java.util.function.Consumer<? super ScrollableHitSource.Response> onResponse) |
void |
setScroll(java.lang.String scrollId)
Set the id of the last scroll.
|
void |
start(java.util.function.Consumer<ScrollableHitSource.Response> onResponse) |
void |
startNextScroll(TimeValue extraKeepAlive,
java.util.function.Consumer<ScrollableHitSource.Response> onResponse) |
protected final org.apache.logging.log4j.Logger logger
protected final BackoffPolicy backoffPolicy
protected final ThreadPool threadPool
protected final java.lang.Runnable countSearchRetry
protected final java.util.function.Consumer<java.lang.Exception> fail
public ScrollableHitSource(org.apache.logging.log4j.Logger logger, BackoffPolicy backoffPolicy, ThreadPool threadPool, java.lang.Runnable countSearchRetry, java.util.function.Consumer<java.lang.Exception> fail)
public final void start(java.util.function.Consumer<ScrollableHitSource.Response> onResponse)
protected abstract void doStart(java.util.function.Consumer<? super ScrollableHitSource.Response> onResponse)
public final void startNextScroll(TimeValue extraKeepAlive, java.util.function.Consumer<ScrollableHitSource.Response> onResponse)
protected abstract void doStartNextScroll(java.lang.String scrollId, TimeValue extraKeepAlive, java.util.function.Consumer<? super ScrollableHitSource.Response> onResponse)
public final void close(java.lang.Runnable onCompletion)
protected abstract void clearScroll(java.lang.String scrollId, java.lang.Runnable onCompletion)
scrollId
- the id to clearonCompletion
- implementers must call this after completing the clear whether they are
successful or notprotected abstract void cleanup(java.lang.Runnable onCompletion)
onCompletion
- implementers must call this after completing the cleanup whether they are
successful or notpublic final void setScroll(java.lang.String scrollId)