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 StringbackingIndexPattern(String dataStreamName, long generation) static IndexMetadata.BuildercreateBackingIndex(String dataStreamName, int generation) static IndexMetadata.BuildercreateBackingIndex(String dataStreamName, int generation, long epochMillis) static IndexMetadata.BuildercreateFirstBackingIndex(String dataStreamName) static IndexMetadata.BuildercreateFirstBackingIndex(String dataStreamName, long epochMillis) static StringgenerateMapping(String timestampFieldName) static StringgenerateMapping(String timestampFieldName, String type) static Stringstatic ClusterStategetClusterStateWithDataStream(String dataStream, List<org.elasticsearch.core.Tuple<Instant, Instant>> timeSlices) static voidgetClusterStateWithDataStream(Metadata.Builder builder, String dataStreamName, List<org.elasticsearch.core.Tuple<Instant, Instant>> timeSlices) static ClusterStategetClusterStateWithDataStreams(List<org.elasticsearch.core.Tuple<String, Integer>> dataStreams, List<String> indexNames) ConstructsClusterStatewith the specified data streams and indices.static ClusterStategetClusterStateWithDataStreams(List<org.elasticsearch.core.Tuple<String, Integer>> dataStreams, List<String> indexNames, int replicas) ConstructsClusterStatewith the specified data streams and indices.static ClusterStategetClusterStateWithDataStreams(List<org.elasticsearch.core.Tuple<String, Integer>> dataStreams, List<String> indexNames, long currentTime, Settings settings, int replicas) static ClusterStategetClusterStateWithDataStreams(List<org.elasticsearch.core.Tuple<String, Integer>> dataStreams, List<String> indexNames, long currentTime, Settings settings, int replicas, boolean replicated) static ClusterStategetClusterStateWithDataStreams(List<org.elasticsearch.core.Tuple<String, Integer>> dataStreams, List<String> indexNames, long currentTime, Settings settings, int replicas, boolean replicated, boolean storeFailures) static voidgetClusterStateWithDataStreams(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 MetadataFieldMapperstatic IndexMetadata.Builderstatic StringgetLegacyDefaultBackingIndexName(String dataStreamName, long generation) static StringgetLegacyDefaultBackingIndexName(String dataStreamName, long generation, long epochMillis, boolean isNewIndexNameFormat) static MetadataRolloverServicegetMetadataRolloverService(DataStream dataStream, ThreadPool testThreadPool, Set<IndexSettingProvider> providers, org.elasticsearch.xcontent.NamedXContentRegistry registry) static IndicesServicemockIndicesServices(MappingLookup mappingLookup) static DataStreamnewInstance(String name, List<Index> indices) static DataStreamstatic DataStreamnewInstance(String name, List<Index> indices, long generation, Map<String, Object> metadata, boolean replicated) static DataStreamnewInstance(String name, List<Index> indices, long generation, Map<String, Object> metadata, boolean replicated, DataStreamLifecycle lifecycle) static DataStreamnewInstance(String name, List<Index> indices, long generation, Map<String, Object> metadata, boolean replicated, DataStreamLifecycle lifecycle, List<Index> failureStores) static DataStreamAliasstatic DataStreamstatic DataStreamrandomInstance(String name) static DataStreamrandomInstance(String dataStreamName, LongSupplier timeProvider) static DataStreamrandomInstance(LongSupplier timeProvider)
-
Constructor Details
-
DataStreamTestHelper
public DataStreamTestHelper()
-
-
Method Details
-
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, List<Index> failureStores) -
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) -
getIndexMetadataBuilderForIndex
-
generateMapping
-
generateTsdbMapping
-
generateMapping
-
randomIndexInstances
-
randomInstance
-
randomInstance
-
randomInstance
-
randomInstance
-
randomAliasInstance
-
getClusterStateWithDataStreams
public static ClusterState getClusterStateWithDataStreams(List<org.elasticsearch.core.Tuple<String, Integer>> dataStreams, List<String> indexNames) ConstructsClusterStatewith 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) ConstructsClusterStatewith 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) -
backingIndexPattern
-
backingIndexEqualTo
-
getMetadataRolloverService
public static MetadataRolloverService getMetadataRolloverService(DataStream dataStream, ThreadPool testThreadPool, Set<IndexSettingProvider> providers, org.elasticsearch.xcontent.NamedXContentRegistry registry) throws Exception - Throws:
Exception
-
getDataStreamTimestampFieldMapper
-
mockIndicesServices
- Throws:
Exception
-