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

public abstract class MasterNodeRequest<Request extends MasterNodeRequest<Request>> extends LegacyActionRequest
A based request for master based operation.
  • Field Details

    • TRAPPY_IMPLICIT_DEFAULT_MASTER_NODE_TIMEOUT

      @Deprecated(forRemoval=true) public static final TimeValue TRAPPY_IMPLICIT_DEFAULT_MASTER_NODE_TIMEOUT
      Deprecated, 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 (or TimeValue.MINUS_ONE which 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

  • Method Details

    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Overrides:
      writeTo in class ActionRequest
      Throws:
      IOException
    • masterNodeTimeout

      public final Request masterNodeTimeout(TimeValue timeout)
      Specifies 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_ONE means 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 (or TimeValue.MINUS_ONE which 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

      public final TimeValue 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_ONE means 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 0L if this is the original request or it came from an older node that lacks routing loop protection
    • infiniteMasterNodeTimeout

      public static TimeValue infiniteMasterNodeTimeout(TransportVersion transportVersion)
      Returns:
      a TimeValue which represents an infinite master-node timeout, suitable for sending using the given transport version. Versions prior to 8.14 did not reliably support TimeValue.MINUS_ONE for this purpose so for these versions we use TimeValue.MAX_VALUE as the best available alternative.
      See Also: