Interface KeyDistribution
- All Known Implementing Classes:
ConsistentHashKeyDistribution
public interface KeyDistribution
Provides key distribution functions.
- Author:
- Paul Ferraro
-
Method Summary
Modifier and TypeMethodDescriptionstatic KeyDistributionforCache(org.infinispan.Cache<?, ?> cache) Creates a key distribution for the current consistent hash of the specified cache.static KeyDistributionforConsistentHash(org.infinispan.Cache<?, ?> cache, org.infinispan.distribution.ch.ConsistentHash hash) Creates a key distribution for the specified consistent hash of the specified cache.List<org.infinispan.remoting.transport.Address> Returns the owners of the specified key.org.infinispan.remoting.transport.AddressgetPrimaryOwner(Object key) Returns the primary owner of the specified key.
-
Method Details
-
getPrimaryOwner
Returns the primary owner of the specified key.- Parameters:
key- a cache key- Returns:
- the address of the primary owner
-
getOwners
-
forCache
Creates a key distribution for the current consistent hash of the specified cache.- Parameters:
cache- an embedded cache- Returns:
- a key distribution for the current consistent hash of the specified cache.
-
forConsistentHash
static KeyDistribution forConsistentHash(org.infinispan.Cache<?, ?> cache, org.infinispan.distribution.ch.ConsistentHash hash) Creates a key distribution for the specified consistent hash of the specified cache.- Parameters:
cache- an embedded cachehash- a consistent hash- Returns:
- a key distribution for the specified consistent hash of the specified cache.
-