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 DataStream.TimestampField
createTimestampField
(String fieldName) static String
generateMapping
(String timestampFieldName) static String
generateMapping
(String timestampFieldName, String type) 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, int replicas, boolean replicated) static IndexMetadata.Builder
static DataStream
newInstance
(String name, DataStream.TimestampField timeStampField, List<Index> indices) static DataStream
newInstance
(String name, DataStream.TimestampField timeStampField, List<Index> indices, long generation, Map<String, Object> metadata) static DataStream
newInstance
(String name, DataStream.TimestampField timeStampField, 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
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) 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
-
backingIndexPattern
-
backingIndexEqualTo
-