Class MasterNodeRequest<Request extends MasterNodeRequest<Request>>
- All Implemented Interfaces:
Writeable,RefCounted,TaskAwareRequest
- 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
-
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 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 TypeMethodDescriptionstatic TimeValueinfiniteMasterNodeTimeout(TransportVersion transportVersion) final 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.TransportRequest
getParentTask, getRequestId, setParentTask, setRequestId, toStringMethods inherited from class org.elasticsearch.transport.TransportMessage
decRef, hasReferences, incRef, remoteAddress, remoteAddress, tryIncRefMethods 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, 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
TimeValue.MAX_VALUE(orTimeValue.MINUS_ONEwhich means an infinite timeout in 8.14.0 onwards (see #107050) since usually we want internal requests to wait for as long as necessary to complete.
-
-
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, see
infiniteMasterNodeTimeout(org.elasticsearch.TransportVersion), 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 valueTimeValue.MINUS_ONEmeans to wait forever in 8.15.0 onwards.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
TimeValue.MAX_VALUE(orTimeValue.MINUS_ONEwhich means an infinite timeout in 8.15.0 onwards) since 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
TimeValue.MINUS_ONEmeans 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
-
infiniteMasterNodeTimeout
- Returns:
- a
TimeValuewhich represents an infinite master-node timeout, suitable for sending using the given transport version. Versions prior to 8.14 did not reliably supportTimeValue.MINUS_ONEfor this purpose so for these versions we useTimeValue.MAX_VALUEas the best available alternative. - See Also:
-