Class TransportReplicationAction.ConcreteShardRequest<R extends TransportRequest>
- java.lang.Object
-
- org.elasticsearch.transport.TransportMessage
-
- org.elasticsearch.transport.TransportRequest
-
- org.elasticsearch.action.support.replication.TransportReplicationAction.ConcreteShardRequest<R>
-
- All Implemented Interfaces:
Streamable
,Writeable
,TaskAwareRequest
- Direct Known Subclasses:
TransportReplicationAction.ConcreteReplicaRequest
- Enclosing class:
- TransportReplicationAction<Request extends ReplicationRequest<Request>,ReplicaRequest extends ReplicationRequest<ReplicaRequest>,Response extends ReplicationResponse>
public static class TransportReplicationAction.ConcreteShardRequest<R extends TransportRequest> extends TransportRequest
a wrapper class to encapsulate a request when being sent to a specific allocation id
-
-
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>
-
-
Constructor Summary
Constructors Constructor Description ConcreteShardRequest(java.util.function.Supplier<R> requestSupplier)
ConcreteShardRequest(R request, java.lang.String targetAllocationID, long primaryTerm)
-
Method Summary
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 managerTaskId
getParentTask()
Get a reference to the task that created this request.long
getPrimaryTerm()
R
getRequest()
java.lang.String
getTargetAllocationID()
void
readFrom(StreamInput in)
Set this object's fields from a StreamInput.void
setParentTask(java.lang.String parentTaskNode, long parentTaskId)
Set a reference to task that caused this task to be run.void
setParentTask(TaskId taskId)
Set a reference to task that created this request.java.lang.String
toString()
void
writeTo(StreamOutput out)
Write this object's fields to a StreamOutput.-
Methods inherited from class org.elasticsearch.transport.TransportMessage
remoteAddress, remoteAddress
-
-
-
-
Method Detail
-
setParentTask
public void setParentTask(java.lang.String parentTaskNode, long parentTaskId)
Description copied from interface:TaskAwareRequest
Set a reference to task that caused this task to be run.
-
setParentTask
public void setParentTask(TaskId taskId)
Description copied from class:TransportRequest
Set a reference to task that created this request.- Specified by:
setParentTask
in interfaceTaskAwareRequest
- Overrides:
setParentTask
in classTransportRequest
-
getParentTask
public TaskId getParentTask()
Description copied from class:TransportRequest
Get a reference to the task that created this request. Defaults toTaskId.EMPTY_TASK_ID
, meaning "there is no parent".- Specified by:
getParentTask
in interfaceTaskAwareRequest
- Overrides:
getParentTask
in classTransportRequest
-
createTask
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)
Description copied from interface:TaskAwareRequest
Returns the task object that should be used to keep track of the processing of the request. A request can override this method and return null to avoid being tracked by the task manager.
-
getDescription
public java.lang.String getDescription()
Description copied from interface:TaskAwareRequest
Returns optional description of the request to be displayed by the task manager
-
readFrom
public void readFrom(StreamInput in) throws java.io.IOException
Description copied from interface:Streamable
Set this object's fields from a StreamInput.- Specified by:
readFrom
in interfaceStreamable
- Overrides:
readFrom
in classTransportRequest
- Throws:
java.io.IOException
-
writeTo
public void writeTo(StreamOutput out) throws java.io.IOException
Description copied from interface:Streamable
Write this object's fields to a StreamOutput.- Specified by:
writeTo
in interfaceStreamable
- Specified by:
writeTo
in interfaceWriteable
- Overrides:
writeTo
in classTransportRequest
- Throws:
java.io.IOException
-
getRequest
public R getRequest()
-
getTargetAllocationID
public java.lang.String getTargetAllocationID()
-
getPrimaryTerm
public long getPrimaryTerm()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-