Module org.elasticsearch.server
Class DataStreamLifecycle
java.lang.Object
org.elasticsearch.cluster.metadata.DataStreamLifecycle
- All Implemented Interfaces:
Diffable<DataStreamLifecycle>
,SimpleDiffable<DataStreamLifecycle>
,Writeable
,ToXContent
,ToXContentObject
public class DataStreamLifecycle
extends Object
implements SimpleDiffable<DataStreamLifecycle>, ToXContentObject
Holds the data stream lifecycle metadata that are configuring how a data stream is managed. Currently, it supports the following
configurations:
- enabled
- data retention
- downsampling
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
This builder helps during the composition of the data stream lifecycle templates.static final record
Downsampling holds the configuration about when should elasticsearch downsample a backing index.static final record
Retention is the least amount of time that the data will be kept by elasticsearch.Nested classes/interfaces inherited from interface org.elasticsearch.cluster.SimpleDiffable
SimpleDiffable.CompleteDiff<T extends Diffable<T>>
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TransportVersion
static final Setting<RolloverConfiguration>
static final ParseField
static final String
static final String
static final DataStreamLifecycle
static final ParseField
static final ParseField
static final ConstructingObjectParser<DataStreamLifecycle,
Void> Fields inherited from interface org.elasticsearch.cluster.SimpleDiffable
EMPTY
Fields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS
-
Constructor Summary
ConstructorsConstructorDescriptionDataStreamLifecycle
(DataStreamLifecycle.Retention dataRetention, DataStreamLifecycle.Downsampling downsampling, Boolean enabled) -
Method Summary
Modifier and TypeMethodDescriptionboolean
static DataStreamLifecycle
fromXContent
(XContentParser parser) The configured downsampling rounds with the `after` and the `fixed_interval` per round.The least amount of time data should be kept by elasticsearch.int
hashCode()
static boolean
isDataStreamsLifecycleOnlyMode
(Settings settings) Check ifDATA_STREAMS_LIFECYCLE_ONLY_SETTING_NAME
is present and set totrue
, indicating that we're running in a cluster configuration that is only expecting to use data streams lifecycles.boolean
Returns true, if this data stream lifecycle configuration is enabled and false otherwisestatic DataStreamLifecycle.Builder
static DataStreamLifecycle.Builder
newBuilder
(DataStreamLifecycle lifecycle) static Diff<DataStreamLifecycle>
toString()
toXContent
(XContentBuilder builder, ToXContent.Params params) toXContent
(XContentBuilder builder, ToXContent.Params params, RolloverConfiguration rolloverConfiguration) Converts the data stream lifecycle to XContent and injects the RolloverConditions if they exist.void
writeTo
(StreamOutput out) Write this into the StreamOutput.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.elasticsearch.cluster.SimpleDiffable
diff
Methods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Field Details
-
ADDED_ENABLED_FLAG_VERSION
-
DATA_STREAMS_LIFECYCLE_ONLY_SETTING_NAME
- See Also:
-
CLUSTER_LIFECYCLE_DEFAULT_ROLLOVER_SETTING
-
DEFAULT
-
DATA_STREAM_LIFECYCLE_ORIGIN
- See Also:
-
ENABLED_FIELD
-
DATA_RETENTION_FIELD
-
DOWNSAMPLING_FIELD
-
PARSER
-
-
Constructor Details
-
DataStreamLifecycle
public DataStreamLifecycle() -
DataStreamLifecycle
public DataStreamLifecycle(@Nullable DataStreamLifecycle.Retention dataRetention, @Nullable DataStreamLifecycle.Downsampling downsampling, @Nullable Boolean enabled) -
DataStreamLifecycle
- Throws:
IOException
-
-
Method Details
-
isDataStreamsLifecycleOnlyMode
Check ifDATA_STREAMS_LIFECYCLE_ONLY_SETTING_NAME
is present and set totrue
, indicating that we're running in a cluster configuration that is only expecting to use data streams lifecycles.- Parameters:
settings
- the node settings- Returns:
- true if
DATA_STREAMS_LIFECYCLE_ONLY_SETTING_NAME
is present and set
-
isEnabled
public boolean isEnabled()Returns true, if this data stream lifecycle configuration is enabled and false otherwise -
getEffectiveDataRetention
The least amount of time data should be kept by elasticsearch.- Returns:
- the time period or null, null represents that data should never be deleted.
-
getDownsamplingRounds
The configured downsampling rounds with the `after` and the `fixed_interval` per round. If downsampling is not configured then it returns null. -
equals
-
hashCode
public int hashCode() -
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Throws:
IOException
-
readDiffFrom
- Throws:
IOException
-
toString
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContent
in interfaceToXContent
- Throws:
IOException
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params, @Nullable RolloverConfiguration rolloverConfiguration) throws IOException Converts the data stream lifecycle to XContent and injects the RolloverConditions if they exist.- Throws:
IOException
-
fromXContent
- Throws:
IOException
-
newBuilder
-
newBuilder
-