public class ConsistentHashHelper extends Object
Constructor and Description |
---|
ConsistentHashHelper() |
Modifier and Type | Method and Description |
---|---|
static ConsistentHash |
createConsistentHash(Configuration c,
Collection<Address> addresses)
Creates a new consistent hash instance based on the user's configuration, and populates the consistent hash
with the collection of addresses passed in.
|
static ConsistentHash |
createConsistentHash(Configuration c,
Collection<Address> addresses,
Address... moreAddresses)
Creates a new consistent hash instance based on the user's configuration, and populates the consistent hash
with the collection of addresses passed in.
|
static ConsistentHash |
createConsistentHash(Configuration c,
Collection<Address> addresses,
Collection<Address> moreAddresses)
Creates a new consistent hash instance based on the user's configuration, and populates the consistent hash
with the collection of addresses passed in.
|
static ConsistentHash |
createConsistentHash(ConsistentHash template,
Collection<Address> addresses)
Creates a new consistent hash instance based on the type specified, and populates the consistent hash
with the collection of addresses passed in.
|
static ConsistentHash |
createConsistentHash(ConsistentHash template,
Collection<Address> addresses,
Address... moreAddresses)
Creates a new consistent hash instance based on the type specified, and populates the consistent hash
with the collection of addresses passed in.
|
static ConsistentHash |
removeAddress(ConsistentHash ch,
Address toRemove,
Configuration c)
Returns a new consistent hash of the same type with the given address removed.
|
static UnionConsistentHash |
removeAddressFromUnionConsistentHash(UnionConsistentHash uch,
Address toRemove,
Configuration c)
Creates a new UnionConsistentHash instance based on the old instance, removing the provided address from both
target consistent hash instances in the union.
|
public static ConsistentHash removeAddress(ConsistentHash ch, Address toRemove, Configuration c)
ch
- consistent hash to start withtoRemove
- address to removec
- configurationpublic static UnionConsistentHash removeAddressFromUnionConsistentHash(UnionConsistentHash uch, Address toRemove, Configuration c)
uch
- union consistent hash instancetoRemove
- address to removec
- configurationpublic static ConsistentHash createConsistentHash(Configuration c, Collection<Address> addresses)
c
- configurationaddresses
- with which to populate the consistent hashpublic static ConsistentHash createConsistentHash(Configuration c, Collection<Address> addresses, Address... moreAddresses)
c
- configurationaddresses
- with which to populate the consistent hashmoreAddresses
- to add to the list of addresses @return a new consistent hash instancepublic static ConsistentHash createConsistentHash(Configuration c, Collection<Address> addresses, Collection<Address> moreAddresses)
c
- configurationaddresses
- with which to populate the consistent hashmoreAddresses
- to add to the list of addressespublic static ConsistentHash createConsistentHash(ConsistentHash template, Collection<Address> addresses)
template
- An older consistent hash instance to cloneaddresses
- with which to populate the consistent hashpublic static ConsistentHash createConsistentHash(ConsistentHash template, Collection<Address> addresses, Address... moreAddresses)
template
- An older consistent hash instance to cloneaddresses
- with which to populate the consistent hashmoreAddresses
- to add to the list of addressesCopyright © 2012 JBoss by Red Hat. All Rights Reserved.