Module org.elasticsearch.server
Class AcknowledgedRequest<Request extends MasterNodeRequest<Request>>
java.lang.Object
org.elasticsearch.transport.TransportMessage
org.elasticsearch.transport.TransportRequest
org.elasticsearch.action.ActionRequest
org.elasticsearch.action.support.master.MasterNodeRequest<Request>
org.elasticsearch.action.support.master.AcknowledgedRequest<Request>
- All Implemented Interfaces:
Writeable,RefCounted,TaskAwareRequest
- Direct Known Subclasses:
AcknowledgedRequest.Plain,AddIndexBlockRequest,CleanupRepositoryRequest,CloseIndexRequest,ClusterRerouteRequest,ClusterUpdateSettingsRequest,CreateDataStreamAction.Request,CreateIndexRequest,DeleteDanglingIndexRequest,DeleteIndexRequest,DeletePipelineRequest,DeleteRepositoryRequest,DeleteStoredScriptRequest,ImportDanglingIndexRequest,IndicesAliasesRequest,MigrateToDataStreamAction.Request,ModifyDataStreamsAction.Request,OpenIndexRequest,PutDataStreamLifecycleAction.Request,PutMappingRequest,PutPipelineRequest,PutRepositoryRequest,PutStoredScriptRequest,ResizeRequest,RolloverRequest,TransportDeleteDesiredNodesAction.Request,UpdateDesiredNodesRequest,UpdateSettingsRequest,VerifyRepositoryRequest
public abstract class AcknowledgedRequest<Request extends MasterNodeRequest<Request>>
extends MasterNodeRequest<Request>
Abstract base class for action requests that track acknowledgements of cluster state updates: such a request is acknowledged only once
the cluster state update is committed and all relevant nodes have applied it and acknowledged its application to the elected master..
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classAcknowledgedRequestthat does not have any additional fields.Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsFields inherited from class org.elasticsearch.action.support.master.MasterNodeRequest
INFINITE_MASTER_NODE_TIMEOUT, TRAPPY_IMPLICIT_DEFAULT_MASTER_NODE_TIMEOUTFields inherited from interface org.elasticsearch.core.RefCounted
ALWAYS_REFERENCED -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedAcknowledgedRequest(TimeValue masterNodeTimeout, TimeValue ackTimeout) -
Method Summary
Modifier and TypeMethodDescriptionfinal TimeValuefinal RequestackTimeout(TimeValue ackTimeout) Sets theackTimeout, which specifies how long to wait for all relevant nodes to apply a cluster state update and acknowledge this to the elected master.validate()voidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class org.elasticsearch.action.support.master.MasterNodeRequest
masterNodeTimeout, masterNodeTimeout, masterTermMethods inherited from class org.elasticsearch.action.ActionRequest
getShouldStoreResultMethods 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
-
DEFAULT_ACK_TIMEOUT
-
-
Constructor Details
-
AcknowledgedRequest
- Parameters:
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.ackTimeout- specifies how long to wait for all relevant nodes to apply a cluster state update and acknowledge this to the elected master.
-
AcknowledgedRequest
- Throws:
IOException
-
-
Method Details
-
ackTimeout
Sets theackTimeout, which specifies how long to wait for all relevant nodes to apply a cluster state update and acknowledge this to the elected master.- Parameters:
ackTimeout- timeout as aTimeValue- Returns:
- this request, for method chaining.
-
ackTimeout
- Returns:
- the current ack timeout as a
TimeValue
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Overrides:
writeToin classMasterNodeRequest<Request extends MasterNodeRequest<Request>>- Throws:
IOException
-
validate
- Specified by:
validatein classActionRequest
-