java.lang.Object
org.elasticsearch.cluster.metadata.DataLifecycle
- All Implemented Interfaces:
Diffable<DataLifecycle>
,SimpleDiffable<DataLifecycle>
,Writeable
,ToXContent
,ToXContentObject
public class DataLifecycle
extends Object
implements SimpleDiffable<DataLifecycle>, ToXContentObject
Holds the Data Lifecycle Management metadata that are configuring how a data stream is managed.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic 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 Setting<RolloverConfiguration>
static final ParseField
static final String
static final ConstructingObjectParser<DataLifecycle,
Void> Fields inherited from interface org.elasticsearch.cluster.SimpleDiffable
EMPTY
Fields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS
-
Constructor Summary
ConstructorsConstructorDescriptionDataLifecycle
(long timeInMills) DataLifecycle
(DataLifecycle.Retention dataRetention) DataLifecycle
(TimeValue dataRetention) -
Method Summary
Modifier and TypeMethodDescriptionboolean
static DataLifecycle
fromXContent
(XContentParser parser) The least amount of time data should be kept by elasticsearch.int
hashCode()
static boolean
static Diff<DataLifecycle>
toString()
toXContent
(XContentBuilder builder, ToXContent.Params params) toXContent
(XContentBuilder builder, ToXContent.Params params, RolloverConfiguration rolloverConfiguration) Converts the data 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
-
CLUSTER_LIFECYCLE_DEFAULT_ROLLOVER_SETTING
-
DATA_STREAM_LIFECYCLE_ORIGIN
- See Also:
-
DATA_RETENTION_FIELD
-
PARSER
-
-
Constructor Details
-
DataLifecycle
public DataLifecycle() -
DataLifecycle
-
DataLifecycle
-
DataLifecycle
public DataLifecycle(long timeInMills) -
DataLifecycle
- Throws:
IOException
-
-
Method Details
-
isEnabled
public static boolean isEnabled() -
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.
-
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 lifecycle to XContent and injects the RolloverConditions if they exist.- Throws:
IOException
-
fromXContent
- Throws:
IOException
-