Package akka.routing
Class MurmurHash
- java.lang.Object
-
- akka.routing.MurmurHash
-
public class MurmurHash extends java.lang.Object
The first 23 magic integers from the first stream are stored here
-
-
Constructor Summary
Constructors Constructor Description MurmurHash()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> int
arrayHash(java.lang.Object a)
Compute a high-quality hash of an arraystatic int
arrayHash$mBc$sp(byte[] a)
static int
arrayHash$mCc$sp(char[] a)
static int
arrayHash$mDc$sp(double[] a)
static int
arrayHash$mFc$sp(float[] a)
static int
arrayHash$mIc$sp(int[] a)
static int
arrayHash$mJc$sp(long[] a)
static int
arrayHash$mSc$sp(short[] a)
static int
arrayHash$mVc$sp(scala.runtime.BoxedUnit[] a)
static int
arrayHash$mZc$sp(boolean[] a)
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 mixingstatic int
hiddenMagicA()
static int
hiddenMagicB()
static int
nextMagicA(int magicA)
Given a magic integer from the first stream, compute the nextstatic int
nextMagicB(int magicB)
Given a magic integer from the second stream, compute the nextstatic int
seedArray()
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 stringstatic <T> int
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.
-
-
-
Method Detail
-
hiddenMagicA
public static final int hiddenMagicA()
-
hiddenMagicB
public static final int hiddenMagicB()
-
seedArray
public static final int seedArray()
-
startHash
public static int startHash(int seed)
Begin a new hash with a seed value.
-
startMagicA
public static int startMagicA()
The initial magic integers in the first stream.
-
startMagicB
public static int startMagicB()
The initial magic integer in the second stream.
-
extendHash
public static int extendHash(int hash, int value, int magicA, int magicB)
Incorporates a new value into an existing hash.- Parameters:
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)- Returns:
- the updated hash value
-
nextMagicA
public static int nextMagicA(int magicA)
Given a magic integer from the first stream, compute the next
-
nextMagicB
public static int nextMagicB(int magicB)
Given a magic integer from the second stream, compute the next
-
finalizeHash
public static int finalizeHash(int hash)
Once all hashes have been incorporated, this performs a final mixing
-
arrayHash
public static <T> int arrayHash(java.lang.Object a)
Compute a high-quality hash of an array
-
stringHash
public static int stringHash(java.lang.String s)
Compute a high-quality hash of a string
-
symmetricHash
public static <T> int 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. This is useful for hashing sets, for example.- Parameters:
xs
- (undocumented)seed
- (undocumented)- Returns:
- (undocumented)
-
arrayHash$mZc$sp
public static int arrayHash$mZc$sp(boolean[] a)
-
arrayHash$mBc$sp
public static int arrayHash$mBc$sp(byte[] a)
-
arrayHash$mCc$sp
public static int arrayHash$mCc$sp(char[] a)
-
arrayHash$mDc$sp
public static int arrayHash$mDc$sp(double[] a)
-
arrayHash$mFc$sp
public static int arrayHash$mFc$sp(float[] a)
-
arrayHash$mIc$sp
public static int arrayHash$mIc$sp(int[] a)
-
arrayHash$mJc$sp
public static int arrayHash$mJc$sp(long[] a)
-
arrayHash$mSc$sp
public static int arrayHash$mSc$sp(short[] a)
-
arrayHash$mVc$sp
public static int arrayHash$mVc$sp(scala.runtime.BoxedUnit[] a)
-
-