org.apache.hadoop.util.hash
Class MurmurHash
java.lang.Object
org.apache.hadoop.util.hash.Hash
org.apache.hadoop.util.hash.MurmurHash
public class MurmurHash
- extends Hash
This is a very fast, non-cryptographic hash suitable for general hash-based
lookup. See http://murmurhash.googlepages.com/ for more details.
The C version of MurmurHash 2.0 found at that site was ported
to Java by Andrzej Bialecki (ab at getopt org).
Method Summary |
static Hash |
getInstance()
|
int |
hash(byte[] data,
int length,
int seed)
Calculate a hash using bytes from 0 to length , and
the provided seed value |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MurmurHash
public MurmurHash()
getInstance
public static Hash getInstance()
hash
public int hash(byte[] data,
int length,
int seed)
- Description copied from class:
Hash
- Calculate a hash using bytes from 0 to
length
, and
the provided seed value
- Specified by:
hash
in class Hash
- Parameters:
data
- input byteslength
- length of the valid bytes to considerseed
- seed value
- Returns:
- hash value
Copyright © 2009 The Apache Software Foundation