Class DataStreamTestHelper
java.lang.Object
org.elasticsearch.cluster.metadata.DataStreamTestHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.hamcrest.Matcher
<String> backingIndexEqualTo
(String dataStreamName, int generation) static String
backingIndexPattern
(String dataStreamName, long generation) static IndexMetadata.Builder
createBackingIndex
(String dataStreamName, int generation) static IndexMetadata.Builder
createBackingIndex
(String dataStreamName, int generation, long epochMillis) static DataStreamOptions.Template
createDataStreamOptionsTemplate
(Boolean failureStore) static IndexMetadata.Builder
createFailureStore
(String dataStreamName, int generation) static IndexMetadata.Builder
createFailureStore
(String dataStreamName, int generation, long epochMillis) static IndexMetadata.Builder
createFirstBackingIndex
(String dataStreamName) static IndexMetadata.Builder
createFirstBackingIndex
(String dataStreamName, long epochMillis) static IndexMetadata.Builder
createFirstFailureStore
(String dataStreamName) static IndexMetadata.Builder
createFirstFailureStore
(String dataStreamName, long epochMillis) static IndexMetadata
createIndexMetadata
(String name, boolean hidden, Settings settings, int replicas) static String
generateMapping
(String timestampFieldName) static String
generateMapping
(String timestampFieldName, String type) static String
static ClusterState
getClusterStateWithDataStream
(String dataStream, List<org.elasticsearch.core.Tuple<Instant, Instant>> timeSlices) static void
getClusterStateWithDataStream
(Metadata.Builder builder, String dataStreamName, List<org.elasticsearch.core.Tuple<Instant, Instant>> timeSlices) static ClusterState
getClusterStateWithDataStreams
(List<org.elasticsearch.core.Tuple<String, Integer>> dataStreams, List<String> indexNames) ConstructsClusterState
with the specified data streams and indices.static ClusterState
getClusterStateWithDataStreams
(List<org.elasticsearch.core.Tuple<String, Integer>> dataStreams, List<String> indexNames, int replicas) ConstructsClusterState
with the specified data streams and indices.static ClusterState
getClusterStateWithDataStreams
(List<org.elasticsearch.core.Tuple<String, Integer>> dataStreams, List<String> indexNames, long currentTime, Settings settings, int replicas) static ClusterState
getClusterStateWithDataStreams
(List<org.elasticsearch.core.Tuple<String, Integer>> dataStreams, List<String> indexNames, long currentTime, Settings settings, int replicas, boolean replicated) static ClusterState
getClusterStateWithDataStreams
(List<org.elasticsearch.core.Tuple<String, Integer>> dataStreams, List<String> indexNames, long currentTime, Settings settings, int replicas, boolean replicated, boolean storeFailures) static void
getClusterStateWithDataStreams
(Metadata.Builder builder, List<org.elasticsearch.core.Tuple<String, Integer>> dataStreams, List<String> indexNames, long currentTime, Settings settings, int replicas, boolean replicated, Boolean storeFailures) static MetadataFieldMapper
static IndexMetadata.Builder
static String
getLegacyDefaultBackingIndexName
(String dataStreamName, long generation) static String
getLegacyDefaultBackingIndexName
(String dataStreamName, long generation, long epochMillis) static MetadataRolloverService
getMetadataRolloverService
(DataStream dataStream, ThreadPool testThreadPool, Set<IndexSettingProvider> providers, org.elasticsearch.xcontent.NamedXContentRegistry registry, TelemetryProvider telemetryProvider) static IndicesService
mockIndicesServices
(MappingLookup mappingLookup) static DataStream
newInstance
(String name, List<Index> indices) static DataStream
static DataStream
newInstance
(String name, List<Index> indices, long generation, Map<String, Object> metadata, boolean replicated) static DataStream
newInstance
(String name, List<Index> indices, long generation, Map<String, Object> metadata, boolean replicated, DataStreamLifecycle lifecycle) static DataStream
newInstance
(String name, List<Index> indices, long generation, Map<String, Object> metadata, boolean replicated, DataStreamLifecycle lifecycle, List<Index> failureStores) static DataStream
newInstance
(String name, List<Index> indices, long generation, Map<String, Object> metadata, boolean replicated, DataStreamLifecycle lifecycle, List<Index> failureStores, DataStreamOptions dataStreamOptions) static DataStream
newInstance
(String name, List<Index> indices, long generation, Map<String, Object> metadata, boolean replicated, DataStreamLifecycle lifecycle, DataStreamAutoShardingEvent autoShardingEvent) static DataStream
static DataStreamAlias
static DataStreamGlobalRetention
randomIndexInstances
(int min, int max) static DataStream
static DataStream
randomInstance
(boolean failureStore) static DataStream
randomInstance
(String name) static DataStream
randomInstance
(String dataStreamName, LongSupplier timeProvider, boolean failureStore) static DataStream
randomInstance
(String dataStreamName, LongSupplier timeProvider, boolean failureStore, boolean system) static DataStream
randomInstance
(LongSupplier timeProvider) static DataStream
randomInstance
(LongSupplier timeProvider, boolean failureStore)
-
Constructor Details
-
DataStreamTestHelper
public DataStreamTestHelper()
-
-
Method Details
-
newInstance
-
newInstance
-
newInstance
-
newInstance
-
newInstance
public static DataStream newInstance(String name, List<Index> indices, long generation, Map<String, Object> metadata, boolean replicated, @Nullable DataStreamLifecycle lifecycle) -
newInstance
public static DataStream newInstance(String name, List<Index> indices, long generation, Map<String, Object> metadata, boolean replicated, @Nullable DataStreamLifecycle lifecycle, @Nullable DataStreamAutoShardingEvent autoShardingEvent) -
newInstance
public static DataStream newInstance(String name, List<Index> indices, long generation, Map<String, Object> metadata, boolean replicated, @Nullable DataStreamLifecycle lifecycle, List<Index> failureStores) -
newInstance
public static DataStream newInstance(String name, List<Index> indices, long generation, Map<String, Object> metadata, boolean replicated, DataStreamLifecycle lifecycle, List<Index> failureStores, DataStreamOptions dataStreamOptions) -
getLegacyDefaultBackingIndexName
-
getLegacyDefaultBackingIndexName
-
createFirstBackingIndex
-
createFirstBackingIndex
public static IndexMetadata.Builder createFirstBackingIndex(String dataStreamName, long epochMillis) -
createBackingIndex
-
createBackingIndex
public static IndexMetadata.Builder createBackingIndex(String dataStreamName, int generation, long epochMillis) -
createFirstFailureStore
-
createFirstFailureStore
public static IndexMetadata.Builder createFirstFailureStore(String dataStreamName, long epochMillis) -
createFailureStore
-
createFailureStore
public static IndexMetadata.Builder createFailureStore(String dataStreamName, int generation, long epochMillis) -
getIndexMetadataBuilderForIndex
-
generateMapping
-
generateTsdbMapping
-
generateMapping
-
randomIndexInstances
- Returns:
- a list of random indices. NOTE: the list can be empty, if you do not want an empty list use
randomNonEmptyIndexInstances()
-
randomNonEmptyIndexInstances
-
randomIndexInstances
-
randomInstance
-
randomInstance
-
randomInstance
-
randomInstance
-
randomInstance
-
randomInstance
public static DataStream randomInstance(String dataStreamName, LongSupplier timeProvider, boolean failureStore) -
randomInstance
public static DataStream randomInstance(String dataStreamName, LongSupplier timeProvider, boolean failureStore, boolean system) -
randomAliasInstance
-
randomGlobalRetention
-
getClusterStateWithDataStreams
public static ClusterState getClusterStateWithDataStreams(List<org.elasticsearch.core.Tuple<String, Integer>> dataStreams, List<String> indexNames) ConstructsClusterState
with the specified data streams and indices.- Parameters:
dataStreams
- The names of the data streams to create with their respective number of backing indicesindexNames
- The names of indices to create that do not back any data streams
-
getClusterStateWithDataStreams
public static ClusterState getClusterStateWithDataStreams(List<org.elasticsearch.core.Tuple<String, Integer>> dataStreams, List<String> indexNames, int replicas) ConstructsClusterState
with the specified data streams and indices.- Parameters:
dataStreams
- The names of the data streams to create with their respective number of backing indicesindexNames
- The names of indices to create that do not back any data streamsreplicas
- number of replicas
-
getClusterStateWithDataStreams
-
getClusterStateWithDataStreams
-
getClusterStateWithDataStreams
-
getClusterStateWithDataStreams
-
getClusterStateWithDataStream
public static ClusterState getClusterStateWithDataStream(String dataStream, List<org.elasticsearch.core.Tuple<Instant, Instant>> timeSlices) -
getClusterStateWithDataStream
public static void getClusterStateWithDataStream(Metadata.Builder builder, String dataStreamName, List<org.elasticsearch.core.Tuple<Instant, Instant>> timeSlices) -
createIndexMetadata
public static IndexMetadata createIndexMetadata(String name, boolean hidden, Settings settings, int replicas) -
backingIndexPattern
-
backingIndexEqualTo
-
getMetadataRolloverService
public static MetadataRolloverService getMetadataRolloverService(DataStream dataStream, ThreadPool testThreadPool, Set<IndexSettingProvider> providers, org.elasticsearch.xcontent.NamedXContentRegistry registry, TelemetryProvider telemetryProvider) throws Exception - Throws:
Exception
-
getDataStreamTimestampFieldMapper
-
mockIndicesServices
- Throws:
Exception
-
createDataStreamOptionsTemplate
-