Class DataStreamGlobalRetentionSettings

java.lang.Object
org.elasticsearch.cluster.metadata.DataStreamGlobalRetentionSettings

public class DataStreamGlobalRetentionSettings extends Object
This class holds the data stream global retention settings. It defines, validates and monitors the settings.

The global retention settings apply to non-system data streams that are managed by the data stream lifecycle. They consist of: - The default retention which applies to the backing indices of data streams that do not have a retention defined. - The max retention which applies to backing and failure indices of data streams that do not have retention or their retention has exceeded this value. - The failures default retention which applied to the failure indices of data streams that do not have retention defined.

  • Field Details

    • MIN_RETENTION_VALUE

      public static final TimeValue MIN_RETENTION_VALUE
    • DATA_STREAMS_DEFAULT_RETENTION_SETTING

      public static final Setting<TimeValue> DATA_STREAMS_DEFAULT_RETENTION_SETTING
    • DATA_STREAMS_MAX_RETENTION_SETTING

      public static final Setting<TimeValue> DATA_STREAMS_MAX_RETENTION_SETTING
    • FAILURE_STORE_DEFAULT_RETENTION_SETTING

      public static final Setting<TimeValue> FAILURE_STORE_DEFAULT_RETENTION_SETTING
  • Method Details

    • getMaxRetention

      @Nullable public TimeValue getMaxRetention()
      Returns:
      the max retention that applies to all data stream data
    • getDefaultRetention

      @Nullable public TimeValue getDefaultRetention()
      Returns:
      the default retention that applies either to the data component
    • getDefaultRetention

      @Nullable public TimeValue getDefaultRetention(boolean failureStore)
      Returns:
      the default retention that applies either to the data or the failures component
    • create

      public static DataStreamGlobalRetentionSettings create(ClusterSettings clusterSettings)
      Creates an instance and initialises the cluster settings listeners
      Parameters:
      clusterSettings - it will register the cluster settings listeners to monitor for changes
    • get

      Returns:
      the global retention of backing indices
    • get

      @Nullable public DataStreamGlobalRetention get(boolean failureStore)
      Returns the global retention that applies to the data or failures of a data stream
      Parameters:
      failureStore - , true if we are retrieving the global retention that applies to failure store, false otherwise.