@MBean(objectName="DistributionManager", description="Component that handles distribution of content across a cluster") public class DistributionManagerImpl extends Object implements DistributionManager
Constructor and Description |
---|
DistributionManagerImpl() |
Modifier and Type | Method and Description |
---|---|
LocalizedCacheTopology |
createLocalizedCacheTopology(CacheTopology cacheTopology) |
LocalizedCacheTopology |
getCacheTopology() |
ConsistentHash |
getReadConsistentHash() |
ConsistentHash |
getWriteConsistentHash() |
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<String> |
locateKey(String key) |
static LocalizedCacheTopology |
makeSingletonTopology(CacheMode cacheMode,
KeyPartitioner keyPartitioner,
int numSegments,
Address localAddress) |
void |
setCacheTopology(CacheTopology cacheTopology) |
public ConsistentHash getReadConsistentHash()
getReadConsistentHash
in interface DistributionManager
public ConsistentHash getWriteConsistentHash()
getWriteConsistentHash
in interface DistributionManager
@ManagedOperation(description="Determines whether a given key is affected by an ongoing rehash, if any.", displayName="Could key be affected by rehash?") public boolean isAffectedByRehash(@Parameter(name="key",description="Key to check") Object key)
DistributionManager
isAffectedByRehash
in interface DistributionManager
key
- key to testpublic boolean isRehashInProgress()
isRehashInProgress
in interface DistributionManager
public boolean isJoinComplete()
DistributionManager
isJoinComplete
in interface DistributionManager
@ManagedOperation(description="Tells you whether a given key would be written to this instance of the cache according to the consistent hashing algorithm. Only works with String keys.", displayName="Is key local?") public boolean isLocatedLocally(@Parameter(name="key",description="Key to query") String key)
@ManagedOperation(description="Shows the addresses of the nodes where a write operation would store the entry associated with the specified key. Only works with String keys.", displayName="Locate key") public List<String> locateKey(@Parameter(name="key",description="Key to locate") String key)
public LocalizedCacheTopology getCacheTopology()
getCacheTopology
in interface DistributionManager
public void setCacheTopology(CacheTopology cacheTopology)
setCacheTopology
in interface DistributionManager
public LocalizedCacheTopology createLocalizedCacheTopology(CacheTopology cacheTopology)
createLocalizedCacheTopology
in interface DistributionManager
public static LocalizedCacheTopology makeSingletonTopology(CacheMode cacheMode, KeyPartitioner keyPartitioner, int numSegments, Address localAddress)
Copyright © 2021 JBoss by Red Hat. All rights reserved.