| Constructor and Description |
|---|
HashRingBuilder() |
| Modifier and Type | Method and Description |
|---|---|
HashRing<T> |
build()
Build hash ring.
|
HashRingBuilder<T> |
hasher(Hasher hash)
Set hash function implementation.
|
HashRingBuilder<T> |
name(java.lang.String name)
Set name of the hash ring
|
HashRingBuilder<T> |
nodes(java.util.Collection<T> nodes)
Initialized hash ring with list of nodes
|
HashRingBuilder<T> |
partitionRate(int partitionRate)
|
public HashRingBuilder<T> name(java.lang.String name)
name - the name of the ring. If no name was set, default name will be generatedjava.lang.NullPointerException - if name is nullpublic HashRingBuilder<T> hasher(Hasher hash)
hash - the hash function, default value is DefaultHasher.MURMUR_3public HashRingBuilder<T> partitionRate(int partitionRate)
partitionRate - the partition rate. Default value is 1000, minimum is 1java.lang.IllegalArgumentException - if partition rate less than 1public HashRingBuilder<T> nodes(java.util.Collection<T> nodes)
nodes - the nodes list to be added to hash ringjava.lang.NullPointerException - if nodes list is null