Package org.apache.cassandra.utils
Class MurmurHash
java.lang.Object
org.apache.cassandra.utils.MurmurHash
This is a very fast, non-cryptographic hash suitable for general hash-based
lookup. See http://murmurhash.googlepages.com/ for more details.
hash32() and hash64() are MurmurHash 2.0.
hash3_x64_128() is *almost* MurmurHash 3.0. It was supposed to match, but we didn't catch a sign bug with
the result that it doesn't. Unfortunately, we can't change it now without breaking Murmur3Partitioner. *
The C version of MurmurHash 2.0 found at that site was ported to Java by Andrzej Bialecki (ab at getopt org).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static longfmix(long k) protected static longgetBlock(ByteBuffer key, int offset, int index) static longhash2_64(ByteBuffer key, int offset, int length, long seed) static voidhash3_x64_128(ByteBuffer key, int offset, int length, long seed, long[] result) static inthash32(ByteBuffer data, int offset, int length, int seed) static long[]inv_hash3_x64_128(long[] result) protected static longinvFmix(long k) protected static longinvRotl64(long v, int n) protected static longinvRShiftXor(long value, int shift) static longinvTailReverse(long num) This gives a correct reversal of the tail byte flip which is needed if want a non mod16==0 byte hash inv or to target a hash for a given schema.protected static longrotl64(long v, int n)
-
Constructor Details
-
MurmurHash
public MurmurHash()
-
-
Method Details
-
hash32
-
hash2_64
-
getBlock
-
rotl64
protected static long rotl64(long v, int n) -
fmix
protected static long fmix(long k) -
hash3_x64_128
-
invRotl64
protected static long invRotl64(long v, int n) -
invRShiftXor
protected static long invRShiftXor(long value, int shift) -
invFmix
protected static long invFmix(long k) -
invTailReverse
public static long invTailReverse(long num) This gives a correct reversal of the tail byte flip which is needed if want a non mod16==0 byte hash inv or to target a hash for a given schema. -
inv_hash3_x64_128
public static long[] inv_hash3_x64_128(long[] result)
-