Class TPCCUtils
java.lang.Object
io.bloviate.gen.tpcc.TPCCUtils
Utilities implementing pieces of the TPC-C specification.
-
Method Summary
Modifier and TypeMethodDescriptionstatic intnonUniformRandom(int a, int c, int min, int max, SeededRandomUtils randomUtils) The TPC-C non-uniform random functionNURand(clause 2.1.6):NURand(A, x, y) = (((random(0, A) | random(x, y)) + C) % (y - x + 1)) + x.
-
Method Details
-
nonUniformRandom
The TPC-C non-uniform random functionNURand(clause 2.1.6):NURand(A, x, y) = (((random(0, A) | random(x, y)) + C) % (y - x + 1)) + x.- Parameters:
a- theAconstant (a bit-mask bound; one of 255, 1023 or 8191)c- the run-time constantC, chosen within[0, A]min- the inclusive lower boundxmax- the inclusive upper boundyrandomUtils- the seeded random source- Returns:
- a non-uniformly distributed value in
[min, max]
-