Record Class DataStreamLifecycle.DownsamplingRound

java.lang.Object
java.lang.Record
org.elasticsearch.cluster.metadata.DataStreamLifecycle.DownsamplingRound
Record Components:
after - is a TimeValue configuring how old (based on generation age) should a backing index be before downsampling
fixedInterval - contains the interval that the backing index is going to be downsampled.
All Implemented Interfaces:
Writeable, ToXContent, ToXContentObject
Enclosing class:
DataStreamLifecycle

public static record DataStreamLifecycle.DownsamplingRound(TimeValue after, DateHistogramInterval fixedInterval) extends Record implements Writeable, ToXContentObject
A round represents the configuration for when and how elasticsearch will downsample a backing index.
  • Field Details

    • AFTER_FIELD

      public static final ParseField AFTER_FIELD
    • FIXED_INTERVAL_FIELD

      public static final ParseField FIXED_INTERVAL_FIELD
    • FIVE_MINUTES_MILLIS

      public static final long FIVE_MINUTES_MILLIS
  • Constructor Details

    • DownsamplingRound

      public DownsamplingRound(TimeValue after, DateHistogramInterval fixedInterval)
      Creates an instance of a DownsamplingRound record class.
      Parameters:
      after - the value for the after record component
      fixedInterval - the value for the fixedInterval record component
  • Method Details

    • validateRoundsIncorrectly

      @Deprecated(since="8.19.12,9.3.1,9.4.0") public static void validateRoundsIncorrectly(List<DataStreamLifecycle.DownsamplingRound> rounds)
      Deprecated.
      Validates the downsampling rounds, but incorrectly. By "incorrectly" we mean that it only checks that the rounds are multiples of the _first_ downsampling round's interval, instead of being a multiple of the _previous_ downsampling round's interval. However, there may be instances of an invalid configuration already stored on disk in cluster state in the template or data stream metadata. This method remains as the "old" version of the validation. Use validateRounds(List) to validate with the correct behavior.
    • validateRounds

      public static void validateRounds(List<DataStreamLifecycle.DownsamplingRound> rounds)
      Validates that the downsampling rounds are non-empty, there are fewer than 10 present, and that each round's `fixed_interval` is a multiple of the previous round's interval.
    • read

      Throws:
      IOException
    • writeTo

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

      public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface ToXContent
      Throws:
      IOException
    • fromXContent

      public static DataStreamLifecycle.DownsamplingRound fromXContent(XContentParser parser, Void context) throws IOException
      Throws:
      IOException
    • toString

      public String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • after

      public TimeValue after()
      Returns the value of the after record component.
      Returns:
      the value of the after record component
    • fixedInterval

      public DateHistogramInterval fixedInterval()
      Returns the value of the fixedInterval record component.
      Returns:
      the value of the fixedInterval record component