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 DataStream.TimestampFieldcreateTimestampField(String fieldName) static StringgenerateMapping(String timestampFieldName) static StringgenerateMapping(String timestampFieldName, String type) 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, int replicas, boolean replicated) static IndexMetadata.Builderstatic DataStreamnewInstance(String name, DataStream.TimestampField timeStampField, List<Index> indices) static DataStreamnewInstance(String name, DataStream.TimestampField timeStampField, List<Index> indices, long generation, Map<String, Object> metadata) static DataStreamnewInstance(String name, DataStream.TimestampField timeStampField, List<Index> indices, long generation, Map<String, Object> metadata, boolean replicated) static DataStreamAliasstatic DataStreamstatic DataStreamrandomInstance(String name) static DataStreamrandomInstance(String dataStreamName, LongSupplier timeProvider) static DataStreamrandomInstance(LongSupplier timeProvider)
-
Constructor Details
-
DataStreamTestHelper
public DataStreamTestHelper()
-
-
Method Details
-
newInstance
public static DataStream newInstance(String name, DataStream.TimestampField timeStampField, List<Index> indices) -
newInstance
public static DataStream newInstance(String name, DataStream.TimestampField timeStampField, List<Index> indices, long generation, Map<String, Object> metadata) -
newInstance
public static DataStream newInstance(String name, DataStream.TimestampField timeStampField, List<Index> indices, long generation, Map<String, Object> metadata, boolean replicated) -
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
-
createTimestampField
-
generateMapping
-
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
-
backingIndexPattern
-
backingIndexEqualTo
-