@InterfaceAudience.Private @InterfaceStability.Stable public abstract class Hash extends Object
Modifier and Type | Field and Description |
---|---|
static int |
INVALID_HASH
Constant to denote invalid hash type.
|
static int |
JENKINS_HASH
Constant to denote
JenkinsHash . |
static int |
MURMUR_HASH
Constant to denote
MurmurHash . |
static int |
MURMUR_HASH3
Constant to denote
MurmurHash3 . |
Constructor and Description |
---|
Hash() |
Modifier and Type | Method and Description |
---|---|
static int |
getHashType(org.apache.hadoop.conf.Configuration conf)
This utility method converts the name of the configured
hash type to a symbolic constant.
|
static Hash |
getInstance(org.apache.hadoop.conf.Configuration conf)
Get a singleton instance of hash function of a type
defined in the configuration.
|
static Hash |
getInstance(int type)
Get a singleton instance of hash function of a given type.
|
abstract <T> int |
hash(HashKey<T> hashKey,
int initval)
Calculate a hash using bytes from HashKey and the provided seed value.
|
static int |
parseHashType(String name)
This utility method converts String representation of hash function name
to a symbolic constant.
|
public static final int INVALID_HASH
public static final int JENKINS_HASH
JenkinsHash
.public static final int MURMUR_HASH
MurmurHash
.public static final int MURMUR_HASH3
MurmurHash3
.public Hash()
public static int parseHashType(String name)
name
- hash function namepublic static int getHashType(org.apache.hadoop.conf.Configuration conf)
conf
- configurationpublic static Hash getInstance(int type)
type
- predefined hash typepublic static Hash getInstance(org.apache.hadoop.conf.Configuration conf)
conf
- current configurationCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.