Class SingleShardRequest<Request extends SingleShardRequest<Request>>

All Implemented Interfaces:
IndicesRequest, IndicesRequest.RemoteClusterShardRequest, Writeable, RefCounted, TaskAwareRequest
Direct Known Subclasses:
AnalyzeAction.Request, ExplainRequest, GetFieldMappingsIndexRequest, GetRequest, MultiGetShardRequest, MultiTermVectorsShardRequest, RetentionLeaseActions.AddRequest, RetentionLeaseActions.RemoveRequest, RetentionLeaseActions.RenewRequest, TermVectorsRequest

public abstract class SingleShardRequest<Request extends SingleShardRequest<Request>> extends ActionRequest implements IndicesRequest.RemoteClusterShardRequest
  • Field Details

    • INDICES_OPTIONS

      public static final IndicesOptions INDICES_OPTIONS
    • index

      @Nullable protected String index
      The concrete index name Whether index property is optional depends on the concrete implementation. If index property is required the concrete implementation should use validateNonNullIndex() to check if the index property has been set
  • Constructor Details

    • SingleShardRequest

      public SingleShardRequest()
    • SingleShardRequest

      public SingleShardRequest(StreamInput in) throws IOException
      Throws:
      IOException
    • SingleShardRequest

      protected SingleShardRequest(String index)
  • Method Details

    • validateNonNullIndex

      protected ActionRequestValidationException validateNonNullIndex()
      Returns:
      a validation exception if the index property hasn't been set
    • index

      @Nullable public String index()
      Returns:
      The concrete index this request is targeted for or null if index is optional. Whether index property is optional depends on the concrete implementation. If index property is required the concrete implementation should use validateNonNullIndex() to check if the index property has been set
    • index

      public final Request index(String index)
      Sets the index.
    • indices

      public String[] indices()
      Description copied from interface: IndicesRequest
      Returns the array of indices that the action relates to
      Specified by:
      indices in interface IndicesRequest
    • shards

      public List<ShardId> shards()
      Description copied from interface: IndicesRequest.RemoteClusterShardRequest
      Returns the shards this action is targeting directly, which may not obviously align with the indices returned by indices(). This is mostly used by requests which fan out to a number of shards for the those fan-out requests. A default is intentionally not provided for this method. It is critical that this method be implemented correctly for all remote cluster requests,
      Specified by:
      shards in interface IndicesRequest.RemoteClusterShardRequest
    • indicesOptions

      public IndicesOptions indicesOptions()
      Description copied from interface: IndicesRequest
      Returns the indices options used to resolve indices. They tell for instance whether a single index is accepted, whether an empty array will be converted to _all, and how wildcards will be expanded if needed.
      Specified by:
      indicesOptions in interface IndicesRequest
    • 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