| 构造器和说明 |
|---|
ConsistentHash(HashFunction hashFunction,
int numberOfReplicas,
Collection<T> nodes)
Instantiates a new Consistent hash.
|
ConsistentHash(int numberOfReplicas,
Collection<T> nodes)
Instantiates a new Consistent hash.
|
| 限定符和类型 | 方法和说明 |
|---|---|
T |
getNodeFor(Object key)
This returns the closest node for the object.
|
List<T> |
getNUniqueNodesFor(Object key,
int n)
This returns the closest n unique nodes in order for the object.
|
public ConsistentHash(int numberOfReplicas,
Collection<T> nodes)
numberOfReplicas - the number of replicasnodes - the nodespublic ConsistentHash(HashFunction hashFunction, int numberOfReplicas, Collection<T> nodes)
hashFunction - the hash functionnumberOfReplicas - the number of replicasnodes - the nodesCopyright © 2019 The Ant Financial. All rights reserved.