Class MurmurHashUtil
java.lang.Object
org.apache.flink.table.runtime.util.MurmurHashUtil
Murmur hasher. This is based on Guava's Murmur3_32HashFunction.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intfmix(int h) static longfmix(long h) static inthashBytes(org.apache.flink.core.memory.MemorySegment segment, int offset, int lengthInBytes) Hash bytes in MemorySegment.static inthashBytesByWords(org.apache.flink.core.memory.MemorySegment segment, int offset, int lengthInBytes) Hash bytes in MemorySegment, length must be aligned to 4 bytes.static inthashUnsafeBytes(Object base, long offset, int lengthInBytes) Hash unsafe bytes.static inthashUnsafeBytesByWords(Object base, long offset, int lengthInBytes) Hash unsafe bytes, length must be aligned to 4 bytes.
-
Field Details
-
DEFAULT_SEED
public static final int DEFAULT_SEED- See Also:
-
-
Constructor Details
-
MurmurHashUtil
public MurmurHashUtil()
-
-
Method Details
-
hashUnsafeBytesByWords
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
Hash unsafe bytes.- Parameters:
base- base unsafe objectoffset- offset for unsafe objectlengthInBytes- 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 MemorySegmentlengthInBytes- 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 MemorySegmentlengthInBytes- length in MemorySegment- Returns:
- hash code
-
fmix
public static int fmix(int h) -
fmix
public static long fmix(long h)
-