public class MurmurHash2Compat extends java.lang.Object implements Hash
MurmurHash2
. This version contains a slight bug in that it only takes into account 31 bits of the 32 bit range,
which will result in poorer distribution. It is still maintained in the source tree to provide backward compatibility
with existing clusters prior to 4.2.1, when the bug was identified and fixed. See ISPN-873 for more details.MurmurHash2
Modifier and Type | Class and Description |
---|---|
static class |
MurmurHash2Compat.Externalizer |
Modifier and Type | Field and Description |
---|---|
private static int |
H |
private static int |
M |
private static int |
R |
Constructor and Description |
---|
MurmurHash2Compat() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other) |
int |
hash(byte[] payload)
Hashes a byte array efficiently.
|
int |
hash(int hashcode)
An incremental version of the hash function, that spreads a pre-calculated
hash code, such as one derived from
Object.hashCode() . |
int |
hash(java.lang.Object o)
A helper that calculates the hashcode of an object, choosing the optimal
mechanism of hash calculation after considering the type of the object
(byte array, String or Object).
|
java.lang.String |
toString() |
private static final int M
private static final int R
private static final int H
public final int hash(byte[] payload)
Hash
public final int hash(int hashcode)
Hash
Object.hashCode()
.public final int hash(java.lang.Object o)
Hash
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object