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 ActionRequest
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 INFINITE_MASTER_NODE_TIMEOUT, since usually we want internal requests to wait for as long as necessary to complete.

    • INFINITE_MASTER_NODE_TIMEOUT

      public static final TimeValue INFINITE_MASTER_NODE_TIMEOUT
      Indicates the request will wait forever while trying to find the master node.
  • Constructor Details

    • MasterNodeRequest

      protected MasterNodeRequest(TimeValue masterNodeTimeout)
      Parameters:
      masterNodeTimeout - Specifies how long to wait when the master has not been discovered yet, or is disconnected, or is busy processing other tasks:
    • MasterNodeRequest

      protected MasterNodeRequest(StreamInput in) throws IOException
      Throws:
      IOException
  • 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 INFINITE_MASTER_NODE_TIMEOUT means 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_TIMEOUT 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 INFINITE_MASTER_NODE_TIMEOUT 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