Class 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 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: KeyRegistry
        Returns the addresses for which pre-generated keys are available.
        Specified by:
        getAddresses in interface KeyRegistry<K>
        Returns:
        a set of cluster members
      • getKeys

        public BlockingQueue<K> getKeys​(org.infinispan.remoting.transport.Address address)
        Description copied from interface: KeyRegistry
        Returns a queue of pre-generated keys with affinity for the specified address.
        Specified by:
        getKeys in interface KeyRegistry<K>
        Parameters:
        address - the address of a cluster member.
        Returns:
        a queue of pre-generated keys