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 org.elasticsearch.cluster.metadata.IndexMetadata.Builder
createBackingIndex
(String dataStreamName, int generation) static org.elasticsearch.cluster.metadata.IndexMetadata.Builder
createBackingIndex
(String dataStreamName, int generation, long epochMillis) static org.elasticsearch.cluster.metadata.IndexMetadata.Builder
createFirstBackingIndex
(String dataStreamName) static org.elasticsearch.cluster.metadata.IndexMetadata.Builder
createFirstBackingIndex
(String dataStreamName, long epochMillis) static org.elasticsearch.cluster.metadata.DataStream.TimestampField
createTimestampField
(String fieldName) static String
generateMapping
(String timestampFieldName) static String
generateMapping
(String timestampFieldName, String type) static org.elasticsearch.cluster.ClusterState
getClusterStateWithDataStreams
(List<org.elasticsearch.core.Tuple<String, Integer>> dataStreams, List<String> indexNames) ConstructsClusterState
with the specified data streams and indices.static org.elasticsearch.cluster.ClusterState
getClusterStateWithDataStreams
(List<org.elasticsearch.core.Tuple<String, Integer>> dataStreams, List<String> indexNames, int replicas) ConstructsClusterState
with the specified data streams and indices.static org.elasticsearch.cluster.metadata.IndexMetadata.Builder
getIndexMetadataBuilderForIndex
(org.elasticsearch.index.Index index) static String
getLegacyDefaultBackingIndexName
(String dataStreamName, long generation) static String
getLegacyDefaultBackingIndexName
(String dataStreamName, long generation, long epochMillis, org.elasticsearch.Version minNodeVersion) static org.elasticsearch.cluster.metadata.DataStream
newInstance
(String name, org.elasticsearch.cluster.metadata.DataStream.TimestampField timeStampField, List<org.elasticsearch.index.Index> indices) static org.elasticsearch.cluster.metadata.DataStream
newInstance
(String name, org.elasticsearch.cluster.metadata.DataStream.TimestampField timeStampField, List<org.elasticsearch.index.Index> indices, long generation, Map<String, Object> metadata) static org.elasticsearch.cluster.metadata.DataStreamAlias
static List<org.elasticsearch.index.Index>
static org.elasticsearch.cluster.metadata.DataStream
static org.elasticsearch.cluster.metadata.DataStream
randomInstance
(String name) static org.elasticsearch.cluster.metadata.DataStream
randomInstance
(String dataStreamName, LongSupplier timeProvider) static org.elasticsearch.cluster.metadata.DataStream
randomInstance
(LongSupplier timeProvider)
-
Constructor Details
-
DataStreamTestHelper
public DataStreamTestHelper()
-
-
Method Details
-
newInstance
-
newInstance
-
getLegacyDefaultBackingIndexName
-
getLegacyDefaultBackingIndexName
-
createFirstBackingIndex
public static org.elasticsearch.cluster.metadata.IndexMetadata.Builder createFirstBackingIndex(String dataStreamName) -
createFirstBackingIndex
public static org.elasticsearch.cluster.metadata.IndexMetadata.Builder createFirstBackingIndex(String dataStreamName, long epochMillis) -
createBackingIndex
public static org.elasticsearch.cluster.metadata.IndexMetadata.Builder createBackingIndex(String dataStreamName, int generation) -
createBackingIndex
public static org.elasticsearch.cluster.metadata.IndexMetadata.Builder createBackingIndex(String dataStreamName, int generation, long epochMillis) -
getIndexMetadataBuilderForIndex
public static org.elasticsearch.cluster.metadata.IndexMetadata.Builder getIndexMetadataBuilderForIndex(org.elasticsearch.index.Index index) -
createTimestampField
public static org.elasticsearch.cluster.metadata.DataStream.TimestampField createTimestampField(String fieldName) -
generateMapping
-
generateMapping
-
randomIndexInstances
-
randomInstance
public static org.elasticsearch.cluster.metadata.DataStream randomInstance() -
randomInstance
-
randomInstance
public static org.elasticsearch.cluster.metadata.DataStream randomInstance(LongSupplier timeProvider) -
randomInstance
public static org.elasticsearch.cluster.metadata.DataStream randomInstance(String dataStreamName, LongSupplier timeProvider) -
randomAliasInstance
public static org.elasticsearch.cluster.metadata.DataStreamAlias randomAliasInstance() -
getClusterStateWithDataStreams
public static org.elasticsearch.cluster.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 org.elasticsearch.cluster.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
-
backingIndexPattern
-
backingIndexEqualTo
-