Streamable
, Writeable
, TaskAwareRequest
AbstractBulkIndexByScrollRequest
, DeleteByQueryRequest
public abstract class AbstractBulkByScrollRequest<Self extends AbstractBulkByScrollRequest<Self>> extends ActionRequest
TransportRequest.Empty
Writeable.Reader<V>, Writeable.Writer<V>
Modifier and Type | Field | Description |
---|---|---|
static int |
AUTO_SLICES |
|
static java.lang.String |
AUTO_SLICES_VALUE |
|
static int |
SIZE_ALL_MATCHES |
Constructor | Description |
---|---|
AbstractBulkByScrollRequest() |
Constructor for deserialization.
|
AbstractBulkByScrollRequest(SearchRequest searchRequest,
boolean setDefaults) |
Constructor for actual use.
|
Modifier and Type | Method | Description |
---|---|---|
Task |
createTask(long id,
java.lang.String type,
java.lang.String action,
TaskId parentTaskId,
java.util.Map<java.lang.String,java.lang.String> headers) |
Returns 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.
|
java.lang.String |
getDescription() |
Returns optional description of the request to be displayed by the task manager
|
int |
getMaxRetries() |
Total number of retries attempted for rejections.
|
float |
getRequestsPerSecond() |
The throttle for this request in sub-requests per second.
|
TimeValue |
getRetryBackoffInitialTime() |
Initial delay after a rejection before retrying request.
|
TimeValue |
getScrollTime() |
Get scroll timeout
|
SearchRequest |
getSearchRequest() |
The search request that matches the documents to process.
|
boolean |
getShouldStoreResult() |
Should this task store its result after it has finished?
|
int |
getSize() |
Maximum number of processed documents.
|
int |
getSlices() |
The number of slices this task should be divided into.
|
TimeValue |
getTimeout() |
Timeout to wait for the shards on to be available for each bulk request?
|
ActiveShardCount |
getWaitForActiveShards() |
The number of shard copies that must be active before proceeding with the write.
|
boolean |
isAbortOnVersionConflict() |
Should version conflicts cause aborts? Defaults to false.
|
boolean |
isRefresh() |
Call refresh on the indexes we've written to after the request ends?
|
void |
readFrom(StreamInput in) |
Set this object's fields from a StreamInput.
|
protected void |
searchToString(java.lang.StringBuilder b) |
Append a short description of the search request to a StringBuilder.
|
protected abstract Self |
self() |
`this` cast to Self.
|
Self |
setAbortOnVersionConflict(boolean abortOnVersionConflict) |
Should version conflicts cause aborts? Defaults to false.
|
void |
setConflicts(java.lang.String conflicts) |
Sets abortOnVersionConflict based on REST-friendly names.
|
Self |
setMaxRetries(int maxRetries) |
Set the total number of retries attempted for rejections.
|
Self |
setRefresh(boolean refresh) |
Call refresh on the indexes we've written to after the request ends?
|
Self |
setRequestsPerSecond(float requestsPerSecond) |
Set the throttle for this request in sub-requests per second.
|
Self |
setRetryBackoffInitialTime(TimeValue retryBackoffInitialTime) |
Set the initial delay after a rejection before retrying request.
|
Self |
setScroll(TimeValue keepAlive) |
Set scroll timeout for
SearchRequest |
Self |
setShouldStoreResult(boolean shouldStoreResult) |
Should this task store its result after it has finished?
|
Self |
setSize(int size) |
Maximum number of processed documents.
|
Self |
setSlices(int slices) |
The number of slices this task should be divided into.
|
Self |
setTimeout(TimeValue timeout) |
Timeout to wait for the shards on to be available for each bulk request?
|
Self |
setWaitForActiveShards(int waitForActiveShards) |
A shortcut for
setWaitForActiveShards(ActiveShardCount) where the numerical
shard count is passed in, instead of having to first call ActiveShardCount.from(int)
to get the ActiveShardCount. |
Self |
setWaitForActiveShards(ActiveShardCount activeShardCount) |
Sets the number of shard copies that must be active before proceeding with the write.
|
ActionRequestValidationException |
validate() |
|
void |
writeTo(StreamOutput out) |
Write this object's fields to a StreamOutput.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setParentTask
remoteAddress, remoteAddress
getParentTask, setParentTask
public static final int SIZE_ALL_MATCHES
public static final int AUTO_SLICES
public static final java.lang.String AUTO_SLICES_VALUE
public AbstractBulkByScrollRequest()
public AbstractBulkByScrollRequest(SearchRequest searchRequest, boolean setDefaults)
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 slicingprotected abstract Self self()
public ActionRequestValidationException validate()
validate
in class ActionRequest
public int getSize()
public Self setSize(int size)
public boolean isAbortOnVersionConflict()
public Self setAbortOnVersionConflict(boolean abortOnVersionConflict)
public void setConflicts(java.lang.String conflicts)
public SearchRequest getSearchRequest()
public boolean isRefresh()
public Self setRefresh(boolean refresh)
public TimeValue getTimeout()
public Self setTimeout(TimeValue timeout)
public ActiveShardCount getWaitForActiveShards()
public Self setWaitForActiveShards(ActiveShardCount activeShardCount)
ReplicationRequest.waitForActiveShards(ActiveShardCount)
for details.public Self setWaitForActiveShards(int waitForActiveShards)
setWaitForActiveShards(ActiveShardCount)
where the numerical
shard count is passed in, instead of having to first call ActiveShardCount.from(int)
to get the ActiveShardCount.public TimeValue getRetryBackoffInitialTime()
public Self setRetryBackoffInitialTime(TimeValue retryBackoffInitialTime)
public int getMaxRetries()
public Self setMaxRetries(int maxRetries)
public float getRequestsPerSecond()
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.public Self setRequestsPerSecond(float requestsPerSecond)
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.public Self setShouldStoreResult(boolean shouldStoreResult)
public boolean getShouldStoreResult()
ActionRequest
getShouldStoreResult
in class ActionRequest
public Self setScroll(TimeValue keepAlive)
SearchRequest
public TimeValue getScrollTime()
public Self setSlices(int slices)
public int getSlices()
public abstract Self forSlice(TaskId slicingTask, SearchRequest slice, int totalSlices)
protected Self doForSlice(Self request, TaskId slicingTask, int totalSlices)
public Task createTask(long id, java.lang.String type, java.lang.String action, TaskId parentTaskId, java.util.Map<java.lang.String,java.lang.String> headers)
TaskAwareRequest
public void readFrom(StreamInput in) throws java.io.IOException
Streamable
readFrom
in interface Streamable
readFrom
in class ActionRequest
java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
Streamable
writeTo
in interface Streamable
writeTo
in interface Writeable
writeTo
in class ActionRequest
java.io.IOException
protected void searchToString(java.lang.StringBuilder b)
public java.lang.String getDescription()
TaskAwareRequest