Module org.elasticsearch.server
Class TermOverridingMasterNodeRequest
java.lang.Object
org.elasticsearch.transport.TransportMessage
org.elasticsearch.transport.AbstractTransportRequest
org.elasticsearch.action.support.master.TermOverridingMasterNodeRequest
- All Implemented Interfaces:
Writeable,RefCounted,TaskAwareRequest,TransportRequest
Wrapper around a
MasterNodeRequest for use when sending the request to another node, overriding the MasterNodeRequest.masterTerm() sent out over the wire.
Note that in production this is only used for sending the request out, so there's no need to preserve other marker interfaces such
as IndicesRequest or IndicesRequest.Replaceable on the wrapped request.
The receiving node will deserialize a request without a wrapper, with the correct interfaces and the appropriate master term stored
directly in MasterNodeRequest.masterTerm(). However in tests sometimes we want to intercept the request as it's being sent, for
which it may be necessary to use the test utility MasterNodeRequestHelper#unwrapTermOverride to remove the wrapper and access the
inner request.
-
Nested Class Summary
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 -
Method Summary
Modifier and TypeMethodDescriptionReturns the task object that should be used to keep track of the processing of the request.booleandecRef()Note that the lifetime of an outboundTransportMessagelasts at least until it has been fully sent over the network, and it may be closed on a network thread in a context in which there's a risk of stack overflows if on close it calls back into the network layer in a manner that might end up nesting too deeply.Returns optional description of the request to be displayed by the task managerGet a reference to the task that created this request.longGets the request ID.booleanvoidincRef()voidremoteAddress(InetSocketAddress remoteAddress) voidsetParentTask(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.voidsetRequestId(long requestId) Set the request ID of this request.toString()booleanfinal voidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.core.RefCounted
mustIncRefMethods inherited from interface org.elasticsearch.tasks.TaskAwareRequest
createTask
-
Method Details
-
createTask
public Task createTask(long id, String type, String action, TaskId parentTaskId, Map<String, String> headers) Description copied from interface:TaskAwareRequestReturns the task object that should be used to keep track of the processing of the request. -
getDescription
Description copied from interface:TaskAwareRequestReturns optional description of the request to be displayed by the task manager -
remoteAddress
- Specified by:
remoteAddressin interfaceTransportRequest- Overrides:
remoteAddressin classAbstractTransportRequest
-
remoteAddress
- Specified by:
remoteAddressin interfaceTransportRequest- Overrides:
remoteAddressin classAbstractTransportRequest
-
incRef
public void incRef()- Specified by:
incRefin interfaceRefCounted- Overrides:
incRefin classTransportMessage
-
tryIncRef
public boolean tryIncRef()- Specified by:
tryIncRefin interfaceRefCounted- Overrides:
tryIncRefin classTransportMessage
-
decRef
public boolean decRef()Description copied from class:TransportMessageNote that the lifetime of an outboundTransportMessagelasts at least until it has been fully sent over the network, and it may be closed on a network thread in a context in which there's a risk of stack overflows if on close it calls back into the network layer in a manner that might end up nesting too deeply. When in doubt, dispatch any further work onto a separate thread.- Specified by:
decRefin interfaceRefCounted- Overrides:
decRefin classTransportMessage
-
hasReferences
public boolean hasReferences()- Specified by:
hasReferencesin interfaceRefCounted- Overrides:
hasReferencesin classTransportMessage
-
setParentTask
Description copied from interface:TaskAwareRequestSet a reference to task that caused this task to be run. -
setParentTask
Description copied from class:AbstractTransportRequestSet a reference to task that created this request.- Specified by:
setParentTaskin interfaceTaskAwareRequest- Overrides:
setParentTaskin classAbstractTransportRequest
-
getParentTask
Description copied from class:AbstractTransportRequestGet 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 classAbstractTransportRequest
-
setRequestId
public void setRequestId(long requestId) Description copied from class:AbstractTransportRequestSet the request ID of this request.- Specified by:
setRequestIdin interfaceTaskAwareRequest- Overrides:
setRequestIdin classAbstractTransportRequest
-
getRequestId
public long getRequestId()Description copied from interface:TaskAwareRequestGets the request ID. Defaults to -1, meaning "no request ID is set".- Specified by:
getRequestIdin interfaceTaskAwareRequest- Overrides:
getRequestIdin classAbstractTransportRequest
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Overrides:
writeToin classAbstractTransportRequest- Throws:
IOException
-
toString
- Overrides:
toStringin classAbstractTransportRequest
-