public abstract class ReplicationRequest<Request extends ReplicationRequest<Request>> extends ActionRequest<Request> implements IndicesRequest
TransportRequest.Empty
IndicesRequest.Replaceable
Modifier and Type | Field and Description |
---|---|
static TimeValue |
DEFAULT_TIMEOUT |
protected java.lang.String |
index |
protected ShardId |
shardId
Target shard the request should execute on.
|
protected TimeValue |
timeout |
Constructor and Description |
---|
ReplicationRequest() |
ReplicationRequest(ShardId shardId)
Creates a new request with resolved shard id
|
Modifier and Type | Method and Description |
---|---|
WriteConsistencyLevel |
consistencyLevel() |
Request |
consistencyLevel(WriteConsistencyLevel consistencyLevel)
Sets the consistency level of write.
|
Task |
createTask(long id,
java.lang.String type,
java.lang.String action,
TaskId parentTaskId)
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.
|
long |
primaryTerm()
returns the primary term active at the time the operation was performed on the primary shard
|
void |
primaryTerm(long term)
marks the primary term in which the operation was performed
|
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.
|
java.lang.String |
toString() |
ActionRequestValidationException |
validate() |
void |
writeTo(StreamOutput out)
Write this object's fields to a StreamOutput.
|
getParentTask, setParentTask, setParentTask
remoteAddress, remoteAddress
public static final TimeValue DEFAULT_TIMEOUT
protected ShardId shardId
protected TimeValue timeout
protected java.lang.String index
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()
IndicesRequest
indices
in interface IndicesRequest
public IndicesOptions indicesOptions()
IndicesRequest
indicesOptions
in interface IndicesRequest
public WriteConsistencyLevel consistencyLevel()
@Nullable public ShardId shardId()
public final Request consistencyLevel(WriteConsistencyLevel consistencyLevel)
WriteConsistencyLevel.DEFAULT
public long primaryTerm()
public void primaryTerm(long term)
public ActionRequestValidationException validate()
validate
in class ActionRequest<Request extends ReplicationRequest<Request>>
public void readFrom(StreamInput in) throws java.io.IOException
Streamable
readFrom
in interface Streamable
readFrom
in class ActionRequest<Request extends ReplicationRequest<Request>>
java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
Streamable
writeTo
in interface Streamable
writeTo
in class ActionRequest<Request extends ReplicationRequest<Request>>
java.io.IOException
public Task createTask(long id, java.lang.String type, java.lang.String action, TaskId parentTaskId)
TransportRequest
createTask
in class TransportRequest
public Request setShardId(ShardId shardId)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getDescription()
TransportRequest
getDescription
in class TransportRequest