public abstract class AbstractAsyncBulkByScrollAction<Request extends org.elasticsearch.index.reindex.AbstractBulkByScrollRequest<Request>>
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 org.elasticsearch.action.DocWriteRequest<Self>>
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 org.elasticsearch.cluster.ClusterState |
clusterState |
protected org.apache.logging.log4j.Logger |
logger |
protected Request |
mainRequest
The request for this action.
|
protected org.elasticsearch.script.ScriptService |
scriptService |
protected org.elasticsearch.index.reindex.BulkByScrollTask |
task |
protected org.elasticsearch.threadpool.ThreadPool |
threadPool |
protected org.elasticsearch.index.reindex.WorkerBulkByScrollTaskState |
worker |
| Constructor and Description |
|---|
AbstractAsyncBulkByScrollAction(org.elasticsearch.index.reindex.BulkByScrollTask task,
org.apache.logging.log4j.Logger logger,
org.elasticsearch.client.ParentTaskAssigningClient client,
org.elasticsearch.threadpool.ThreadPool threadPool,
Request mainRequest,
org.elasticsearch.script.ScriptService scriptService,
org.elasticsearch.cluster.ClusterState clusterState,
org.elasticsearch.action.ActionListener<org.elasticsearch.index.reindex.BulkByScrollResponse> listener) |
AbstractAsyncBulkByScrollAction(org.elasticsearch.index.reindex.BulkByScrollTask task,
org.apache.logging.log4j.Logger logger,
org.elasticsearch.client.ParentTaskAssigningClient client,
org.elasticsearch.threadpool.ThreadPool threadPool,
Request mainRequest,
org.elasticsearch.script.ScriptService scriptService,
org.elasticsearch.cluster.ClusterState clusterState,
org.elasticsearch.action.ActionListener<org.elasticsearch.index.reindex.BulkByScrollResponse> listener,
org.elasticsearch.common.settings.Settings settings) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
accept(org.elasticsearch.index.reindex.ScrollableHitSource.Hit doc)
Used to accept or ignore a search hit.
|
protected abstract AbstractAsyncBulkByScrollAction.RequestWrapper<?> |
buildRequest(org.elasticsearch.index.reindex.ScrollableHitSource.Hit doc)
Build the
AbstractAsyncBulkByScrollAction.RequestWrapper for a single search hit. |
protected org.elasticsearch.index.reindex.BulkByScrollResponse |
buildResponse(org.elasticsearch.common.unit.TimeValue took,
java.util.List<org.elasticsearch.action.bulk.BulkItemResponse.Failure> indexingFailures,
java.util.List<org.elasticsearch.index.reindex.ScrollableHitSource.SearchFailure> searchFailures,
boolean timedOut)
Build the response for reindex actions.
|
java.util.function.BiFunction<AbstractAsyncBulkByScrollAction.RequestWrapper<?>,org.elasticsearch.index.reindex.ScrollableHitSource.Hit,AbstractAsyncBulkByScrollAction.RequestWrapper<?>> |
buildScriptApplier()
Build the
BiFunction to apply to all AbstractAsyncBulkByScrollAction.RequestWrapper. |
protected org.elasticsearch.index.reindex.ScrollableHitSource |
buildScrollableResultSource(org.elasticsearch.action.bulk.BackoffPolicy backoffPolicy) |
protected AbstractAsyncBulkByScrollAction.RequestWrapper<?> |
copyMetadata(AbstractAsyncBulkByScrollAction.RequestWrapper<?> request,
org.elasticsearch.index.reindex.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<org.elasticsearch.action.bulk.BulkItemResponse.Failure> indexingFailures,
java.util.List<org.elasticsearch.index.reindex.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<org.elasticsearch.action.delete.DeleteRequest> |
wrap(org.elasticsearch.action.delete.DeleteRequest request)
Wraps a
DeleteRequest in a AbstractAsyncBulkByScrollAction.RequestWrapper |
static AbstractAsyncBulkByScrollAction.RequestWrapper<org.elasticsearch.action.index.IndexRequest> |
wrap(org.elasticsearch.action.index.IndexRequest request)
Wraps a
IndexRequest in a AbstractAsyncBulkByScrollAction.RequestWrapper |
protected final org.apache.logging.log4j.Logger logger
protected final org.elasticsearch.index.reindex.BulkByScrollTask task
protected final org.elasticsearch.index.reindex.WorkerBulkByScrollTaskState worker
protected final org.elasticsearch.threadpool.ThreadPool threadPool
protected final org.elasticsearch.script.ScriptService scriptService
protected final org.elasticsearch.cluster.ClusterState clusterState
public AbstractAsyncBulkByScrollAction(org.elasticsearch.index.reindex.BulkByScrollTask task,
org.apache.logging.log4j.Logger logger,
org.elasticsearch.client.ParentTaskAssigningClient client,
org.elasticsearch.threadpool.ThreadPool threadPool,
Request mainRequest,
org.elasticsearch.script.ScriptService scriptService,
org.elasticsearch.cluster.ClusterState clusterState,
org.elasticsearch.action.ActionListener<org.elasticsearch.index.reindex.BulkByScrollResponse> listener)
public AbstractAsyncBulkByScrollAction(org.elasticsearch.index.reindex.BulkByScrollTask task,
org.apache.logging.log4j.Logger logger,
org.elasticsearch.client.ParentTaskAssigningClient client,
org.elasticsearch.threadpool.ThreadPool threadPool,
Request mainRequest,
org.elasticsearch.script.ScriptService scriptService,
org.elasticsearch.cluster.ClusterState clusterState,
org.elasticsearch.action.ActionListener<org.elasticsearch.index.reindex.BulkByScrollResponse> listener,
org.elasticsearch.common.settings.Settings settings)
public java.util.function.BiFunction<AbstractAsyncBulkByScrollAction.RequestWrapper<?>,org.elasticsearch.index.reindex.ScrollableHitSource.Hit,AbstractAsyncBulkByScrollAction.RequestWrapper<?>> buildScriptApplier()
BiFunction to apply to all AbstractAsyncBulkByScrollAction.RequestWrapper.
Public for testings....protected abstract boolean needsSourceDocumentVersions()
protected abstract AbstractAsyncBulkByScrollAction.RequestWrapper<?> buildRequest(org.elasticsearch.index.reindex.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, org.elasticsearch.index.reindex.ScrollableHitSource.Hit doc)
protected void copyRouting(AbstractAsyncBulkByScrollAction.RequestWrapper<?> request, java.lang.String routing)
protected boolean accept(org.elasticsearch.index.reindex.ScrollableHitSource.Hit doc)
protected org.elasticsearch.index.reindex.ScrollableHitSource buildScrollableResultSource(org.elasticsearch.action.bulk.BackoffPolicy backoffPolicy)
protected org.elasticsearch.index.reindex.BulkByScrollResponse buildResponse(org.elasticsearch.common.unit.TimeValue took,
java.util.List<org.elasticsearch.action.bulk.BulkItemResponse.Failure> indexingFailures,
java.util.List<org.elasticsearch.index.reindex.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<org.elasticsearch.action.bulk.BulkItemResponse.Failure> indexingFailures,
java.util.List<org.elasticsearch.index.reindex.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<org.elasticsearch.action.index.IndexRequest> wrap(org.elasticsearch.action.index.IndexRequest request)
IndexRequest in a AbstractAsyncBulkByScrollAction.RequestWrapperpublic static AbstractAsyncBulkByScrollAction.RequestWrapper<org.elasticsearch.action.delete.DeleteRequest> wrap(org.elasticsearch.action.delete.DeleteRequest request)
DeleteRequest in a AbstractAsyncBulkByScrollAction.RequestWrapper