Package org.elasticsearch.index.reindex
Class AbstractBulkByScrollRequest<Self extends AbstractBulkByScrollRequest<Self>>
java.lang.Object
org.elasticsearch.transport.TransportMessage
org.elasticsearch.transport.TransportRequest
org.elasticsearch.action.ActionRequest
org.elasticsearch.index.reindex.AbstractBulkByScrollRequest<Self>
- All Implemented Interfaces:
Writeable
,org.elasticsearch.core.RefCounted
,TaskAwareRequest
- Direct Known Subclasses:
AbstractBulkIndexByScrollRequest
,DeleteByQueryRequest
public abstract class AbstractBulkByScrollRequest<Self extends AbstractBulkByScrollRequest<Self>>
extends ActionRequest
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.transport.TransportRequest
TransportRequest.Empty
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
Modifier and TypeFieldDescriptionstatic int
static String
static int
static org.elasticsearch.core.TimeValue
static int
static int
Deprecated.please use MAX_DOCS_ALL_MATCHES instead. -
Constructor Summary
ConstructorDescriptionAbstractBulkByScrollRequest(SearchRequest searchRequest, boolean setDefaults)
Constructor for actual use. -
Method Summary
Modifier and TypeMethodDescriptionReturns the task object that should be used to keep track of the processing of the request.protected Self
doForSlice(Self request, TaskId slicingTask, int totalSlices)
Setup a clone of this request with the information needed to process a slice of it.abstract Self
forSlice(TaskId slicingTask, SearchRequest slice, int totalSlices)
Build a new request for a slice of the parent request.Returns optional description of the request to be displayed by the task managerint
Maximum number of processed documents.int
Total number of retries attempted for rejections.float
The throttle for this request in sub-requests per second.org.elasticsearch.core.TimeValue
Initial delay after a rejection before retrying request.org.elasticsearch.core.TimeValue
Get scroll timeoutThe search request that matches the documents to process.boolean
Should this task store its result after it has finished?int
getSize()
Deprecated.please use getMaxDocs() instead.int
The number of slices this task should be divided into.org.elasticsearch.core.TimeValue
Timeout to wait for the shards on to be available for each bulk request?The number of shard copies that must be active before proceeding with the write.boolean
Whether or not version conflicts cause the action to abort.boolean
Call refresh on the indexes we've written to after the request ends?protected void
Append a short description of the search request to a StringBuilder.protected abstract Self
self()
`this` cast to Self.setAbortOnVersionConflict(boolean abortOnVersionConflict)
Set whether or not version conflicts cause the action to abort.void
setConflicts(String conflicts)
Sets abortOnVersionConflict based on REST-friendly names.setMaxDocs(int maxDocs)
Maximum number of processed documents.setMaxRetries(int maxRetries)
Set the total number of retries attempted for rejections.setRefresh(boolean refresh)
Call refresh on the indexes we've written to after the request ends?setRequestsPerSecond(float requestsPerSecond)
Set the throttle for this request in sub-requests per second.setRetryBackoffInitialTime(org.elasticsearch.core.TimeValue retryBackoffInitialTime)
Set the initial delay after a rejection before retrying request.setScroll(org.elasticsearch.core.TimeValue keepAlive)
Set scroll timeout forSearchRequest
setShouldStoreResult(boolean shouldStoreResult)
Should this task store its result after it has finished?setSize(int size)
Deprecated.please use setMaxDocs(int) instead.setSlices(int slices)
The number of slices this task should be divided into.setTimeout(String timeout)
Timeout to wait for the shards on to be available for each bulk request?setTimeout(org.elasticsearch.core.TimeValue timeout)
Timeout to wait for the shards on to be available for each bulk request?setWaitForActiveShards(int waitForActiveShards)
A shortcut forsetWaitForActiveShards(ActiveShardCount)
where the numerical shard count is passed in, instead of having to first callActiveShardCount.from(int)
to get the ActiveShardCount.setWaitForActiveShards(ActiveShardCount activeShardCount)
Sets the number of shard copies that must be active before proceeding with the write.validate()
void
writeTo(StreamOutput out)
Write this into the StreamOutput.Methods inherited from class org.elasticsearch.transport.TransportRequest
getParentTask, setParentTask, toString
Methods inherited from class org.elasticsearch.transport.TransportMessage
decRef, incRef, remoteAddress, remoteAddress, tryIncRef
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.elasticsearch.tasks.TaskAwareRequest
setParentTask
-
Field Details
-
MAX_DOCS_ALL_MATCHES
public static final int MAX_DOCS_ALL_MATCHES- See Also:
- Constant Field Values
-
SIZE_ALL_MATCHES
Deprecated.please use MAX_DOCS_ALL_MATCHES instead.- See Also:
- Constant Field Values
-
DEFAULT_SCROLL_TIMEOUT
public static final org.elasticsearch.core.TimeValue DEFAULT_SCROLL_TIMEOUT -
DEFAULT_SCROLL_SIZE
public static final int DEFAULT_SCROLL_SIZE- See Also:
- Constant Field Values
-
AUTO_SLICES
public static final int AUTO_SLICES- See Also:
- Constant Field Values
-
AUTO_SLICES_VALUE
- See Also:
- Constant Field Values
-
-
Constructor Details
-
AbstractBulkByScrollRequest
- Throws:
IOException
-
AbstractBulkByScrollRequest
Constructor for actual use.- Parameters:
searchRequest
- the search request to execute to get the documents to processsetDefaults
- should this request set the defaults on the search request? Usually set to true but leave it false to support request slicing
-
-
Method Details
-
self
`this` cast to Self. Used for building fluent methods without cast warnings. -
validate
- Specified by:
validate
in classActionRequest
-
getSize
Deprecated.please use getMaxDocs() instead.Maximum number of processed documents. Defaults to -1 meaning process all documents. -
setSize
Deprecated.please use setMaxDocs(int) instead.Maximum number of processed documents. Defaults to -1 meaning process all documents. -
getMaxDocs
public int getMaxDocs()Maximum number of processed documents. Defaults to -1 meaning process all documents. -
setMaxDocs
Maximum number of processed documents. Defaults to -1 meaning process all documents. -
isAbortOnVersionConflict
public boolean isAbortOnVersionConflict()Whether or not version conflicts cause the action to abort. -
setAbortOnVersionConflict
Set whether or not version conflicts cause the action to abort. -
setConflicts
Sets abortOnVersionConflict based on REST-friendly names. -
getSearchRequest
The search request that matches the documents to process. -
isRefresh
public boolean isRefresh()Call refresh on the indexes we've written to after the request ends? -
setRefresh
Call refresh on the indexes we've written to after the request ends? -
getTimeout
public org.elasticsearch.core.TimeValue getTimeout()Timeout to wait for the shards on to be available for each bulk request? -
setTimeout
Timeout to wait for the shards on to be available for each bulk request? -
setTimeout
Timeout to wait for the shards on to be available for each bulk request? -
getWaitForActiveShards
The number of shard copies that must be active before proceeding with the write. -
setWaitForActiveShards
Sets the number of shard copies that must be active before proceeding with the write. SeeReplicationRequest.waitForActiveShards(ActiveShardCount)
for details. -
setWaitForActiveShards
A shortcut forsetWaitForActiveShards(ActiveShardCount)
where the numerical shard count is passed in, instead of having to first callActiveShardCount.from(int)
to get the ActiveShardCount. -
getRetryBackoffInitialTime
public org.elasticsearch.core.TimeValue getRetryBackoffInitialTime()Initial delay after a rejection before retrying request. -
setRetryBackoffInitialTime
Set the initial delay after a rejection before retrying request. -
getMaxRetries
public int getMaxRetries()Total number of retries attempted for rejections. -
setMaxRetries
Set the total number of retries attempted for rejections. There is no way to ask for unlimited retries. -
getRequestsPerSecond
public float getRequestsPerSecond()The throttle for this request in sub-requests per second.Float.POSITIVE_INFINITY
means set no throttle and that is the default. Throttling is done between batches, as we start the next scroll requests. That way we can increase the scroll's timeout to make sure that it contains any time that we might wait. -
setRequestsPerSecond
Set the throttle for this request in sub-requests per second.Float.POSITIVE_INFINITY
means set no throttle and that is the default. Throttling is done between batches, as we start the next scroll requests. That way we can increase the scroll's timeout to make sure that it contains any time that we might wait. -
setShouldStoreResult
Should this task store its result after it has finished? -
getShouldStoreResult
public boolean getShouldStoreResult()Description copied from class:ActionRequest
Should this task store its result after it has finished?- Overrides:
getShouldStoreResult
in classActionRequest
-
setScroll
Set scroll timeout forSearchRequest
-
getScrollTime
public org.elasticsearch.core.TimeValue getScrollTime()Get scroll timeout -
setSlices
The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. A value of 0 is equivalent to the "auto" slices parameter of the Rest API. -
getSlices
public int getSlices()The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. -
forSlice
Build a new request for a slice of the parent request. -
doForSlice
Setup a clone of this request with the information needed to process a slice of it. -
createTask
public Task createTask(long id, String type, String action, TaskId parentTaskId, Map<String,String> headers)Description copied from interface:TaskAwareRequest
Returns the task object that should be used to keep track of the processing of the request. -
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Overrides:
writeTo
in classActionRequest
- Throws:
IOException
-
searchToString
Append a short description of the search request to a StringBuilder. Used to make toString. -
getDescription
Description copied from interface:TaskAwareRequest
Returns optional description of the request to be displayed by the task manager
-