public abstract class AbstractAsyncBulkByScrollAction<Request extends AbstractBulkByScrollRequest<Request>>
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
AbstractAsyncBulkByScrollAction.DeleteRequestWrapper
|
static class |
AbstractAsyncBulkByScrollAction.IndexRequestWrapper
|
static class |
AbstractAsyncBulkByScrollAction.OpType |
static interface |
AbstractAsyncBulkByScrollAction.RequestWrapper<Self extends DocWriteRequest<?>>
Wrapper for the
IndexRequest or DeleteRequest that are used in this action class. |
class |
AbstractAsyncBulkByScrollAction.ScriptApplier
Apply a
Script to a AbstractAsyncBulkByScrollAction.RequestWrapper |
Modifier and Type | Field and Description |
---|---|
protected ClusterState |
clusterState |
protected org.apache.logging.log4j.Logger |
logger |
protected Request |
mainRequest
The request for this action.
|
protected ScriptService |
scriptService |
protected WorkingBulkByScrollTask |
task |
protected ThreadPool |
threadPool |
Constructor and Description |
---|
AbstractAsyncBulkByScrollAction(WorkingBulkByScrollTask task,
org.apache.logging.log4j.Logger logger,
ParentTaskAssigningClient client,
ThreadPool threadPool,
Request mainRequest,
ScriptService scriptService,
ClusterState clusterState,
ActionListener<BulkByScrollResponse> 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<ScrollableHitSource.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<BulkItemResponse.Failure> indexingFailures,
java.util.List<ScrollableHitSource.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<IndexRequest> |
wrap(IndexRequest request)
|
protected final org.apache.logging.log4j.Logger logger
protected final WorkingBulkByScrollTask task
protected final ThreadPool threadPool
protected final ScriptService scriptService
protected final ClusterState clusterState
protected final Request extends AbstractBulkByScrollRequest<Request> mainRequest
request
variables all representing child
requests of this mainRequest.public AbstractAsyncBulkByScrollAction(WorkingBulkByScrollTask task, org.apache.logging.log4j.Logger logger, ParentTaskAssigningClient client, ThreadPool threadPool, Request mainRequest, ScriptService scriptService, ClusterState clusterState, ActionListener<BulkByScrollResponse> 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<ScrollableHitSource.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<BulkItemResponse.Failure> indexingFailures, java.util.List<ScrollableHitSource.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)