Class RandomGenerators

java.lang.Object
io.bloviate.util.RandomGenerators

public final class RandomGenerators extends Object
Central factory for the RandomGenerator used throughout the fill engine.

Bloviate seeds a fresh, isolated generator per column (see DatabaseUtils.columnSeed(io.bloviate.db.Column, long)), so reproducible parallel generation never depends on a shared, mutable RNG. The only thing this class fixes is the algorithm: "L64X128MixRandom", the JDK general-purpose default (RandomGeneratorFactory.getDefault()). Compared to the legacy Random (a 48-bit LCG with a documented statistical defect and synchronized methods), it offers a far longer period (2128 × 264), better statistical quality, and no lock overhead — and it is explicitly recommended for multi-threaded use with a per-unit instance, exactly Bloviate's per-column model.

Because Random also implements RandomGenerator, callers that still hold a java.util.Random can pass it directly anywhere a RandomGenerator is expected; new code should obtain generators here so the whole engine shares one algorithm.

Since:
2.10.0
  • Field Details

  • Method Details

    • create

      public static RandomGenerator create(long seed)
      Creates a new, independent RandomGenerator seeded with the given value. The same seed always yields the same sequence, which is what makes Bloviate's per-column generation reproducible.
      Parameters:
      seed - the seed value
      Returns:
      a freshly seeded generator