Class Murmur3
- java.lang.Object
-
- org.apache.kafka.streams.state.internals.Murmur3
-
public class Murmur3 extends java.lang.ObjectThis class was taken from Hive org.apache.hive.common.util; https://github.com/apache/hive/blob/master/storage-api/src/java/org/apache/hive/common/util/Murmur3.java Commit: dffa3a16588bc8e95b9d0ab5af295a74e06ef702 Murmur3 is successor to Murmur2 fast non-crytographic hash algorithms. Murmur3 32 and 128 bit variants. 32-bit Java port of https://code.google.com/p/smhasher/source/browse/trunk/MurmurHash3.cpp#94 128-bit Java port of https://code.google.com/p/smhasher/source/browse/trunk/MurmurHash3.cpp#255 This is a public domain code with no copyrights. From homepage of MurmurHash (https://code.google.com/p/smhasher/), "All MurmurHash versions are public domain software, and the author disclaims all copyright to their code."
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMurmur3.IncrementalHash32
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_SEEDstatic longNULL_HASHCODE
-
Constructor Summary
Constructors Constructor Description Murmur3()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static long[]hash128(byte[] data)Murmur3 128-bit variant.static long[]hash128(byte[] data, int offset, int length, int seed)Murmur3 128-bit variant.static inthash32(byte[] data)Murmur3 32-bit variant.static inthash32(byte[] data, int length)Murmur3 32-bit variant.static inthash32(byte[] data, int length, int seed)Murmur3 32-bit variant.static inthash32(byte[] data, int offset, int length, int seed)Murmur3 32-bit variant.static inthash32(long l0)static inthash32(long l0, int seed)Murmur3 32-bit variant.static inthash32(long l0, long l1)static inthash32(long l0, long l1, int seed)Murmur3 32-bit variant.static longhash64(byte[] data)Murmur3 64-bit variant.static longhash64(byte[] data, int offset, int length)static longhash64(byte[] data, int offset, int length, int seed)Murmur3 64-bit variant.static longhash64(int data)static longhash64(long data)static longhash64(short data)
-
-
-
Field Detail
-
NULL_HASHCODE
public static final long NULL_HASHCODE
- See Also:
- Constant Field Values
-
DEFAULT_SEED
public static final int DEFAULT_SEED
- See Also:
- Constant Field Values
-
-
Method Detail
-
hash32
public static int hash32(long l0, long l1)
-
hash32
public static int hash32(long l0)
-
hash32
public static int hash32(long l0, int seed)Murmur3 32-bit variant.
-
hash32
public static int hash32(long l0, long l1, int seed)Murmur3 32-bit variant.
-
hash32
public static int hash32(byte[] data)
Murmur3 32-bit variant.- Parameters:
data- - input byte array- Returns:
- - hashcode
-
hash32
public static int hash32(byte[] data, int length)Murmur3 32-bit variant.- Parameters:
data- - input byte arraylength- - length of array- Returns:
- - hashcode
-
hash32
public static int hash32(byte[] data, int length, int seed)Murmur3 32-bit variant.- Parameters:
data- - input byte arraylength- - length of arrayseed- - seed. (default 0)- Returns:
- - hashcode
-
hash32
public static int hash32(byte[] data, int offset, int length, int seed)Murmur3 32-bit variant.- Parameters:
data- - input byte arrayoffset- - offset of datalength- - length of arrayseed- - seed. (default 0)- Returns:
- - hashcode
-
hash64
public static long hash64(byte[] data)
Murmur3 64-bit variant. This is essentially MSB 8 bytes of Murmur3 128-bit variant.- Parameters:
data- - input byte array- Returns:
- - hashcode
-
hash64
public static long hash64(long data)
-
hash64
public static long hash64(int data)
-
hash64
public static long hash64(short data)
-
hash64
public static long hash64(byte[] data, int offset, int length)
-
hash64
public static long hash64(byte[] data, int offset, int length, int seed)Murmur3 64-bit variant. This is essentially MSB 8 bytes of Murmur3 128-bit variant.- Parameters:
data- - input byte arraylength- - length of arrayseed- - seed. (default is 0)- Returns:
- - hashcode
-
hash128
public static long[] hash128(byte[] data)
Murmur3 128-bit variant.- Parameters:
data- - input byte array- Returns:
- - hashcode (2 longs)
-
hash128
public static long[] hash128(byte[] data, int offset, int length, int seed)Murmur3 128-bit variant.- Parameters:
data- - input byte arrayoffset- - the first element of arraylength- - length of arrayseed- - seed. (default is 0)- Returns:
- - hashcode (2 longs)
-
-