Class PutSampleConfigurationAction.Request

All Implemented Interfaces:
IndicesRequest, IndicesRequest.Replaceable, Writeable, RefCounted, TaskAwareRequest, TransportRequest
Enclosing class:
PutSampleConfigurationAction

public static class PutSampleConfigurationAction.Request extends AcknowledgedRequest<PutSampleConfigurationAction.Request> implements IndicesRequest.Replaceable
Request class for configuring sampling settings on indices.

This request encapsulates all the parameters needed to configure sampling on one or more indices, including the sampling configuration itself and the target indices. It implements IndicesRequest.Replaceable to support index name resolution and expansion.

  • Constructor Details

    • Request

      public Request(SamplingConfiguration samplingConfiguration, @Nullable TimeValue masterNodeTimeout, @Nullable TimeValue ackTimeout)
      Constructs a new request with the specified sampling configuration parameters.
      Parameters:
      samplingConfiguration - the sampling configuration to apply
      masterNodeTimeout - the timeout for master node operations, or null for default
      ackTimeout - the timeout for acknowledgment, or null for default
    • Request

      public Request(StreamInput in) throws IOException
      Constructs a new request by deserializing from a stream input.
      Parameters:
      in - the stream input to read from
      Throws:
      IOException - if an I/O error occurs during deserialization
  • Method Details

    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Serializes this request to a stream output.
      Specified by:
      writeTo in interface Writeable
      Overrides:
      writeTo in class AcknowledgedRequest<PutSampleConfigurationAction.Request>
      Parameters:
      out - the stream output to write to
      Throws:
      IOException - if an I/O error occurs during serialization
    • indices

      public String[] indices()
      Returns the array of target indices for this sampling configuration request.
      Specified by:
      indices in interface IndicesRequest
      Returns:
      an array of index names, never null but may be empty
    • indices

      public PutSampleConfigurationAction.Request indices(String... indices)
      Sets the target indices or data streams for this sampling configuration request.
      Specified by:
      indices in interface IndicesRequest.Replaceable
      Parameters:
      indices - the names of indices or data streams to target
      Returns:
      this request instance for method chaining
    • includeDataStreams

      public boolean includeDataStreams()
      Indicates whether this request should include data streams in addition to regular indices.
      Specified by:
      includeDataStreams in interface IndicesRequest
      Returns:
      true to include data streams
    • indicesOptions

      public IndicesOptions indicesOptions()
      Returns the indices options for this request, which control how index names are resolved and expanded.
      Specified by:
      indicesOptions in interface IndicesRequest
      Returns:
      the indices options, configured to be strict about single index, no expansion, forbid closed indices, and allow selectors
    • getSampleConfiguration

      public SamplingConfiguration getSampleConfiguration()
      Returns the sampling configuration encapsulated by this request.
      Returns:
      the sampling configuration
    • equals

      public boolean equals(Object o)
      Compares this request with another object for equality.

      Two requests are considered equal if they have the same target indices and sampling configuration parameters.

      Overrides:
      equals in class Object
      Parameters:
      o - the object to compare with
      Returns:
      true if the objects are equal, false otherwise
    • hashCode

      public int hashCode()
      Returns the hash code for this request.

      The hash code is computed based on the target indices, sampling configuration, master node timeout, and acknowledgment timeout.

      Overrides:
      hashCode in class Object
      Returns:
      the hash code value