Class RandomGenerators
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringTheRandomGeneratoralgorithm used by the fill engine. -
Method Summary
Modifier and TypeMethodDescriptionstatic RandomGeneratorcreate(long seed) Creates a new, independentRandomGeneratorseeded with the given value.
-
Field Details
-
ALGORITHM
TheRandomGeneratoralgorithm used by the fill engine.- See Also:
-
-
Method Details
-
create
Creates a new, independentRandomGeneratorseeded 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
-