|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object akka.routing.MurmurHash
public class MurmurHash
An object designed to generate well-distributed non-cryptographic hashes. It is designed to hash a collection of integers; along with the integers to hash, it generates two magic streams of integers to increase the distribution of repetitive input sequences. Thus, three methods need to be called at each step (to start and to incorporate a new integer) to update the values. Only one method needs to be called to finalize the hash.
Constructor Summary | |
---|---|
MurmurHash()
|
Method Summary | ||
---|---|---|
static
|
arrayHash(java.lang.Object a)
Compute a high-quality hash of an array |
|
static int |
extendHash(int hash,
int value,
int magicA,
int magicB)
Incorporates a new value into an existing hash. |
|
static int |
finalizeHash(int hash)
Once all hashes have been incorporated, this performs a final mixing |
|
static int |
nextMagicA(int magicA)
Given a magic integer from the first stream, compute the next |
|
static int |
nextMagicB(int magicB)
Given a magic integer from the second stream, compute the next |
|
static int |
startHash(int seed)
Begin a new hash with a seed value. |
|
static int |
startMagicA()
The initial magic integers in the first stream. |
|
static int |
startMagicB()
The initial magic integer in the second stream. |
|
static int |
stringHash(java.lang.String s)
Compute a high-quality hash of a string |
|
static
|
symmetricHash(scala.collection.TraversableOnce<T> xs,
int seed)
Compute a hash that is symmetric in its arguments--that is, where the order of appearance of elements does not matter. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MurmurHash()
Method Detail |
---|
public static int startHash(int seed)
public static int startMagicA()
public static int startMagicB()
public static int extendHash(int hash, int value, int magicA, int magicB)
hash
- the prior hash valuevalue
- the new value to incorporatemagicA
- a magic integer from the streammagicB
- a magic integer from a different streamhash
- (undocumented)value
- (undocumented)
public static int nextMagicA(int magicA)
public static int nextMagicB(int magicB)
public static int finalizeHash(int hash)
public static <T> int arrayHash(java.lang.Object a)
public static int stringHash(java.lang.String s)
public static <T> int symmetricHash(scala.collection.TraversableOnce<T> xs, int seed)
xs
- (undocumented)seed
- (undocumented)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |