public class ReplicationRequest<T extends ReplicationRequest<T>> extends ChildTaskActionRequest<T> implements IndicesRequest
TransportRequest.Empty
IndicesRequest.Replaceable
Modifier and Type | Field and Description |
---|---|
static TimeValue |
DEFAULT_TIMEOUT |
protected String |
index |
protected ShardId |
shardId
Target shard the request should execute on.
|
protected TimeValue |
timeout |
headers
Modifier | Constructor and Description |
---|---|
|
ReplicationRequest() |
|
ReplicationRequest(ActionRequest request)
Creates a new request that inherits headers and context from the request provided as argument.
|
|
ReplicationRequest(ActionRequest request,
ShardId shardId)
Creates a new request with resolved shard id
|
protected |
ReplicationRequest(T request)
Copy constructor that creates a new request that is a copy of the one provided as an argument.
|
protected |
ReplicationRequest(T request,
ActionRequest originalRequest)
Copy constructor that creates a new request that is a copy of the one provided as an argument.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canHaveDuplicates()
Is this request can potentially be dup on a single shard.
|
WriteConsistencyLevel |
consistencyLevel() |
T |
consistencyLevel(WriteConsistencyLevel consistencyLevel)
Sets the consistency level of write.
|
Task |
createTask(long id,
String type,
String action,
TaskId parentTaskId) |
String |
getDescription()
Returns optional description of the request to be displayed by the task manager
|
String |
index() |
T |
index(String index) |
String[] |
indices()
Returns the array of indices that the action relates to
|
IndicesOptions |
indicesOptions()
Returns the indices options used to resolve indices.
|
void |
readFrom(StreamInput in) |
T |
setShardId(ShardId shardId)
Sets the target shard id for the request.
|
ShardId |
shardId() |
TimeValue |
timeout() |
T |
timeout(String timeout)
A timeout to wait if the index operation can't be performed immediately.
|
T |
timeout(TimeValue timeout)
A timeout to wait if the index operation can't be performed immediately.
|
String |
toString() |
ActionRequestValidationException |
validate() |
void |
writeTo(StreamOutput out) |
createTask, setParentTask
remoteAddress, remoteAddress
contextSize, copyContextAndHeadersFrom, copyContextFrom, copyHeadersFrom, getContext, getFromContext, getFromContext, getHeader, getHeaders, hasHeader, hasInContext, isContextEmpty, putAllInContext, putHeader, putInContext
public static final TimeValue DEFAULT_TIMEOUT
protected ShardId shardId
protected TimeValue timeout
protected String index
public ReplicationRequest()
public ReplicationRequest(ActionRequest request)
public ReplicationRequest(ActionRequest request, ShardId shardId)
protected ReplicationRequest(T request)
protected ReplicationRequest(T request, ActionRequest originalRequest)
public boolean canHaveDuplicates()
public final T timeout(TimeValue timeout)
public final T timeout(String timeout)
public TimeValue timeout()
public String index()
public String[] indices()
IndicesRequest
indices
in interface IndicesRequest
public IndicesOptions indicesOptions()
IndicesRequest
indicesOptions
in interface IndicesRequest
public WriteConsistencyLevel consistencyLevel()
@Nullable public ShardId shardId()
public final T consistencyLevel(WriteConsistencyLevel consistencyLevel)
WriteConsistencyLevel.DEFAULT
public ActionRequestValidationException validate()
validate
in class ActionRequest<T extends ReplicationRequest<T>>
public void readFrom(StreamInput in) throws IOException
readFrom
in interface Streamable
readFrom
in class ChildTaskActionRequest<T extends ReplicationRequest<T>>
IOException
public void writeTo(StreamOutput out) throws IOException
writeTo
in interface Streamable
writeTo
in class ChildTaskActionRequest<T extends ReplicationRequest<T>>
IOException
public Task createTask(long id, String type, String action, TaskId parentTaskId)
createTask
in class ChildTaskActionRequest<T extends ReplicationRequest<T>>
public T setShardId(ShardId shardId)
public String getDescription()
TransportRequest
getDescription
in class TransportRequest
Copyright © 2009–2016. All rights reserved.