Class ConsistentHashLocality

  • All Implemented Interfaces:
    Locality

    public class ConsistentHashLocality
    extends Object
    implements Locality
    Locality implementation based on a ConsistentHash.
    Author:
    Paul Ferraro
    • Constructor Detail

      • ConsistentHashLocality

        public ConsistentHashLocality​(org.infinispan.Cache<?,​?> cache,
                                      org.infinispan.distribution.ch.ConsistentHash hash)
    • Method Detail

      • isLocal

        public boolean isLocal​(Object key)
        Description copied from interface: Locality
        Indicates whether the current node is the primary owner of the specified cache key. For local caches, this method will always return true.
        Specified by:
        isLocal in interface Locality
        Parameters:
        key - a cache key
        Returns:
        true, if the current node is the primary owner of the specified cache key, false otherwise