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 classThis builder helps during the composition of the data stream lifecycle templates.static final recordDownsampling holds the configuration about when should elasticsearch downsample a backing index.static final recordRetention 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.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TransportVersionstatic final Setting<RolloverConfiguration>static final ParseFieldstatic final Stringstatic final Stringstatic final DataStreamLifecyclestatic final ParseFieldstatic final ParseFieldstatic final ConstructingObjectParser<DataStreamLifecycle,Void> Fields inherited from interface org.elasticsearch.cluster.SimpleDiffable
EMPTYFields 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 TypeMethodDescriptionbooleanstatic DataStreamLifecyclefromXContent(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.inthashCode()static booleanisDataStreamsLifecycleOnlyMode(Settings settings) Check ifDATA_STREAMS_LIFECYCLE_ONLY_SETTING_NAMEis present and set totrue, indicating that we're running in a cluster configuration that is only expecting to use data streams lifecycles.booleanReturns true, if this data stream lifecycle configuration is enabled and false otherwisestatic DataStreamLifecycle.Builderstatic DataStreamLifecycle.BuildernewBuilder(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.voidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.cluster.SimpleDiffable
diffMethods 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_NAMEis 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_NAMEis 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:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
readDiffFrom
- Throws:
IOException
-
toString
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContentin 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
-