Class TPCCUtils

java.lang.Object
io.bloviate.gen.tpcc.TPCCUtils

public final class TPCCUtils extends Object
Utilities implementing pieces of the TPC-C specification.
  • Method Details

    • nonUniformRandom

      public static int nonUniformRandom(int a, int c, int min, int max, SeededRandomUtils randomUtils)
      The TPC-C non-uniform random function NURand (clause 2.1.6): NURand(A, x, y) = (((random(0, A) | random(x, y)) + C) % (y - x + 1)) + x.
      Parameters:
      a - the A constant (a bit-mask bound; one of 255, 1023 or 8191)
      c - the run-time constant C, chosen within [0, A]
      min - the inclusive lower bound x
      max - the inclusive upper bound y
      randomUtils - the seeded random source
      Returns:
      a non-uniformly distributed value in [min, max]