Module org.elasticsearch.server
Class DataStreamGlobalRetention
java.lang.Object
org.elasticsearch.cluster.AbstractNamedDiffable<ClusterState.Custom>
org.elasticsearch.cluster.metadata.DataStreamGlobalRetention
- All Implemented Interfaces:
ClusterState.Custom
,Diffable<ClusterState.Custom>
,NamedDiffable<ClusterState.Custom>
,NamedWriteable
,VersionedNamedWriteable
,Writeable
,ChunkedToXContent
public final class DataStreamGlobalRetention
extends AbstractNamedDiffable<ClusterState.Custom>
implements ClusterState.Custom
A cluster state entry that contains global retention settings that are configurable by the user. These settings include:
- default retention, applied on any data stream managed by DSL that does not have an explicit retention defined
- max retention, applied on every data stream managed by DSL
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ParseField
static final DataStreamGlobalRetention
static final NodeFeature
static final ParseField
static final TimeValue
static final String
-
Constructor Summary
ConstructorsConstructorDescriptionDataStreamGlobalRetention
(TimeValue defaultRetention, TimeValue maxRetention) -
Method Summary
Modifier and TypeMethodDescriptionboolean
static DataStreamGlobalRetention
getFromClusterState
(ClusterState clusterState) Returns the metadata found in the cluster state or null.The minimal version of the recipient this object can be sent toReturns the name of the writeable objectint
hashCode()
static DataStreamGlobalRetention
read
(StreamInput in) static NamedDiff<ClusterState.Custom>
toString()
Iterator<? extends ToXContent>
toXContentChunked
(ToXContent.Params ignored) Serialize thisClusterState.Custom
for diagnostic purposes, exposed by thetoXContentFragment
(XContentBuilder builder, ToXContent.Params params) Adds to the XContentBuilder the two fields when they are not null.void
writeTo
(StreamOutput out) Write this into the StreamOutput.Methods inherited from class org.elasticsearch.cluster.AbstractNamedDiffable
diff, get, readDiffFrom
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.elasticsearch.common.xcontent.ChunkedToXContent
isFragment, toXContentChunkedV7
Methods inherited from interface org.elasticsearch.cluster.ClusterState.Custom
isPrivate
-
Field Details
-
TYPE
- See Also:
-
GLOBAL_RETENTION
-
DEFAULT_RETENTION_FIELD
-
MAX_RETENTION_FIELD
-
EMPTY
-
MIN_RETENTION_VALUE
-
-
Constructor Details
-
DataStreamGlobalRetention
- Parameters:
defaultRetention
- the default retention or null if it's undefinedmaxRetention
- the max retention or null if it's undefined- Throws:
IllegalArgumentException
- when the default retention is greater than the max retention.
-
-
Method Details
-
read
- Throws:
IOException
-
getWriteableName
Description copied from interface:VersionedNamedWriteable
Returns the name of the writeable object- Specified by:
getWriteableName
in interfaceNamedWriteable
- Specified by:
getWriteableName
in interfaceVersionedNamedWriteable
-
getMinimalSupportedVersion
Description copied from interface:VersionedNamedWriteable
The minimal version of the recipient this object can be sent to- Specified by:
getMinimalSupportedVersion
in interfaceVersionedNamedWriteable
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Throws:
IOException
-
readDiffFrom
- Throws:
IOException
-
toXContentChunked
Description copied from interface:ClusterState.Custom
Serialize thisClusterState.Custom
for diagnostic purposes, exposed by theGET _cluster/state
API etc. The XContent representation does not need to be 100% faithful since we never reconstruct a cluster state from its XContent representation, but the more faithful it is the more useful it is for diagnostics.- Specified by:
toXContentChunked
in interfaceChunkedToXContent
- Specified by:
toXContentChunked
in interfaceClusterState.Custom
- Returns:
- iterator over chunks of
ToXContent
-
toXContentFragment
public XContentBuilder toXContentFragment(XContentBuilder builder, ToXContent.Params params) throws IOException Adds to the XContentBuilder the two fields when they are not null.- Throws:
IOException
-
getFromClusterState
Returns the metadata found in the cluster state or null. -
getDefaultRetention
-
getMaxRetention
-
equals
-
hashCode
public int hashCode() -
toString
-