java.lang.Object
org.elasticsearch.cluster.metadata.DataStream
- All Implemented Interfaces:
Diffable<DataStream>
,IndexAbstraction
,SimpleDiffable<DataStream>
,Writeable
,ToXContent
,ToXContentObject
public final class DataStream
extends Object
implements SimpleDiffable<DataStream>, ToXContentObject, IndexAbstraction
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
static class
This is a specialised error to capture that a document does not have a valid timestamp to index a document.Nested classes/interfaces inherited from interface org.elasticsearch.cluster.metadata.IndexAbstraction
IndexAbstraction.Alias, IndexAbstraction.ConcreteIndex, IndexAbstraction.Type
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 TransportVersion
static final TransportVersion
static final ParseField
static final ParseField
static final String
static final ParseField
static final DateFormatter
static final ParseField
static final ParseField
static final ParseField
static final FeatureFlag
static final ParseField
static final String
static final ParseField
static final ParseField
static final ParseField
static final ParseField
static final ParseField
static final ParseField
static final ParseField
static final ParseField
static final ParseField
static final ParseField
static final Comparator
<org.apache.lucene.index.LeafReader> static final ParseField
static final String
static final XContentParserConfiguration
Fields inherited from interface org.elasticsearch.cluster.SimpleDiffable
EMPTY
Fields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS
-
Constructor Summary
ConstructorsConstructorDescriptionDataStream
(String name, List<Index> indices, long generation, Map<String, Object> metadata, boolean hidden, boolean replicated, boolean system, boolean allowCustomRouting, IndexMode indexMode, DataStreamLifecycle lifecycle, DataStreamOptions dataStreamOptions, List<Index> failureIndices, boolean rolloverOnWrite, DataStreamAutoShardingEvent autoShardingEvent) -
Method Summary
Modifier and TypeMethodDescriptionaddBackingIndex
(Metadata clusterMetadata, Index index) Adds the specified index as a backing index and returns a newDataStream
instance with the new combination of backing indices.addFailureStoreIndex
(Metadata clusterMetadata, Index index) Adds the specified index as a failure store index and returns a newDataStream
instance with the new combination of failure store indices.static DataStream.Builder
static DataStream.Builder
builder
(String name, DataStream.DataStreamIndices backingIndices) boolean
containsIndex
(String indexName) Returns true if the index name provided belongs to this data stream.copy()
boolean
static DataStream
fromXContent
(XContentParser parser) Returns the latest auto sharding event that happened for this data streamstatic Instant
Modifies the passed Instant object to be used as a bound for a timestamp field in TimeSeries.getDataStreamIndices
(boolean failureStore) static String
getDefaultBackingIndexName
(String dataStreamName, long generation) Generates the name of the index that conforms to the default naming convention for backing indices on data streams given the specified data stream name and generation and the current system time.static String
getDefaultBackingIndexName
(String dataStreamName, long generation, long epochMillis) Generates the name of the index that conforms to the default naming convention for backing indices on data streams given the specified data stream name, generation, and time.static String
getDefaultFailureStoreName
(String dataStreamName, long generation, long epochMillis) Generates the name of the index that conforms to the default naming convention for backing indices on data streams given the specified data stream name, generation, and time.getDownsamplingRoundsFor
(Index index, Function<String, IndexMetadata> indexMetadataSupplier, LongSupplier nowSupplier) Returns a list of downsampling rounds this index is eligible for (based on the rounds `after` configuration) or an empty list if this data streams' lifecycle doesn't have downsampling configured or the index's generation age doesn't yet match any `after` downsampling configuration.getFailureIndices
(Metadata ignored) It retrieves the failure indices of an index abstraction given it supports the failure store.long
getGenerationLifecycleDate
(IndexMetadata indexMetadata) Returns the generation date of the index whose metadata is passed.getIndicesPastRetention
(Function<String, IndexMetadata> indexMetadataSupplier, LongSupplier nowSupplier, DataStreamGlobalRetention globalRetention) Iterate over the backing indices and return the ones that are managed by the data stream lifecycle and past the configured retention in their lifecycle.getIndicesWithinMaxAgeRange
(DataStream dataStream, Function<Index, IndexMetadata> indexProvider, TimeValue maxIndexAge, LongSupplier nowSupplier) Returns the indices created within the interval.getName()
getNonWriteIndicesOlderThan
(TimeValue retentionPeriod, Function<String, IndexMetadata> indexMetadataSupplier, Predicate<IndexMetadata> indicesPredicate, LongSupplier nowSupplier) Returns the non-write backing indices and failure store indices that are older than the provided age, excluding the write indices.getType()
getWriteFailureIndex
(Metadata metadata) A write failure index is a dedicated concrete index, that accepts all the new documents that belong to the failure store of an index abstraction.A write index is a dedicated concrete index, that accepts all the new documents that belong to an index abstraction.getWriteIndex
(IndexRequest request, Metadata metadata) int
hashCode()
boolean
boolean
boolean
isFailureStoreEffectivelyEnabled
(DataStreamFailureStoreSettings dataStreamFailureStoreSettings) Returns whether this data stream has its failure store enabled, either explicitly in its metadata or implicitly via settings.static boolean
isFailureStoreEffectivelyEnabled
(DataStreamOptions options, DataStreamFailureStoreSettings dataStreamFailureStoreSettings, String name, SystemIndices systemIndices) Returns whether a data stream has its failure store enabled, either explicitly in its metadata or implicitly via settings, based on the given parameters.boolean
Determines whether this data stream has its failure store enabled explicitly in its metadata.static boolean
boolean
isFailureStoreIndex
(String indexName) Returns true if the index name provided belongs to a failure store index.boolean
isHidden()
boolean
isIndexManagedByDataStreamLifecycle
(Index index, Function<String, IndexMetadata> indexMetadataSupplier) Checks if the provided backing index is managed by the data stream lifecycle as part of this data stream.boolean
We define that a data stream is considered internal either if it is a system index or if its name starts with a dot.boolean
Determines whether this data stream is replicated from elsewhere, for example a remote clusterboolean
isSystem()
nextWriteIndexAndGeneration
(Metadata clusterMetadata, DataStream.DataStreamIndices dataStreamIndices) Generates the next write index name andgeneration
to be used for rolling over this data stream.static DataStream
read
(StreamInput in) static Diff
<DataStream> removeBackingIndex
(Index index) Removes the specified backing index and returns a newDataStream
instance with the remaining backing indices.removeFailureStoreIndex
(Index index) Removes the specified failure store index and returns a newDataStream
instance with the remaining failure store indices.replaceBackingIndex
(Index existingBackingIndex, Index newBackingIndex) Replaces the specified backing index with a new index and returns a newDataStream
instance with the modified backing indices.replaceFailureStoreIndex
(Index existingFailureIndex, Index newFailureIndex) Replaces the specified failure store index with a new index and returns a newDataStream
instance with the modified backing indices.static DataStream
resolveDataStream
(IndexAbstraction indexAbstraction, Metadata metadata) Resolve the index abstraction to a data stream.rollover
(Index writeIndex, long generation, IndexMode indexModeFromTemplate, DataStreamAutoShardingEvent autoShardingEvent) Performs a rollover on aDataStream
instance and returns a new instance containing the updated list of backing indices and incremented generation.rolloverFailureStore
(Index writeIndex, long generation) Performs a rollover on the failure store of aDataStream
instance and returns a new instance containing the updated list of failure store indices and incremented generation.boolean
selectTimeSeriesWriteIndex
(Instant timestamp, Metadata metadata) snapshot
(Set<String> indicesInSnapshot, Metadata.Builder snapshotMetadataBuilder) Reconciles this data stream with a list of indices available in a snapshot.toXContent
(XContentBuilder builder, ToXContent.Params params) toXContent
(XContentBuilder builder, ToXContent.Params params, RolloverConfiguration rolloverConfiguration, DataStreamGlobalRetention globalRetention) Converts the data stream to XContent and passes the RolloverConditions, when provided, to the lifecycle.unsafeNextWriteIndexAndGeneration
(Metadata clusterMetadata, DataStream.DataStreamIndices dataStreamIndices) LikenextWriteIndexAndGeneration(Metadata, DataStreamIndices)
, but does no validation, use with care only.unsafeRollover
(Index writeIndex, long generation, IndexMode indexModeFromTemplate, DataStreamAutoShardingEvent autoShardingEvent) Likerollover(Index, long, IndexMode, DataStreamAutoShardingEvent)
, but does no validation, use with care only.unsafeRolloverFailureStore
(Index writeIndex, long generation) LikerolloverFailureStore(Index, long)
, but does no validation, use with care only.void
validate
(Function<String, IndexMetadata> imSupplier) Validates this data stream.void
writeTo
(StreamOutput out) Write this into the StreamOutput.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.elasticsearch.cluster.SimpleDiffable
diff
Methods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Field Details
-
FAILURE_STORE_FEATURE_FLAG
-
ADDED_FAILURE_STORE_TRANSPORT_VERSION
-
ADDED_AUTO_SHARDING_EVENT_VERSION
-
ADD_DATA_STREAM_OPTIONS_VERSION
-
BACKING_INDEX_PREFIX
- See Also:
-
FAILURE_STORE_PREFIX
- See Also:
-
DATE_FORMATTER
-
TIMESTAMP_FIELD_NAME
- See Also:
-
TIMESERIES_LEAF_READERS_SORTER
-
NAME_FIELD
-
TIMESTAMP_FIELD_FIELD
-
INDICES_FIELD
-
GENERATION_FIELD
-
METADATA_FIELD
-
HIDDEN_FIELD
-
REPLICATED_FIELD
-
SYSTEM_FIELD
-
ALLOW_CUSTOM_ROUTING
-
INDEX_MODE
-
LIFECYCLE
-
FAILURE_STORE_FIELD
-
FAILURE_INDICES_FIELD
-
ROLLOVER_ON_WRITE_FIELD
-
AUTO_SHARDING_FIELD
-
FAILURE_ROLLOVER_ON_WRITE_FIELD
-
FAILURE_AUTO_SHARDING_FIELD
-
DATA_STREAM_OPTIONS_FIELD
-
TS_EXTRACT_CONFIG
-
-
Constructor Details
-
DataStream
public DataStream(String name, List<Index> indices, long generation, Map<String, Object> metadata, boolean hidden, boolean replicated, boolean system, boolean allowCustomRouting, IndexMode indexMode, DataStreamLifecycle lifecycle, @Nullable DataStreamOptions dataStreamOptions, List<Index> failureIndices, boolean rolloverOnWrite, @Nullable DataStreamAutoShardingEvent autoShardingEvent)
-
-
Method Details
-
isFailureStoreFeatureFlagEnabled
public static boolean isFailureStoreFeatureFlagEnabled() -
read
- Throws:
IOException
-
getType
- Specified by:
getType
in interfaceIndexAbstraction
- Returns:
- the type of the index abstraction
-
getName
- Specified by:
getName
in interfaceIndexAbstraction
- Returns:
- the name of the index abstraction
-
isDataStreamRelated
public boolean isDataStreamRelated()- Specified by:
isDataStreamRelated
in interfaceIndexAbstraction
- Returns:
- whether this index abstraction is related to data streams
-
getIndices
- Specified by:
getIndices
in interfaceIndexAbstraction
- Returns:
- All
Index
of all concrete indices this index abstraction is referring to.
-
getFailureIndices
Description copied from interface:IndexAbstraction
It retrieves the failure indices of an index abstraction given it supports the failure store.- Specified by:
getFailureIndices
in interfaceIndexAbstraction
- Parameters:
ignored
- certain abstractions require the matadata to lazily retrieve the failure indices.- Returns:
- All concrete failure indices this index abstraction is referring to. If the failure store is not supported, it returns an empty list.
-
getFailureIndices
-
getGeneration
public long getGeneration() -
getWriteIndex
Description copied from interface:IndexAbstraction
A write index is a dedicated concrete index, that accepts all the new documents that belong to an index abstraction.A write index may also be a regular concrete index of a index abstraction and may therefore also be returned by
IndexAbstraction.getIndices()
. An index abstraction may also not have a dedicated write index.- Specified by:
getWriteIndex
in interfaceIndexAbstraction
- Returns:
- the write index of this index abstraction or
null
if this index abstraction doesn't have a write index.
-
getWriteFailureIndex
Description copied from interface:IndexAbstraction
A write failure index is a dedicated concrete index, that accepts all the new documents that belong to the failure store of an index abstraction. Only an index abstraction with trueIndexAbstraction.isDataStreamRelated()
supports a failure store.- Specified by:
getWriteFailureIndex
in interfaceIndexAbstraction
- Parameters:
metadata
- is not necessary for data streams- Returns:
- the write failure index if the failure store is enabled and there is already at least one failure, null otherwise
-
getWriteFailureIndex
- Returns:
- the write failure index if the failure store is enabled and there is already at least one failure, null otherwise
-
isFailureStoreIndex
Returns true if the index name provided belongs to a failure store index. -
containsIndex
Returns true if the index name provided belongs to this data stream. -
getDataStreamOptions
-
rolloverOnWrite
public boolean rolloverOnWrite() -
isInternal
public boolean isInternal()We define that a data stream is considered internal either if it is a system index or if its name starts with a dot. Note: Dot-prefixed internal data streams is a naming convention for internal data streams, but it's not yet enforced.- Returns:
- true if it's a system index or has a dot-prefixed name.
-
selectTimeSeriesWriteIndex
- Parameters:
timestamp
- The timestamp used to select a backing index based on its start and end time.metadata
- The metadata that is used to fetch the start and end times for backing indices of this data stream.- Returns:
- a backing index with a start time that is greater or equal to the provided timestamp and
an end time that is less than the provided timestamp. Otherwise
null
is returned.
-
validate
Validates this data stream. If this is a time series data stream then this method validates that temporal range of backing indices (defined by index.time_series.start_time and index.time_series.end_time) do not overlap with each other.- Parameters:
imSupplier
- Function that suppliesIndexMetadata
instances based on the provided index name
-
getMetadata
-
isHidden
public boolean isHidden()- Specified by:
isHidden
in interfaceIndexAbstraction
- Returns:
- whether this index abstraction is hidden or not
-
isReplicated
public boolean isReplicated()Determines whether this data stream is replicated from elsewhere, for example a remote cluster- Returns:
- Whether this data stream is replicated.
-
isSystem
public boolean isSystem()- Specified by:
isSystem
in interfaceIndexAbstraction
- Returns:
- whether this index abstraction should be treated as a system index or not
-
isAllowCustomRouting
public boolean isAllowCustomRouting() -
isFailureStoreExplicitlyEnabled
public boolean isFailureStoreExplicitlyEnabled()Determines whether this data stream has its failure store enabled explicitly in its metadata. -
isFailureStoreEffectivelyEnabled
public boolean isFailureStoreEffectivelyEnabled(DataStreamFailureStoreSettings dataStreamFailureStoreSettings) Returns whether this data stream has its failure store enabled, either explicitly in its metadata or implicitly via settings.If the failure store is either explicitly enabled or explicitly disabled in its options metadata, that value is returned. If not, it checks whether its name matches one of the patterns in the settings, and that the data stream is not internal (i.e. neither a dot-prefixed nor a system data stream).
- Parameters:
dataStreamFailureStoreSettings
- The settings to use to determine whether the failure store should be implicitly enabled
-
isFailureStoreEffectivelyEnabled
public static boolean isFailureStoreEffectivelyEnabled(@Nullable DataStreamOptions options, DataStreamFailureStoreSettings dataStreamFailureStoreSettings, String name, SystemIndices systemIndices) Returns whether a data stream has its failure store enabled, either explicitly in its metadata or implicitly via settings, based on the given parameters. The logic is equivalent to that inisFailureStoreEffectivelyEnabled(DataStreamFailureStoreSettings)
.- Parameters:
options
- TheDataStreamOptions
for the data stream (which may be null)dataStreamFailureStoreSettings
- The settings to use to determine whether the failure store should be implicitly enabledname
- The name of the data streamsystemIndices
- TheSystemIndices
instance to use to determine whether this is a system data stream
-
getIndexMode
-
getLifecycle
-
getAutoShardingEvent
Returns the latest auto sharding event that happened for this data stream -
getDataComponent
-
getFailureComponent
-
getDataStreamIndices
-
rollover
public DataStream rollover(Index writeIndex, long generation, IndexMode indexModeFromTemplate, @Nullable DataStreamAutoShardingEvent autoShardingEvent) Performs a rollover on aDataStream
instance and returns a new instance containing the updated list of backing indices and incremented generation.- Parameters:
writeIndex
- new write indexgeneration
- new generationindexModeFromTemplate
- the index mode that originates from the template that created this data streamautoShardingEvent
- the auto sharding event this rollover operation is applying- Returns:
- new
DataStream
instance with the rollover operation applied
-
unsafeRollover
public DataStream unsafeRollover(Index writeIndex, long generation, IndexMode indexModeFromTemplate, DataStreamAutoShardingEvent autoShardingEvent) Likerollover(Index, long, IndexMode, DataStreamAutoShardingEvent)
, but does no validation, use with care only. -
rolloverFailureStore
Performs a rollover on the failure store of aDataStream
instance and returns a new instance containing the updated list of failure store indices and incremented generation.- Parameters:
writeIndex
- new failure store write indexgeneration
- new generation- Returns:
- new
DataStream
instance with the rollover operation applied
-
unsafeRolloverFailureStore
LikerolloverFailureStore(Index, long)
, but does no validation, use with care only. -
nextWriteIndexAndGeneration
public Tuple<String,Long> nextWriteIndexAndGeneration(Metadata clusterMetadata, DataStream.DataStreamIndices dataStreamIndices) Generates the next write index name andgeneration
to be used for rolling over this data stream.- Parameters:
clusterMetadata
- Cluster metadatadataStreamIndices
- The data stream indices that we're generating the next write index name and generation for- Returns:
- tuple of the next write index name and next generation.
-
unsafeNextWriteIndexAndGeneration
public Tuple<String,Long> unsafeNextWriteIndexAndGeneration(Metadata clusterMetadata, DataStream.DataStreamIndices dataStreamIndices) LikenextWriteIndexAndGeneration(Metadata, DataStreamIndices)
, but does no validation, use with care only. -
removeBackingIndex
Removes the specified backing index and returns a newDataStream
instance with the remaining backing indices.- Parameters:
index
- the backing index to remove- Returns:
- new
DataStream
instance with the remaining backing indices - Throws:
IllegalArgumentException
- ifindex
is not a backing index or is the current write index of the data stream
-
removeFailureStoreIndex
Removes the specified failure store index and returns a newDataStream
instance with the remaining failure store indices.- Parameters:
index
- the failure store index to remove- Returns:
- new
DataStream
instance with the remaining failure store indices - Throws:
IllegalArgumentException
- ifindex
is not a failure store index or is the current failure store write index of the data stream
-
replaceBackingIndex
Replaces the specified backing index with a new index and returns a newDataStream
instance with the modified backing indices. AnIllegalArgumentException
is thrown if the index to be replaced is not a backing index for this data stream or if it is theDataStream
's write index.- Parameters:
existingBackingIndex
- the backing index to be replacednewBackingIndex
- the new index that will be part of theDataStream
- Returns:
- new
DataStream
instance with backing indices that contain replacement index instead of the specified existing index.
-
replaceFailureStoreIndex
Replaces the specified failure store index with a new index and returns a newDataStream
instance with the modified backing indices. AnIllegalArgumentException
is thrown if the index to be replaced is not a failure store index for this data stream or if it is theDataStream
's failure store write index.- Parameters:
existingFailureIndex
- the failure store index to be replacednewFailureIndex
- the new index that will be part of theDataStream
- Returns:
- new
DataStream
instance with failure store indices that contain replacement index instead of the specified existing index.
-
addBackingIndex
Adds the specified index as a backing index and returns a newDataStream
instance with the new combination of backing indices.- Parameters:
index
- index to add to the data stream- Returns:
- new
DataStream
instance with the added backing index - Throws:
IllegalArgumentException
- ifindex
is ineligible to be a backing index for the data stream
-
addFailureStoreIndex
Adds the specified index as a failure store index and returns a newDataStream
instance with the new combination of failure store indices.- Parameters:
index
- index to add to the data stream's failure store- Returns:
- new
DataStream
instance with the added failure store index - Throws:
IllegalArgumentException
- ifindex
is ineligible to be a failure store index for the data stream
-
promoteDataStream
-
snapshot
@Nullable public DataStream snapshot(Set<String> indicesInSnapshot, Metadata.Builder snapshotMetadataBuilder) Reconciles this data stream with a list of indices available in a snapshot. Allows snapshots to store accurate data stream definitions that do not reference backing indices and failure indices not contained in the snapshot.- Parameters:
indicesInSnapshot
- List of indices in the snapshotsnapshotMetadataBuilder
- a metadata builder with the current view of the snapshot metadata- Returns:
- Reconciled
DataStream
instance ornull
if no reconciled version of this data stream could be built from the given indices
-
getIndicesPastRetention
public List<Index> getIndicesPastRetention(Function<String, IndexMetadata> indexMetadataSupplier, LongSupplier nowSupplier, DataStreamGlobalRetention globalRetention) Iterate over the backing indices and return the ones that are managed by the data stream lifecycle and past the configured retention in their lifecycle. NOTE that this specifically does not return the write index of the data stream as usually retention is treated differently for the write index (i.e. they first need to be rolled over) -
getDownsamplingRoundsFor
public List<DataStreamLifecycle.Downsampling.Round> getDownsamplingRoundsFor(Index index, Function<String, IndexMetadata> indexMetadataSupplier, LongSupplier nowSupplier) Returns a list of downsampling rounds this index is eligible for (based on the rounds `after` configuration) or an empty list if this data streams' lifecycle doesn't have downsampling configured or the index's generation age doesn't yet match any `after` downsampling configuration. An empty list is returned for indices that are not time series. -
getNonWriteIndicesOlderThan
public List<Index> getNonWriteIndicesOlderThan(TimeValue retentionPeriod, Function<String, IndexMetadata> indexMetadataSupplier, @Nullable Predicate<IndexMetadata> indicesPredicate, LongSupplier nowSupplier) Returns the non-write backing indices and failure store indices that are older than the provided age, excluding the write indices. The index age is calculated from the rollover or index creation date (or the origination date if present). If an indices predicate is provided the returned list of indices will be filtered according to the predicate definition. This is useful for things like "return only the backing indices that are managed by the data stream lifecycle". -
isIndexManagedByDataStreamLifecycle
public boolean isIndexManagedByDataStreamLifecycle(Index index, Function<String, IndexMetadata> indexMetadataSupplier) Checks if the provided backing index is managed by the data stream lifecycle as part of this data stream. If the index is not a backing index or a failure store index of this data stream, or we cannot supply its metadata we return false. -
getGenerationLifecycleDate
Returns the generation date of the index whose metadata is passed. The generation date of the index represents the time at which the index started progressing towards the user configurable / business specific parts of the lifecycle (e.g. retention). The generation date is the origination date if it exists, or the rollover date if it exists and the origination date does not, or the creation date if neither the origination date nor the rollover date exist. If the index is the write index the generation date will be null because it is not eligible for retention or other parts of the lifecycle.- Parameters:
indexMetadata
- The metadata of the index whose generation date is returned- Returns:
- The generation date of the index, or null if this is the write index
-
getDefaultBackingIndexName
Generates the name of the index that conforms to the default naming convention for backing indices on data streams given the specified data stream name and generation and the current system time.- Parameters:
dataStreamName
- name of the data streamgeneration
- generation of the data stream- Returns:
- backing index name
-
getDefaultBackingIndexName
public static String getDefaultBackingIndexName(String dataStreamName, long generation, long epochMillis) Generates the name of the index that conforms to the default naming convention for backing indices on data streams given the specified data stream name, generation, and time.- Parameters:
dataStreamName
- name of the data streamgeneration
- generation of the data streamepochMillis
- creation time for the backing index- Returns:
- backing index name
-
getDefaultFailureStoreName
public static String getDefaultFailureStoreName(String dataStreamName, long generation, long epochMillis) Generates the name of the index that conforms to the default naming convention for backing indices on data streams given the specified data stream name, generation, and time.- Parameters:
dataStreamName
- name of the data streamgeneration
- generation of the data streamepochMillis
- creation time for the backing index- Returns:
- backing index name
-
readDiffFrom
- Throws:
IOException
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Throws:
IOException
-
fromXContent
- Throws:
IOException
-
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, @Nullable DataStreamGlobalRetention globalRetention) throws IOException Converts the data stream to XContent and passes the RolloverConditions, when provided, to the lifecycle.- Throws:
IOException
-
equals
-
hashCode
public int hashCode() -
getWriteIndex
- Specified by:
getWriteIndex
in interfaceIndexAbstraction
-
getParentDataStream
- Specified by:
getParentDataStream
in interfaceIndexAbstraction
- Returns:
- the data stream to which this index belongs or
null
if this is not a concrete index or if it is a concrete index that does not belong to a data stream.
-
getIndicesWithinMaxAgeRange
public static List<Index> getIndicesWithinMaxAgeRange(DataStream dataStream, Function<Index, IndexMetadata> indexProvider, TimeValue maxIndexAge, LongSupplier nowSupplier) Returns the indices created within the interval. Note that this strives to cover the entire interval so one backing index created before the specified age will also be return. -
resolveDataStream
Resolve the index abstraction to a data stream. This handles alias resolution as well as data stream resolution. This does NOT resolve a data stream by providing a concrete backing index. -
getCanonicalTimestampBound
Modifies the passed Instant object to be used as a bound for a timestamp field in TimeSeries. It needs to be called in both backing index construction (rollover) and index selection for doc insertion. Failure to do so may lead to errors due to document timestamps exceeding the end time of the selected backing index for insertion.- Parameters:
time
- The initial Instant object that's used to generate the canonical time- Returns:
- A canonical Instant object to be used as a timestamp bound
-
builder
-
builder
-
copy
-