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, List<Index> indices)
    • newInstance

      public static DataStream newInstance(String name, List<Index> indices, long generation, Map<String,Object> metadata)
    • newInstance

      public static DataStream newInstance(String name, List<Index> indices, long generation, Map<String,Object> metadata, boolean replicated)
    • newInstance

      public static DataStream newInstance(String name, List<Index> indices, long generation, Map<String,Object> metadata, boolean replicated, @Nullable DataStreamLifecycle lifecycle)
    • getLegacyDefaultBackingIndexName

      public static String getLegacyDefaultBackingIndexName(String dataStreamName, long generation, long epochMillis, Version minNodeVersion)
    • getLegacyDefaultBackingIndexName

      public static String getLegacyDefaultBackingIndexName(String dataStreamName, long generation)
    • 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)
    • generateMapping

      public static String generateMapping(String timestampFieldName)
    • generateTsdbMapping

      public static String generateTsdbMapping()
    • 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, long currentTime, Settings settings, int replicas)
    • getClusterStateWithDataStreams

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

      public static void getClusterStateWithDataStreams(Metadata.Builder builder, List<org.elasticsearch.core.Tuple<String,Integer>> dataStreams, List<String> indexNames, long currentTime, Settings settings, int replicas, boolean replicated)
    • getClusterStateWithDataStream

      public static ClusterState getClusterStateWithDataStream(String dataStream, List<org.elasticsearch.core.Tuple<Instant,Instant>> timeSlices)
    • getClusterStateWithDataStream

      public static void getClusterStateWithDataStream(Metadata.Builder builder, String dataStreamName, List<org.elasticsearch.core.Tuple<Instant,Instant>> timeSlices)
    • backingIndexPattern

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

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

      public static MetadataRolloverService getMetadataRolloverService(DataStream dataStream, ThreadPool testThreadPool, Set<IndexSettingProvider> providers, org.elasticsearch.xcontent.NamedXContentRegistry registry) throws Exception
      Throws:
      Exception
    • getDataStreamTimestampFieldMapper

      public static MetadataFieldMapper getDataStreamTimestampFieldMapper()
    • mockIndicesServices

      public static IndicesService mockIndicesServices(MappingLookup mappingLookup) throws Exception
      Throws:
      Exception