public abstract class AbstractAsyncBulkByScrollAction<Request extends <any>>
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractAsyncBulkByScrollAction.DeleteRequestWrapper
AbstractAsyncBulkByScrollAction.RequestWrapper for DeleteRequest |
static class |
AbstractAsyncBulkByScrollAction.IndexRequestWrapper
AbstractAsyncBulkByScrollAction.RequestWrapper for IndexRequest |
static class |
AbstractAsyncBulkByScrollAction.OpType |
static interface |
AbstractAsyncBulkByScrollAction.RequestWrapper<Self extends <any>>
Wrapper for the
DocWriteRequest that are used in this action class. |
static class |
AbstractAsyncBulkByScrollAction.ScriptApplier
Apply a
Script to a AbstractAsyncBulkByScrollAction.RequestWrapper |
| Modifier and Type | Field and Description |
|---|---|
protected ClusterState |
clusterState |
protected Logger |
logger |
protected Request |
mainRequest
The request for this action.
|
protected ScriptService |
scriptService |
protected BulkByScrollTask |
task |
protected ThreadPool |
threadPool |
protected WorkerBulkByScrollTaskState |
worker |
| Constructor and Description |
|---|
AbstractAsyncBulkByScrollAction(BulkByScrollTask task,
Logger logger,
ParentTaskAssigningClient client,
ThreadPool threadPool,
Request mainRequest,
ScriptService scriptService,
ClusterState clusterState,
<any> listener) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
accept(ScrollableHitSource.Hit doc)
Used to accept or ignore a search hit.
|
protected abstract AbstractAsyncBulkByScrollAction.RequestWrapper<?> |
buildRequest(ScrollableHitSource.Hit doc)
Build the
AbstractAsyncBulkByScrollAction.RequestWrapper for a single search hit. |
protected BulkByScrollResponse |
buildResponse(TimeValue took,
java.util.List<BulkItemResponse.Failure> indexingFailures,
java.util.List<SearchFailure> searchFailures,
boolean timedOut)
Build the response for reindex actions.
|
java.util.function.BiFunction<AbstractAsyncBulkByScrollAction.RequestWrapper<?>,ScrollableHitSource.Hit,AbstractAsyncBulkByScrollAction.RequestWrapper<?>> |
buildScriptApplier()
Build the
BiFunction to apply to all AbstractAsyncBulkByScrollAction.RequestWrapper. |
protected ScrollableHitSource |
buildScrollableResultSource(BackoffPolicy backoffPolicy) |
protected AbstractAsyncBulkByScrollAction.RequestWrapper<?> |
copyMetadata(AbstractAsyncBulkByScrollAction.RequestWrapper<?> request,
ScrollableHitSource.Hit doc)
Copies the metadata from a hit to the request.
|
protected void |
copyRouting(AbstractAsyncBulkByScrollAction.RequestWrapper<?> request,
java.lang.String routing)
Copy the routing from a search hit to the request.
|
protected void |
finishHim(java.lang.Exception failure)
Finish the request.
|
protected void |
finishHim(java.lang.Exception failure,
java.util.List<Failure> indexingFailures,
java.util.List<SearchFailure> searchFailures,
boolean timedOut)
Finish the request.
|
protected abstract boolean |
needsSourceDocumentVersions()
Does this operation need the versions of the source documents?
|
void |
start()
Start the action by firing the initial search request.
|
static AbstractAsyncBulkByScrollAction.RequestWrapper<DeleteRequest> |
wrap(DeleteRequest request)
Wraps a
DeleteRequest in a AbstractAsyncBulkByScrollAction.RequestWrapper |
static AbstractAsyncBulkByScrollAction.RequestWrapper<IndexRequest> |
wrap(IndexRequest request)
Wraps a
IndexRequest in a AbstractAsyncBulkByScrollAction.RequestWrapper |
protected final Logger logger
protected final BulkByScrollTask task
protected final WorkerBulkByScrollTaskState worker
protected final ThreadPool threadPool
protected final ScriptService scriptService
protected final ClusterState clusterState
protected final Request extends <any> mainRequest
request variables all representing child
requests of this mainRequest.public AbstractAsyncBulkByScrollAction(BulkByScrollTask task,
Logger logger,
ParentTaskAssigningClient client,
ThreadPool threadPool,
Request mainRequest,
ScriptService scriptService,
ClusterState clusterState,
<any> listener)
public java.util.function.BiFunction<AbstractAsyncBulkByScrollAction.RequestWrapper<?>,ScrollableHitSource.Hit,AbstractAsyncBulkByScrollAction.RequestWrapper<?>> buildScriptApplier()
BiFunction to apply to all AbstractAsyncBulkByScrollAction.RequestWrapper.
Public for testings....protected abstract boolean needsSourceDocumentVersions()
protected abstract AbstractAsyncBulkByScrollAction.RequestWrapper<?> buildRequest(ScrollableHitSource.Hit doc)
AbstractAsyncBulkByScrollAction.RequestWrapper for a single search hit. This shouldn't handle
metadata or scripting. That will be handled by copyMetadata and
apply functions that can be overridden.protected AbstractAsyncBulkByScrollAction.RequestWrapper<?> copyMetadata(AbstractAsyncBulkByScrollAction.RequestWrapper<?> request, ScrollableHitSource.Hit doc)
protected void copyRouting(AbstractAsyncBulkByScrollAction.RequestWrapper<?> request, java.lang.String routing)
protected boolean accept(ScrollableHitSource.Hit doc)
protected ScrollableHitSource buildScrollableResultSource(BackoffPolicy backoffPolicy)
protected BulkByScrollResponse buildResponse(TimeValue took,
java.util.List<BulkItemResponse.Failure> indexingFailures,
java.util.List<SearchFailure> searchFailures,
boolean timedOut)
public void start()
protected void finishHim(java.lang.Exception failure)
failure - if non null then the request failed catastrophically with this exceptionprotected void finishHim(java.lang.Exception failure,
java.util.List<Failure> indexingFailures,
java.util.List<SearchFailure> searchFailures,
boolean timedOut)
failure - if non null then the request failed catastrophically with this exceptionindexingFailures - any indexing failures accumulated during the requestsearchFailures - any search failures accumulated during the requesttimedOut - have any of the sub-requests timed out?public static AbstractAsyncBulkByScrollAction.RequestWrapper<IndexRequest> wrap(IndexRequest request)
IndexRequest in a AbstractAsyncBulkByScrollAction.RequestWrapperpublic static AbstractAsyncBulkByScrollAction.RequestWrapper<DeleteRequest> wrap(DeleteRequest request)
DeleteRequest in a AbstractAsyncBulkByScrollAction.RequestWrapper