Class DataStreamTestHelper
java.lang.Object
org.elasticsearch.cluster.metadata.DataStreamTestHelper
-
Constructor Summary
-
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 IndexMetadata.Builder
createFirstBackingIndex
(String dataStreamName) static IndexMetadata.Builder
createFirstBackingIndex
(String dataStreamName, long epochMillis) 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 dataStream, 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 MetadataFieldMapper
static IndexMetadata.Builder
static String
getLegacyDefaultBackingIndexName
(String dataStreamName, long generation) static String
getLegacyDefaultBackingIndexName
(String dataStreamName, long generation, long epochMillis, Version minNodeVersion) static MetadataRolloverService
getMetadataRolloverService
(DataStream dataStream, ThreadPool testThreadPool, Set<IndexSettingProvider> providers, org.elasticsearch.xcontent.NamedXContentRegistry registry) 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 DataStreamAlias
static DataStream
static DataStream
randomInstance
(String name) static DataStream
randomInstance
(String dataStreamName, LongSupplier timeProvider) static DataStream
randomInstance
(LongSupplier timeProvider)
-
Constructor Details
-
DataStreamTestHelper
public DataStreamTestHelper()
-
-
Method Details
-
newInstance
-
newInstance
-
newInstance
-
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) 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
-
getClusterStateWithDataStream
public static ClusterState getClusterStateWithDataStream(String dataStream, List<org.elasticsearch.core.Tuple<Instant, Instant>> timeSlices) -
getClusterStateWithDataStream
public static void getClusterStateWithDataStream(Metadata.Builder builder, String dataStream, 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
-