Class ConsistentHashLocality

java.lang.Object
org.wildfly.clustering.infinispan.distribution.ConsistentHashLocality
All Implemented Interfaces:
Locality

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

    Constructors
    Constructor
    Description
    ConsistentHashLocality(org.infinispan.Cache<?,?> cache, org.infinispan.distribution.ch.ConsistentHash hash)
     
    ConsistentHashLocality(org.infinispan.distribution.ch.KeyPartitioner partitioner, org.infinispan.distribution.ch.ConsistentHash hash, org.infinispan.remoting.transport.Address localAddress)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Indicates whether the current node is the primary owner of the specified cache key.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ConsistentHashLocality

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

      public ConsistentHashLocality(org.infinispan.distribution.ch.KeyPartitioner partitioner, org.infinispan.distribution.ch.ConsistentHash hash, org.infinispan.remoting.transport.Address localAddress)
  • Method Details

    • 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