Class HashInterval

java.lang.Object
io.nosqlbench.virtdata.library.basics.shared.from_long.to_long.HashInterval
All Implemented Interfaces:
LongUnaryOperator

public class HashInterval extends Object implements LongUnaryOperator
Return a value within a range, pseudo-randomly, using interval semantics, where the range of values return does not include the last value. This function behaves exactly like HashRange except for the exclusion of the last value. This allows you to stack intervals using known reference points without duplicating or skipping any given value. You can specify hash intervals as small as a single-element range, like (5,6), or as wide as the relevant data type allows.
  • Constructor Details

    • HashInterval

      public HashInterval(long width)
      Create a hash interval based on a minimum value of 0 and a specified width.
      Parameters:
      width - The maximum value, which is excluded.
    • HashInterval

      public HashInterval(long minIncl, long maxExcl)
      Create a hash interval
      Parameters:
      minIncl - The minimum value, which is included
      maxExcl - The maximum value, which is excluded
  • Method Details