|
||||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 枚举常量 | 字段 | 方法 | 详细信息: 枚举常量 | 字段 | 方法 |
java.lang.Object java.lang.Enum<HashAlgorithm> com.taobao.metamorphosis.client.consumer.HashAlgorithm
public enum HashAlgorithm
Known hashing algorithms for locating a server for a key. Note that all hash algorithms return 64-bits of hash, but only the lower 32-bits are significant. This allows a positive 32-bit number to be returned for all cases.
枚举常量摘要 | |
---|---|
CRC32_HASH
CRC32_HASH as used by the perl API. |
|
ELECTION_HASH
|
|
ELF_HASH
|
|
FNV1_32_HASH
32-bit FNV1. |
|
FNV1_64_HASH
FNV hashes are designed to be fast while maintaining a low collision rate. |
|
FNV1A_32_HASH
32-bit FNV1a. |
|
FNV1A_64_HASH
Variation of FNV. |
|
KETAMA_HASH
MD5-based hash algorithm used by ketama. |
|
LUA_HASH
From lua source,it is used for long key |
|
MYSQL_HASH
From mysql source |
|
NATIVE_HASH
Native hash (String.hashCode()). |
|
ONE_AT_A_TIME
The Jenkins One-at-a-time hash ,please see http://www.burtleburtle.net/bob/hash/doobs.html |
|
RS_HASH
|
方法摘要 | |
---|---|
static byte[] |
computeMd5(String k)
Get the md5 of the given key. |
long |
hash(String k)
Compute the hash for the given key. |
static HashAlgorithm |
valueOf(String name)
返回带有指定名称的该类型的枚举常量。 |
static HashAlgorithm[] |
values()
按照声明该枚举类型的常量的顺序,返回 包含这些常量的数组。 |
从类 java.lang.Enum 继承的方法 |
---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
从类 java.lang.Object 继承的方法 |
---|
getClass, notify, notifyAll, wait, wait, wait |
枚举常量详细信息 |
---|
public static final HashAlgorithm NATIVE_HASH
public static final HashAlgorithm CRC32_HASH
public static final HashAlgorithm FNV1_64_HASH
http://www.isthe.com/chongo/tech/comp/fnv/
,
http://en.wikipedia.org/wiki/Fowler_Noll_Vo_hash
public static final HashAlgorithm FNV1A_64_HASH
public static final HashAlgorithm FNV1_32_HASH
public static final HashAlgorithm FNV1A_32_HASH
public static final HashAlgorithm KETAMA_HASH
public static final HashAlgorithm MYSQL_HASH
public static final HashAlgorithm ELF_HASH
public static final HashAlgorithm RS_HASH
public static final HashAlgorithm LUA_HASH
public static final HashAlgorithm ELECTION_HASH
public static final HashAlgorithm ONE_AT_A_TIME
方法详细信息 |
---|
public static HashAlgorithm[] values()
for (HashAlgorithm c : HashAlgorithm.values()) System.out.println(c);
public static HashAlgorithm valueOf(String name)
name
- 要返回的枚举常量的名称。
如果该枚举类型没有带有指定名称的常量,
- 则抛出 IllegalArgumentExceptionpublic long hash(String k)
public static byte[] computeMd5(String k)
|
||||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 枚举常量 | 字段 | 方法 | 详细信息: 枚举常量 | 字段 | 方法 |