IndicesRequest, Streamable, Writeable, TaskAwareRequestBasicReplicationRequest, GlobalCheckpointSyncAction.Request, ReplicatedWriteRequest, ShardFlushRequestpublic abstract class ReplicationRequest<Request extends ReplicationRequest<Request>> extends ActionRequest implements IndicesRequest
IndexRequest or
TransportShardRefreshAction.IndicesRequest.ReplaceableTransportRequest.EmptyWriteable.Reader<V>, Writeable.Writer<V>| Modifier and Type | Field | Description |
|---|---|---|
static TimeValue |
DEFAULT_TIMEOUT |
|
protected java.lang.String |
index |
|
protected ShardId |
shardId |
Target shard the request should execute on.
|
protected TimeValue |
timeout |
|
protected ActiveShardCount |
waitForActiveShards |
The number of shard copies that must be active before proceeding with the replication action.
|
| Constructor | Description |
|---|---|
ReplicationRequest() |
|
ReplicationRequest(ShardId shardId) |
Creates a new request with resolved shard id
|
| 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.
|
java.lang.String |
getDescription() |
Returns optional description of the request to be displayed by the task manager
|
java.lang.String |
index() |
|
Request |
index(java.lang.String index) |
|
java.lang.String[] |
indices() |
Returns the array of indices that the action relates to
|
IndicesOptions |
indicesOptions() |
Returns the indices options used to resolve indices.
|
void |
onRetry() |
This method is called before this replication request is retried
the first time.
|
void |
readFrom(StreamInput in) |
Set this object's fields from a StreamInput.
|
Request |
setShardId(ShardId shardId) |
Sets the target shard id for the request.
|
ShardId |
shardId() |
|
TimeValue |
timeout() |
|
Request |
timeout(java.lang.String timeout) |
A timeout to wait if the index operation can't be performed immediately.
|
Request |
timeout(TimeValue timeout) |
A timeout to wait if the index operation can't be performed immediately.
|
abstract java.lang.String |
toString() |
|
ActionRequestValidationException |
validate() |
|
ActiveShardCount |
waitForActiveShards() |
|
Request |
waitForActiveShards(int waitForActiveShards) |
A shortcut for
waitForActiveShards(ActiveShardCount) where the numerical
shard count is passed in, instead of having to first call ActiveShardCount.from(int)
to get the ActiveShardCount. |
Request |
waitForActiveShards(ActiveShardCount waitForActiveShards) |
Sets the number of shard copies that must be active before proceeding with the replication
operation.
|
void |
writeTo(StreamOutput out) |
Write this object's fields to a StreamOutput.
|
getShouldStoreResultclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitsetParentTaskremoteAddress, remoteAddressgetParentTask, setParentTaskpublic static final TimeValue DEFAULT_TIMEOUT
protected ShardId shardId
protected TimeValue timeout
protected java.lang.String index
protected ActiveShardCount waitForActiveShards
public ReplicationRequest()
public ReplicationRequest(ShardId shardId)
public final Request timeout(TimeValue timeout)
public final Request timeout(java.lang.String timeout)
public TimeValue timeout()
public java.lang.String index()
public final Request index(java.lang.String index)
public java.lang.String[] indices()
IndicesRequestindices in interface IndicesRequestpublic IndicesOptions indicesOptions()
IndicesRequestindicesOptions in interface IndicesRequestpublic ActiveShardCount waitForActiveShards()
@Nullable public ShardId shardId()
public final Request waitForActiveShards(ActiveShardCount waitForActiveShards)
ActiveShardCount.DEFAULT, which requires one shard copy
(the primary) to be active. Set this value to ActiveShardCount.ALL to
wait for all shards (primary and all replicas) to be active. Otherwise, use
ActiveShardCount.from(int) to set this value to any non-negative integer, up to the
total number of shard copies (number of replicas + 1).public final Request waitForActiveShards(int waitForActiveShards)
waitForActiveShards(ActiveShardCount) where the numerical
shard count is passed in, instead of having to first call ActiveShardCount.from(int)
to get the ActiveShardCount.public ActionRequestValidationException validate()
validate in class ActionRequestpublic void readFrom(StreamInput in) throws java.io.IOException
StreamablereadFrom in interface StreamablereadFrom in class ActionRequestjava.io.IOExceptionpublic void writeTo(StreamOutput out) throws java.io.IOException
StreamablewriteTo in interface StreamablewriteTo in interface WriteablewriteTo in class ActionRequestjava.io.IOExceptionpublic Task createTask(long id, java.lang.String type, java.lang.String action, TaskId parentTaskId, java.util.Map<java.lang.String,java.lang.String> headers)
TaskAwareRequestcreateTask in interface TaskAwareRequestpublic Request setShardId(ShardId shardId)
public abstract java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getDescription()
TaskAwareRequestgetDescription in interface TaskAwareRequestpublic void onRetry()