public class DistributionManagerImpl extends Object implements DistributionManager
| Constructor and Description |
|---|
DistributionManagerImpl()
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
ConsistentHash |
getConsistentHash()
Retrieves the consistent hash instance currently in use, an instance of the configured ConsistentHash
class (which defaults to
DefaultConsistentHash. |
DataLocality |
getLocality(Object key)
Returns the data locality characteristics of a given key.
|
Address |
getPrimaryLocation(Object key)
Returns the first Address containing the key.
|
ConsistentHash |
getReadConsistentHash() |
ConsistentHash |
getWriteConsistentHash() |
void |
init(RpcManager rpcManager,
StateTransferManager stateTransferManager) |
boolean |
isAffectedByRehash(Object key)
Tests whether a given key is affected by a rehash that may be in progress.
|
boolean |
isJoinComplete()
Tests whether the current instance has completed joining the cluster
|
boolean |
isLocatedLocally(String key) |
boolean |
isRehashInProgress()
Tests whether a rehash is in progress
|
List<Address> |
locate(Object key)
Locates a key in a cluster.
|
Set<Address> |
locateAll(Collection<Object> keys)
Locates a list of keys in a cluster.
|
List<String> |
locateKey(String key) |
public void init(RpcManager rpcManager, StateTransferManager stateTransferManager)
public DataLocality getLocality(Object key)
DistributionManagergetLocality in interface DistributionManagerkey - key to testpublic List<Address> locate(Object key)
DistributionManagerlocate in interface DistributionManagerkey - key to testpublic Address getPrimaryLocation(Object key)
DistributionManagerDistributionManager.locate(Object)getPrimaryLocation in interface DistributionManagerkey - key to testpublic Set<Address> locateAll(Collection<Object> keys)
DistributionManagerDistributionManager.locate(Object) the returned addresses may not be owners
of the keys if a rehash happens to be in progress or is pending, so when querying these servers, invalid responses
should be checked for and the next address checked accordingly.locateAll in interface DistributionManagerkeys - list of keys to locatepublic ConsistentHash getConsistentHash()
DistributionManagerDefaultConsistentHash.getConsistentHash in interface DistributionManagerpublic ConsistentHash getReadConsistentHash()
getReadConsistentHash in interface DistributionManagerpublic ConsistentHash getWriteConsistentHash()
getWriteConsistentHash in interface DistributionManagerpublic boolean isAffectedByRehash(Object key)
DistributionManagerisAffectedByRehash in interface DistributionManagerkey - key to testpublic boolean isRehashInProgress()
isRehashInProgress in interface DistributionManagerpublic boolean isJoinComplete()
DistributionManagerisJoinComplete in interface DistributionManagerpublic boolean isLocatedLocally(String key)
Copyright © 2025 JBoss, a division of Red Hat. All rights reserved.