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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TaskcreateTask(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.StringgetDescription()Returns optional description of the request to be displayed by the task managerTaskIdgetParentTask()Get a reference to the task that created this request.longgetPrimaryTerm()RgetRequest()java.lang.StringgetTargetAllocationID()voidreadFrom(StreamInput in)Set this object's fields from a StreamInput.voidsetParentTask(java.lang.String parentTaskNode, long parentTaskId)Set a reference to task that caused this task to be run.voidsetParentTask(TaskId taskId)Set a reference to task that created this request.java.lang.StringtoString()voidwriteTo(StreamOutput out)Write this object's fields to a StreamOutput.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.common.io.stream.Streamable
-
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:TaskAwareRequestSet a reference to task that caused this task to be run.
-
setParentTask
public void setParentTask(TaskId taskId)
Description copied from class:TransportRequestSet a reference to task that created this request.- Specified by:
setParentTaskin interfaceTaskAwareRequest- Overrides:
setParentTaskin classTransportRequest
-
getParentTask
public TaskId getParentTask()
Description copied from class:TransportRequestGet a reference to the task that created this request. Defaults toTaskId.EMPTY_TASK_ID, meaning "there is no parent".- Specified by:
getParentTaskin interfaceTaskAwareRequest- Overrides:
getParentTaskin 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:TaskAwareRequestReturns 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:TaskAwareRequestReturns 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:StreamableSet this object's fields from a StreamInput.- Specified by:
readFromin interfaceStreamable- Overrides:
readFromin classTransportRequest- Throws:
java.io.IOException
-
writeTo
public void writeTo(StreamOutput out) throws java.io.IOException
Description copied from interface:StreamableWrite this object's fields to a StreamOutput.- Specified by:
writeToin interfaceStreamable- Specified by:
writeToin interfaceWriteable- Overrides:
writeToin 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:
toStringin classjava.lang.Object
-
-