Module org.elasticsearch.server
Record Class DataStreamLifecycle.Template
java.lang.Object
java.lang.Record
org.elasticsearch.cluster.metadata.DataStreamLifecycle.Template
- All Implemented Interfaces:
Writeable,ToXContent,ToXContentObject
- Enclosing class:
DataStreamLifecycle
public static record DataStreamLifecycle.Template(org.elasticsearch.cluster.metadata.DataStreamLifecycle.LifecycleType lifecycleType, boolean enabled, ResettableValue<TimeValue> dataRetention, ResettableValue<List<DataStreamLifecycle.DownsamplingRound>> downsampling)
extends Record
implements ToXContentObject, Writeable
Represents the template configuration of a lifecycle. It supports explicitly resettable values
to allow value reset during template composition.
-
Nested Class Summary
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 DataStreamLifecycle.Templatestatic final ConstructingObjectParser<DataStreamLifecycle.Template, org.elasticsearch.cluster.metadata.DataStreamLifecycle.LifecycleType> Fields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionTemplate(org.elasticsearch.cluster.metadata.DataStreamLifecycle.LifecycleType lifecycleType, boolean enabled, ResettableValue<TimeValue> dataRetention, ResettableValue<List<DataStreamLifecycle.DownsamplingRound>> downsampling) Creates an instance of aTemplaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic DataStreamLifecycle.TemplateReturns the value of thedataRetentionrecord component.Returns the value of thedownsamplingrecord component.booleanenabled()Returns the value of theenabledrecord component.final booleanIndicates whether some other object is "equal to" this one.static DataStreamLifecycle.Templatefinal inthashCode()Returns a hash code value for this object.org.elasticsearch.cluster.metadata.DataStreamLifecycle.LifecycleTypeReturns the value of thelifecycleTyperecord component.static DataStreamLifecycle.Templateread(StreamInput in) final StringtoString()Returns a string representation of this record class.toXContent(XContentBuilder builder, ToXContent.Params params) Converts the template to XContent, depending on the set byResettableValue.hideResetValues(Params)it may or may not display any explicit nulls when the value is to be reset.toXContent(XContentBuilder builder, ToXContent.Params params, RolloverConfiguration rolloverConfiguration, DataStreamGlobalRetention globalRetention, boolean isInternalDataStream) Converts the template to XContent, depending on the set byResettableValue.hideResetValues(Params)it may or may not display any explicit nulls when the value is to be reset.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.xcontent.ToXContentObject
isFragment
-
Field Details
-
DATA_DEFAULT
-
PARSER
public static final ConstructingObjectParser<DataStreamLifecycle.Template,org.elasticsearch.cluster.metadata.DataStreamLifecycle.LifecycleType> PARSER
-
-
Constructor Details
-
Template
public Template(org.elasticsearch.cluster.metadata.DataStreamLifecycle.LifecycleType lifecycleType, boolean enabled, ResettableValue<TimeValue> dataRetention, ResettableValue<List<DataStreamLifecycle.DownsamplingRound>> downsampling) Creates an instance of aTemplaterecord class.- Parameters:
lifecycleType- the value for thelifecycleTyperecord componentenabled- the value for theenabledrecord componentdataRetention- the value for thedataRetentionrecord componentdownsampling- the value for thedownsamplingrecord component
-
-
Method Details
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
read
- Throws:
IOException
-
dataLifecycleTemplatefromXContent
public static DataStreamLifecycle.Template dataLifecycleTemplatefromXContent(XContentParser parser) throws IOException - Throws:
IOException
-
failuresLifecycleTemplatefromXContent
public static DataStreamLifecycle.Template failuresLifecycleTemplatefromXContent(XContentParser parser) throws IOException - Throws:
IOException
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException Converts the template to XContent, depending on the set byResettableValue.hideResetValues(Params)it may or may not display any explicit nulls when the value is to be reset.- Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params, @Nullable RolloverConfiguration rolloverConfiguration, @Nullable DataStreamGlobalRetention globalRetention, boolean isInternalDataStream) throws IOException Converts the template to XContent, depending on the set byResettableValue.hideResetValues(Params)it may or may not display any explicit nulls when the value is to be reset.- Throws:
IOException
-
toDataStreamLifecycle
-
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. -
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. -
equals
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
lifecycleType
public org.elasticsearch.cluster.metadata.DataStreamLifecycle.LifecycleType lifecycleType()Returns the value of thelifecycleTyperecord component.- Returns:
- the value of the
lifecycleTyperecord component
-
enabled
public boolean enabled()Returns the value of theenabledrecord component.- Returns:
- the value of the
enabledrecord component
-
dataRetention
Returns the value of thedataRetentionrecord component.- Returns:
- the value of the
dataRetentionrecord component
-
downsampling
Returns the value of thedownsamplingrecord component.- Returns:
- the value of the
downsamplingrecord component
-