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:
Writeable, org.elasticsearch.common.util.concurrent.RefCounted, 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
  • Constructor Details

    • ConcreteShardRequest

      public ConcreteShardRequest​(Writeable.Reader<R> requestReader, StreamInput in) throws java.io.IOException
      Throws:
      java.io.IOException
    • ConcreteShardRequest

      public ConcreteShardRequest​(R request, java.lang.String targetAllocationID, long primaryTerm)
    • ConcreteShardRequest

      public ConcreteShardRequest​(R request, java.lang.String targetAllocationID, long primaryTerm, boolean sentFromLocalReroute, boolean localRerouteInitiatedByNodeClient)
  • Method Details

    • 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 interface TaskAwareRequest
      Overrides:
      setParentTask in class TransportRequest
    • getParentTask

      public TaskId getParentTask()
      Description copied from class: TransportRequest
      Get a reference to the task that created this request. Defaults to TaskId.EMPTY_TASK_ID, meaning "there is no parent".
      Specified by:
      getParentTask in interface TaskAwareRequest
      Overrides:
      getParentTask in class TransportRequest
    • 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.
    • getDescription

      public java.lang.String getDescription()
      Description copied from interface: TaskAwareRequest
      Returns optional description of the request to be displayed by the task manager
    • writeTo

      public void writeTo​(StreamOutput out) throws java.io.IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Overrides:
      writeTo in class TransportRequest
      Throws:
      java.io.IOException
    • sentFromLocalReroute

      public boolean sentFromLocalReroute()
    • localRerouteInitiatedByNodeClient

      public boolean localRerouteInitiatedByNodeClient()
    • getRequest

      public R getRequest()
    • getTargetAllocationID

      public java.lang.String getTargetAllocationID()
    • getPrimaryTerm

      public long getPrimaryTerm()
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object