Class ConsistentHashKeyRegistry<K>
- java.lang.Object
-
- org.wildfly.clustering.infinispan.affinity.impl.ConsistentHashKeyRegistry<K>
-
- All Implemented Interfaces:
KeyRegistry<K>
public class ConsistentHashKeyRegistry<K> extends Object implements KeyRegistry<K>
Registry of queues of keys with affinity to the members of a consistent hash.- Author:
- Paul Ferraro
-
-
Constructor Summary
Constructors Constructor Description ConsistentHashKeyRegistry(org.infinispan.distribution.ch.ConsistentHash hash, Predicate<org.infinispan.remoting.transport.Address> filter, Supplier<BlockingQueue<K>> queueFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<org.infinispan.remoting.transport.Address>getAddresses()Returns the addresses for which pre-generated keys are available.BlockingQueue<K>getKeys(org.infinispan.remoting.transport.Address address)Returns a queue of pre-generated keys with affinity for the specified address.
-
-
-
Constructor Detail
-
ConsistentHashKeyRegistry
public ConsistentHashKeyRegistry(org.infinispan.distribution.ch.ConsistentHash hash, Predicate<org.infinispan.remoting.transport.Address> filter, Supplier<BlockingQueue<K>> queueFactory)
-
-
Method Detail
-
getAddresses
public Set<org.infinispan.remoting.transport.Address> getAddresses()
Description copied from interface:KeyRegistryReturns the addresses for which pre-generated keys are available.- Specified by:
getAddressesin interfaceKeyRegistry<K>- Returns:
- a set of cluster members
-
getKeys
public BlockingQueue<K> getKeys(org.infinispan.remoting.transport.Address address)
Description copied from interface:KeyRegistryReturns a queue of pre-generated keys with affinity for the specified address.- Specified by:
getKeysin interfaceKeyRegistry<K>- Parameters:
address- the address of a cluster member.- Returns:
- a queue of pre-generated keys
-
-