Class HashFunction

java.lang.Object
org.apache.hadoop.util.bloom.HashFunction

@Public @Stable public final class HashFunction extends Object
Implements a hash object that returns a certain number of hashed values.
See Also:
  • Constructor Details

    • HashFunction

      public HashFunction(int maxValue, int nbHash, int hashType)
      Constructor.

      Builds a hash function that must obey to a given maximum number of returned values and a highest value.

      Parameters:
      maxValue - The maximum highest returned value.
      nbHash - The number of resulting hashed values.
      hashType - type of the hashing function (see Hash).
  • Method Details

    • clear

      public void clear()
      Clears this hash function. A NOOP
    • hash

      public int[] hash(Key k)
      Hashes a specified key into several integers.
      Parameters:
      k - The specified key.
      Returns:
      The array of hashed values.