Class DataStreamTestHelper

java.lang.Object
org.elasticsearch.cluster.metadata.DataStreamTestHelper

public final class DataStreamTestHelper extends Object
  • 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

      public static IndexMetadata.Builder createFirstBackingIndex(String dataStreamName)
    • createFirstBackingIndex

      public static IndexMetadata.Builder createFirstBackingIndex(String dataStreamName, long epochMillis)
    • createBackingIndex

      public static IndexMetadata.Builder createBackingIndex(String dataStreamName, int generation)
    • createBackingIndex

      public static IndexMetadata.Builder createBackingIndex(String dataStreamName, int generation, long epochMillis)
    • getIndexMetadataBuilderForIndex

      public static IndexMetadata.Builder getIndexMetadataBuilderForIndex(Index index)
    • createTimestampField

      public static DataStream.TimestampField createTimestampField(String fieldName)
    • generateMapping

      public static String generateMapping(String timestampFieldName)
    • generateMapping

      public static String generateMapping(String timestampFieldName, String type)
    • randomIndexInstances

      public static List<Index> randomIndexInstances()
    • randomInstance

      public static DataStream randomInstance()
    • randomInstance

      public static DataStream randomInstance(String name)
    • randomInstance

      public static DataStream randomInstance(LongSupplier timeProvider)
    • randomInstance

      public static DataStream randomInstance(String dataStreamName, LongSupplier timeProvider)
    • randomAliasInstance

      public static DataStreamAlias randomAliasInstance()
    • getClusterStateWithDataStreams

      public static ClusterState getClusterStateWithDataStreams(List<org.elasticsearch.core.Tuple<String,Integer>> dataStreams, List<String> indexNames)
      Constructs ClusterState with the specified data streams and indices.
      Parameters:
      dataStreams - The names of the data streams to create with their respective number of backing indices
      indexNames - 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)
      Constructs ClusterState with the specified data streams and indices.
      Parameters:
      dataStreams - The names of the data streams to create with their respective number of backing indices
      indexNames - The names of indices to create that do not back any data streams
      replicas - number of replicas
    • getClusterStateWithDataStreams

      public static ClusterState getClusterStateWithDataStreams(List<org.elasticsearch.core.Tuple<String,Integer>> dataStreams, List<String> indexNames, int replicas, boolean replicated)
    • backingIndexPattern

      public static String backingIndexPattern(String dataStreamName, long generation)
    • backingIndexEqualTo

      public static org.hamcrest.Matcher<String> backingIndexEqualTo(String dataStreamName, int generation)