Module org.elasticsearch.server
Class MasterNodeRequest<Request extends MasterNodeRequest<Request>>
java.lang.Object
org.elasticsearch.transport.TransportMessage
org.elasticsearch.transport.AbstractTransportRequest
org.elasticsearch.action.ActionRequest
org.elasticsearch.action.LegacyActionRequest
org.elasticsearch.action.support.master.MasterNodeRequest<Request>
- All Implemented Interfaces:
Writeable,RefCounted,TaskAwareRequest,TransportRequest
- Direct Known Subclasses:
AcknowledgedRequest,AddVotingConfigExclusionsRequest,ClearVotingConfigExclusionsRequest,CloneSnapshotRequest,ClusterAllocationExplainRequest,CompletionPersistentTaskAction.Request,CreateSnapshotRequest,DeleteDataStreamAction.Request,DeleteIndexTemplateRequest,DeleteSnapshotRequest,DownsampleAction.Request,GetShardSnapshotRequest,GetSnapshotsRequest,GetSnapshottableFeaturesRequest,MasterNodeReadRequest,PromoteDataStreamAction.Request,PutComponentTemplateAction.Request,PutIndexTemplateRequest,RemovePersistentTaskAction.Request,ResetFeatureStateRequest,RestoreSnapshotRequest,SnapshotsStatusRequest,StartPersistentTaskAction.Request,TransportDeleteComponentTemplateAction.Request,TransportDeleteComposableIndexTemplateAction.Request,TransportPutComposableIndexTemplateAction.Request,UpdateIndexShardSnapshotStatusRequest,UpdatePersistentTaskStatusAction.Request
public abstract class MasterNodeRequest<Request extends MasterNodeRequest<Request>>
extends LegacyActionRequest
A based request for master based operation.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TimeValueIndicates the request will wait forever while trying to find the master node.static final TimeValueDeprecated, for removal: This API element is subject to removal in a future version.all requests should specify a timeout, see #107984.Fields inherited from interface org.elasticsearch.core.RefCounted
ALWAYS_REFERENCED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal TimeValuefinal RequestmasterNodeTimeout(TimeValue timeout) Specifies how long to wait when the master has not been discovered yet, or is disconnected, or is busy processing other tasks.final longvoidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class org.elasticsearch.action.ActionRequest
getShouldStoreResult, validateMethods inherited from class org.elasticsearch.transport.AbstractTransportRequest
getParentTask, getRequestId, remoteAddress, remoteAddress, setParentTask, setRequestId, toStringMethods inherited from class org.elasticsearch.transport.TransportMessage
decRef, hasReferences, incRef, tryIncRefMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.core.RefCounted
decRef, hasReferences, incRef, mustIncRef, tryIncRefMethods inherited from interface org.elasticsearch.tasks.TaskAwareRequest
createTask, createTask, getDescription, setParentTask
-
Field Details
-
TRAPPY_IMPLICIT_DEFAULT_MASTER_NODE_TIMEOUT
@Deprecated(forRemoval=true) public static final TimeValue TRAPPY_IMPLICIT_DEFAULT_MASTER_NODE_TIMEOUTDeprecated, for removal: This API element is subject to removal in a future version.all requests should specify a timeout, see #107984.The default timeout for master-node requests. It's super-trappy to have such a default, because it makes it all too easy to forget to add a mechanism by which clients can change it. Without such a mechanism things will work fine until we encounter a large cluster that is struggling to process cluster state updates fast enough, and it's a disaster if we cannot extend the master-node timeout in those cases. We shouldn't use this any more and should work towards removing it.For requests which originate in the REST layer, use
RestUtils.getMasterNodeTimeout(org.elasticsearch.rest.RestRequest)to determine the timeout.For internally-generated requests, choose an appropriate timeout. Often this will be
INFINITE_MASTER_NODE_TIMEOUT, since usually we want internal requests to wait for as long as necessary to complete. -
INFINITE_MASTER_NODE_TIMEOUT
Indicates the request will wait forever while trying to find the master node.
-
-
Constructor Details
-
MasterNodeRequest
- Parameters:
masterNodeTimeout- Specifies how long to wait when the master has not been discovered yet, or is disconnected, or is busy processing other tasks:-
For requests which originate in the REST layer, use
RestUtils.getMasterNodeTimeout(org.elasticsearch.rest.RestRequest)to determine the timeout. -
For internally-generated requests, choose an appropriate timeout. Often this will be an infinite
timeout,
INFINITE_MASTER_NODE_TIMEOUT, since it is reasonable to wait for as long as necessary for internal requests to complete.
-
For requests which originate in the REST layer, use
-
MasterNodeRequest
- Throws:
IOException
-
-
Method Details
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Overrides:
writeToin classActionRequest- Throws:
IOException
-
masterNodeTimeout
Specifies how long to wait when the master has not been discovered yet, or is disconnected, or is busy processing other tasks. The valueINFINITE_MASTER_NODE_TIMEOUTmeans to wait forever.For requests which originate in the REST layer, use
RestUtils.getMasterNodeTimeout(org.elasticsearch.rest.RestRequest)to determine the timeout.For internally-generated requests, choose an appropriate timeout. Often this will be
INFINITE_MASTER_NODE_TIMEOUTsince usually we want internal requests to wait for as long as necessary to complete. -
masterNodeTimeout
- Returns:
- how long to wait when the master has not been discovered yet, or is disconnected, or is busy processing other tasks. The
value
INFINITE_MASTER_NODE_TIMEOUTmeans to wait forever.
-
masterTerm
public final long masterTerm()- Returns:
- the master term of the cluster state used to route this request, for protection against routing loops. May be
0Lif this is the original request or it came from an older node that lacks routing loop protection
-