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

public class TermOverridingMasterNodeRequest extends AbstractTransportRequest
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.