Class TupleHashProvider

java.lang.Object
tools.refinery.store.model.TupleHashProvider
All Implemented Interfaces:
ContinuousHashProvider<Tuple>

public class TupleHashProvider extends Object implements ContinuousHashProvider<Tuple>
  • Field Details

    • primes

      protected static final int[] primes
    • LARGEST_PRIME_30_BITS_LONG

      protected static final long LARGEST_PRIME_30_BITS_LONG
      See Also:
    • LARGEST_PRIME_30_BITS_INTEGER

      protected static final int LARGEST_PRIME_30_BITS_INTEGER
      See Also:
    • LARGEST_BINARY_INDEX_1

      protected static final int LARGEST_BINARY_INDEX_1
      See Also:
    • MAX_MODEL_SIZE

      public static final int MAX_MODEL_SIZE
      See Also:
    • INSTANCE

      public static final TupleHashProvider INSTANCE
  • Constructor Details

    • TupleHashProvider

      public TupleHashProvider()
  • Method Details

    • getHash

      public int getHash(Tuple key, int index)
      Description copied from interface: ContinuousHashProvider
      Provides a hash code for a object key with a given index. It has the following contracts:
      • If
        invalid reference
        #equals
        (key1,key2), then getHash(key1, index) == getHash(key2, index) for all values of index.
      • If getHash(key1,index) == getHash(key2, index) for all values of index, then
        invalid reference
        #equals
        (key1, key2)
      • In current implementation, we use only the least significant ContinuousHashProvider.EFFECTIVE_BITS
      Check
      invalid reference
      #equals
      for further details.
      Specified by:
      getHash in interface ContinuousHashProvider<Tuple>
      Parameters:
      key - The target data object.
      index - The depth of the hash code. Needs to be non-negative.
      Returns:
      A hash code.