Class SolrGenerate

java.lang.Object
org.apache.solr.bench.SolrGenerate

public class SolrGenerate extends Object
The type Solr generate.
  • Method Details

    • constant

      public static <T> SolrGen<T> constant(T constant)
      Constant solr gen.
      Type Parameters:
      T - the type parameter
      Parameters:
      constant - the constant
      Returns:
      the solr gen
    • range

      public static SolrGen<Integer> range(int startInclusive, int endInclusive)
      Range solr gen.
      Parameters:
      startInclusive - the start inclusive
      endInclusive - the end inclusive
      Returns:
      the solr gen
    • longRange

      public static SolrGen<Long> longRange(long startInclusive, long endInclusive)
      Long range solr gen.
      Parameters:
      startInclusive - the start inclusive
      endInclusive - the end inclusive
      Returns:
      the solr gen
    • intArrays

      public static SolrGen<int[]> intArrays(SolrGen<Integer> sizes, SolrGen<Integer> contents)
      Int arrays solr gen.
      Parameters:
      sizes - the sizes
      contents - the contents
      Returns:
      the solr gen
    • codePoints

      public static SolrGen<Integer> codePoints(int startInclusive, int endInclusive)
      Code points solr gen.
      Parameters:
      startInclusive - the start inclusive
      endInclusive - the end inclusive
      Returns:
      the solr gen
    • frequency

      @SafeVarargs public static <T> SolrGen<T> frequency(org.quicktheories.api.Pair<Integer,SolrGen<T>> mandatory, org.quicktheories.api.Pair<Integer,SolrGen<T>>... others)
      Returns a generator that provides a value from a generator chosen with probability in proportion to the weight supplied in the Pair. Shrinking is towards the first non-zero weight in the list. At least one generator must have a positive weight and non-positive generators will never be chosen.
      Type Parameters:
      T - Type to generate
      Parameters:
      mandatory - Generator to sample from
      others - Other generators to sample
      Returns:
      A gen of T
    • frequency

      public static <T> SolrGen<T> frequency(List<org.quicktheories.api.Pair<Integer,SolrGen<T>>> weightedGens)
      Returns a generator that provides a value from a generator chosen with probability in proportion to the weight supplied in the Pair. Shrinking is towards the first non-zero weight in the list. At least one generator must have a positive weight and non-positive generators will never be chosen.
      Type Parameters:
      T - Type to generate
      Parameters:
      weightedGens - pairs of weight and generators to sample in proportion to their weighting
      Returns:
      A gen of T
    • booleans

      public static SolrGen<Boolean> booleans()
      Booleans solr gen.
      Returns:
      the solr gen
    • pick

      public static <T> SolrGen<T> pick(List<T> ts)
      Randomly returns one of the supplied values
      Type Parameters:
      T - type of value to generate *
      Parameters:
      ts - Values to pick from
      Returns:
      A Gen of T
    • oneOf

      @SafeVarargs public static <T> SolrGen<T> oneOf(SolrGen<T> mandatory, SolrGen<T>... others)
      Returns a generator that provides a value from a random generator provided.
      Type Parameters:
      T - Type to generate
      Parameters:
      mandatory - Generator to sample from
      others - Other generators to sample from with equal weighting
      Returns:
      A gen of T