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 int
DEFAULT_SEED
-
Constructor Summary
Constructors Constructor Description MurmurHashUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
fmix(int h)
static long
fmix(long h)
static int
hashBytes(MemorySegment segment, int offset, int lengthInBytes)
Hash bytes in MemorySegment.static int
hashBytesByWords(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.
-
-
-
Field Detail
-
DEFAULT_SEED
public static final int DEFAULT_SEED
- See Also:
- Constant Field Values
-
-
Method Detail
-
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 objectoffset
- offset for unsafe objectlengthInBytes
- length in bytes- Returns:
- hash code
-
hashUnsafeBytes
public static int hashUnsafeBytes(Object base, long offset, int lengthInBytes)
Hash unsafe bytes.- Parameters:
base
- base unsafe objectoffset
- offset for unsafe objectlengthInBytes
- length in bytes- Returns:
- hash code
-
hashBytesByWords
public static int hashBytesByWords(MemorySegment segment, int offset, int lengthInBytes)
Hash bytes in MemorySegment, length must be aligned to 4 bytes.- Parameters:
segment
- segment.offset
- offset for MemorySegmentlengthInBytes
- length in MemorySegment- Returns:
- hash code
-
hashBytes
public static int hashBytes(MemorySegment segment, int offset, int lengthInBytes)
Hash bytes in MemorySegment.- Parameters:
segment
- segment.offset
- offset for MemorySegmentlengthInBytes
- length in MemorySegment- Returns:
- hash code
-
fmix
public static int fmix(int h)
-
fmix
public static long fmix(long h)
-
-