Class DataStreamTestHelper
java.lang.Object
org.elasticsearch.cluster.metadata.DataStreamTestHelper
public final class DataStreamTestHelper
extends java.lang.Object
-
Constructor Summary
Constructors Constructor Description DataStreamTestHelper() -
Method Summary
Modifier and Type Method Description static java.lang.StringbackingIndexPattern(java.lang.String dataStreamName, long generation)static org.elasticsearch.cluster.metadata.IndexMetadata.BuildercreateBackingIndex(java.lang.String dataStreamName, int generation)static org.elasticsearch.cluster.metadata.IndexMetadata.BuildercreateBackingIndex(java.lang.String dataStreamName, int generation, long epochMillis)static org.elasticsearch.cluster.metadata.IndexMetadata.BuildercreateFirstBackingIndex(java.lang.String dataStreamName)static org.elasticsearch.cluster.metadata.IndexMetadata.BuildercreateFirstBackingIndex(java.lang.String dataStreamName, long epochMillis)static org.elasticsearch.cluster.metadata.DataStream.TimestampFieldcreateTimestampField(java.lang.String fieldName)static java.lang.StringgenerateMapping(java.lang.String timestampFieldName)static java.lang.StringgenerateMapping(java.lang.String timestampFieldName, java.lang.String type)static org.elasticsearch.cluster.ClusterStategetClusterStateWithDataStreams(java.util.List<org.elasticsearch.common.collect.Tuple<java.lang.String,java.lang.Integer>> dataStreams, java.util.List<java.lang.String> indexNames)ConstructsClusterStatewith the specified data streams and indices.static org.elasticsearch.cluster.ClusterStategetClusterStateWithDataStreams(java.util.List<org.elasticsearch.common.collect.Tuple<java.lang.String,java.lang.Integer>> dataStreams, java.util.List<java.lang.String> indexNames, int replicas)ConstructsClusterStatewith the specified data streams and indices.static org.elasticsearch.cluster.metadata.IndexMetadata.BuildergetIndexMetadataBuilderForIndex(org.elasticsearch.index.Index index)static java.util.List<org.elasticsearch.index.Index>randomIndexInstances()static org.elasticsearch.cluster.metadata.DataStreamrandomInstance()static org.elasticsearch.cluster.metadata.DataStreamrandomInstance(java.util.function.LongSupplier timeProvider)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
DataStreamTestHelper
public DataStreamTestHelper()
-
-
Method Details
-
createFirstBackingIndex
public static org.elasticsearch.cluster.metadata.IndexMetadata.Builder createFirstBackingIndex(java.lang.String dataStreamName) -
createFirstBackingIndex
public static org.elasticsearch.cluster.metadata.IndexMetadata.Builder createFirstBackingIndex(java.lang.String dataStreamName, long epochMillis) -
createBackingIndex
public static org.elasticsearch.cluster.metadata.IndexMetadata.Builder createBackingIndex(java.lang.String dataStreamName, int generation) -
createBackingIndex
public static org.elasticsearch.cluster.metadata.IndexMetadata.Builder createBackingIndex(java.lang.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(java.lang.String fieldName) -
generateMapping
public static java.lang.String generateMapping(java.lang.String timestampFieldName) -
generateMapping
public static java.lang.String generateMapping(java.lang.String timestampFieldName, java.lang.String type) -
randomIndexInstances
public static java.util.List<org.elasticsearch.index.Index> randomIndexInstances() -
randomInstance
public static org.elasticsearch.cluster.metadata.DataStream randomInstance() -
randomInstance
public static org.elasticsearch.cluster.metadata.DataStream randomInstance(java.util.function.LongSupplier timeProvider) -
getClusterStateWithDataStreams
public static org.elasticsearch.cluster.ClusterState getClusterStateWithDataStreams(java.util.List<org.elasticsearch.common.collect.Tuple<java.lang.String,java.lang.Integer>> dataStreams, java.util.List<java.lang.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 org.elasticsearch.cluster.ClusterState getClusterStateWithDataStreams(java.util.List<org.elasticsearch.common.collect.Tuple<java.lang.String,java.lang.Integer>> dataStreams, java.util.List<java.lang.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
-
backingIndexPattern
public static java.lang.String backingIndexPattern(java.lang.String dataStreamName, long generation)
-