Module org.elasticsearch.server
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
,RefCounted
,TaskAwareRequest
,RawIndexingDataTransportRequest
- 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
implements RawIndexingDataTransportRequest
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>
-
Field Summary
Fields inherited from interface org.elasticsearch.core.RefCounted
ALWAYS_REFERENCED
-
Constructor Summary
ConstructorsConstructorDescriptionConcreteShardRequest
(Writeable.Reader<R> requestReader, StreamInput in) ConcreteShardRequest
(R request, String targetAllocationID, long primaryTerm) ConcreteShardRequest
(R request, String targetAllocationID, long primaryTerm, boolean sentFromLocalReroute, boolean localRerouteInitiatedByNodeClient) -
Method Summary
Modifier and TypeMethodDescriptionReturns the task object that should be used to keep track of the processing of the request.Returns optional description of the request to be displayed by the task managerGet a reference to the task that created this request.long
long
Gets the request ID.boolean
boolean
boolean
void
setParentTask
(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.void
setRequestId
(long requestId) Set the request ID of this request.toString()
void
writeTo
(StreamOutput out) Write this into the StreamOutput.Methods inherited from class org.elasticsearch.transport.TransportMessage
decRef, hasReferences, incRef, remoteAddress, remoteAddress, tryIncRef
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.elasticsearch.core.RefCounted
mustIncRef
-
Constructor Details
-
ConcreteShardRequest
- Throws:
IOException
-
ConcreteShardRequest
-
ConcreteShardRequest
-
-
Method Details
-
setParentTask
Description copied from interface:TaskAwareRequest
Set a reference to task that caused this task to be run.- Specified by:
setParentTask
in interfaceTaskAwareRequest
-
setParentTask
Description copied from class:TransportRequest
Set a reference to task that created this request.- Specified by:
setParentTask
in interfaceTaskAwareRequest
- Overrides:
setParentTask
in classTransportRequest
-
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
-
setRequestId
public void setRequestId(long requestId) Description copied from class:TransportRequest
Set the request ID of this request.- Specified by:
setRequestId
in interfaceTaskAwareRequest
- Overrides:
setRequestId
in classTransportRequest
-
getRequestId
public long getRequestId()Description copied from interface:TaskAwareRequest
Gets the request ID. Defaults to -1, meaning "no request ID is set".- Specified by:
getRequestId
in interfaceTaskAwareRequest
- Overrides:
getRequestId
in classTransportRequest
-
createTask
public Task createTask(long id, String type, String action, TaskId parentTaskId, Map<String, String> headers) Description copied from interface:TaskAwareRequest
Returns the task object that should be used to keep track of the processing of the request.- Specified by:
createTask
in interfaceTaskAwareRequest
-
getDescription
Description copied from interface:TaskAwareRequest
Returns optional description of the request to be displayed by the task manager- Specified by:
getDescription
in interfaceTaskAwareRequest
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Overrides:
writeTo
in classTransportRequest
- Throws:
IOException
-
sentFromLocalReroute
public boolean sentFromLocalReroute() -
localRerouteInitiatedByNodeClient
public boolean localRerouteInitiatedByNodeClient() -
getRequest
-
getTargetAllocationID
-
getPrimaryTerm
public long getPrimaryTerm() -
isRawIndexingData
public boolean isRawIndexingData()- Specified by:
isRawIndexingData
in interfaceRawIndexingDataTransportRequest
-
toString
- Overrides:
toString
in classTransportRequest
-