Class MurmurHashUtil

java.lang.Object
org.apache.flink.table.runtime.util.MurmurHashUtil

public final class MurmurHashUtil extends Object
Murmur hasher. This is based on Guava's Murmur3_32HashFunction.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    fmix(int h)
     
    static long
    fmix(long h)
     
    static int
    hashBytes(org.apache.flink.core.memory.MemorySegment segment, int offset, int lengthInBytes)
    Hash bytes in MemorySegment.
    static int
    hashBytesByWords(org.apache.flink.core.memory.MemorySegment segment, int offset, int lengthInBytes)
    Hash bytes in MemorySegment, length must be aligned to 4 bytes.
    static int
    hashUnsafeBytes(Object base, long offset, int lengthInBytes)
    Hash unsafe bytes.
    static int
    hashUnsafeBytesByWords(Object base, long offset, int lengthInBytes)
    Hash unsafe bytes, length must be aligned to 4 bytes.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • MurmurHashUtil

      public MurmurHashUtil()
  • Method Details

    • hashUnsafeBytesByWords

      public static int hashUnsafeBytesByWords(Object base, long offset, int lengthInBytes)
      Hash unsafe bytes, length must be aligned to 4 bytes.
      Parameters:
      base - base unsafe object
      offset - offset for unsafe object
      lengthInBytes - length in bytes
      Returns:
      hash code
    • hashUnsafeBytes

      public static int hashUnsafeBytes(Object base, long offset, int lengthInBytes)
      Hash unsafe bytes.
      Parameters:
      base - base unsafe object
      offset - offset for unsafe object
      lengthInBytes - length in bytes
      Returns:
      hash code
    • hashBytesByWords

      public static int hashBytesByWords(org.apache.flink.core.memory.MemorySegment segment, int offset, int lengthInBytes)
      Hash bytes in MemorySegment, length must be aligned to 4 bytes.
      Parameters:
      segment - segment.
      offset - offset for MemorySegment
      lengthInBytes - length in MemorySegment
      Returns:
      hash code
    • hashBytes

      public static int hashBytes(org.apache.flink.core.memory.MemorySegment segment, int offset, int lengthInBytes)
      Hash bytes in MemorySegment.
      Parameters:
      segment - segment.
      offset - offset for MemorySegment
      lengthInBytes - length in MemorySegment
      Returns:
      hash code
    • fmix

      public static int fmix(int h)
    • fmix

      public static long fmix(long h)