Package org.infinispan.distribution
Interface DistributionManager
-
public interface DistributionManagerA component that manages the distribution of elements across a cache cluster- Since:
- 4.0
- Author:
- Manik Surtani, Mircea.Markus@jboss.com, Vladimir Blagojevic, anistor@redhat.com
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description LocalizedCacheTopologycreateLocalizedCacheTopology(CacheTopology cacheTopology)LocalizedCacheTopologygetCacheTopology()default ConsistentHashgetConsistentHash()Deprecated.Since 9.0, please usegetWriteConsistentHash()instead.DataLocalitygetLocality(java.lang.Object key)Deprecated.Since 9.0, please usegetCacheTopology().getDistributionInfo(key)instead.AddressgetPrimaryLocation(java.lang.Object key)Deprecated.Since 9.0, please usegetCacheTopology().getDistributionInfo(key)instead.ConsistentHashgetReadConsistentHash()ConsistentHashgetWriteConsistentHash()booleanisAffectedByRehash(java.lang.Object key)Tests whether a given key is affected by a rehash that may be in progress.booleanisJoinComplete()Tests whether the current instance has completed joining the clusterbooleanisRehashInProgress()Tests whether a rehash is in progressjava.util.List<Address>locate(java.lang.Object key)Deprecated.Since 9.0, please usegetCacheTopology().getDistributionInfo(key)instead.java.util.Set<Address>locateAll(java.util.Collection<java.lang.Object> keys)Deprecated.Since 9.0, no direct replacement.voidsetCacheTopology(CacheTopology cacheTopology)Deprecated.Internal only.
-
-
-
Method Detail
-
getLocality
@Deprecated DataLocality getLocality(java.lang.Object key)
Deprecated.Since 9.0, please usegetCacheTopology().getDistributionInfo(key)instead.Returns the data locality characteristics of a given key.- Parameters:
key- key to test- Returns:
- a DataLocality that allows you to test whether a key is mapped to the local node or not, and the degree of certainty of such a result.
-
locate
@Deprecated java.util.List<Address> locate(java.lang.Object key)
Deprecated.Since 9.0, please usegetCacheTopology().getDistributionInfo(key)instead.Locates a key in a cluster. 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.- Parameters:
key- key to test- Returns:
- a list of addresses where the key may reside
-
getPrimaryLocation
@Deprecated Address getPrimaryLocation(java.lang.Object key)
Deprecated.Since 9.0, please usegetCacheTopology().getDistributionInfo(key)instead.Returns the first Address containing the key. Equivalent to returning the first element oflocate(Object)- Parameters:
key- key to test- Returns:
- the first address on which the key may reside
-
locateAll
@Deprecated java.util.Set<Address> locateAll(java.util.Collection<java.lang.Object> keys)
Deprecated.Since 9.0, no direct replacement.Locates a list of keys in a cluster. Likelocate(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.- Parameters:
keys- list of keys to locate- Returns:
- all the nodes that would need to write a copy of one of the keys.
-
getConsistentHash
@Deprecated default ConsistentHash getConsistentHash()
Deprecated.Since 9.0, please usegetWriteConsistentHash()instead.- Returns:
- the consistent hash used for writing.
-
getReadConsistentHash
ConsistentHash getReadConsistentHash()
- Returns:
- the consistent hash used for reading.
-
getWriteConsistentHash
ConsistentHash getWriteConsistentHash()
- Returns:
- the consistent hash used for writing.
-
isAffectedByRehash
boolean isAffectedByRehash(java.lang.Object key)
Tests whether a given key is affected by a rehash that may be in progress. If no rehash is in progress, this method returns false. Helps determine whether additional steps are necessary in handling an operation with a given key.- Parameters:
key- key to test- Returns:
- whether a key is affected by a rehash
-
isRehashInProgress
boolean isRehashInProgress()
Tests whether a rehash is in progress- Returns:
- true if a rehash is in progress, false otherwise
-
isJoinComplete
boolean isJoinComplete()
Tests whether the current instance has completed joining the cluster- Returns:
- true if join is in progress, false otherwise
-
getCacheTopology
LocalizedCacheTopology getCacheTopology()
- Returns:
- the current cache topology, which includes the read and write consistent hashes.
-
setCacheTopology
@Deprecated void setCacheTopology(CacheTopology cacheTopology)
Deprecated.Internal only.
-
createLocalizedCacheTopology
LocalizedCacheTopology createLocalizedCacheTopology(CacheTopology cacheTopology)
-
-