Interface DistributionManager


  • public interface DistributionManager
    A component that manages the distribution of elements across a cache cluster
    Since:
    4.0
    Author:
    Manik Surtani, Mircea.Markus@jboss.com, Vladimir Blagojevic, anistor@redhat.com
    • Method Detail

      • getLocality

        @Deprecated
        DataLocality getLocality​(Object key)
        Deprecated.
        Since 9.0, please use getCacheTopology().getDistributionInfo(key) instead.
        Returns the data locality characteristics of a given key.
        Parameters:
        key - key to test
        Returns:
        a DataLocality that allows you to test whether a key is mapped to the local node or not, and the degree of certainty of such a result.
      • locate

        @Deprecated
        List<org.infinispan.remoting.transport.Address> locate​(Object key)
        Deprecated.
        Since 9.0, please use getCacheTopology().getDistributionInfo(key) instead.
        Locates a key in a cluster. The returned addresses may not be owners of the keys if a rehash happens to be in progress or is pending, so when querying these servers, invalid responses should be checked for and the next address checked accordingly.
        Parameters:
        key - key to test
        Returns:
        a list of addresses where the key may reside
      • getPrimaryLocation

        @Deprecated
        org.infinispan.remoting.transport.Address getPrimaryLocation​(Object key)
        Deprecated.
        Since 9.0, please use getCacheTopology().getDistributionInfo(key) instead.
        Returns the first Address containing the key. Equivalent to returning the first element of locate(Object)
        Parameters:
        key - key to test
        Returns:
        the first address on which the key may reside
      • locateAll

        @Deprecated
        Set<org.infinispan.remoting.transport.Address> locateAll​(Collection<Object> keys)
        Deprecated.
        Since 9.0, no direct replacement.
        Locates a list of keys in a cluster. Like locate(Object) the returned addresses may not be owners of the keys if a rehash happens to be in progress or is pending, so when querying these servers, invalid responses should be checked for and the next address checked accordingly.
        Parameters:
        keys - list of keys to locate
        Returns:
        all the nodes that would need to write a copy of one of the keys.
      • getReadConsistentHash

        ConsistentHash getReadConsistentHash()
        Returns:
        the consistent hash used for reading.
      • getWriteConsistentHash

        ConsistentHash getWriteConsistentHash()
        Returns:
        the consistent hash used for writing.
      • isAffectedByRehash

        boolean isAffectedByRehash​(Object key)
        Tests whether a given key is affected by a rehash that may be in progress. If no rehash is in progress, this method returns false. Helps determine whether additional steps are necessary in handling an operation with a given key.
        Parameters:
        key - key to test
        Returns:
        whether a key is affected by a rehash
      • isRehashInProgress

        boolean isRehashInProgress()
        Tests whether a rehash is in progress
        Returns:
        true if a rehash is in progress, false otherwise
      • isJoinComplete

        boolean isJoinComplete()
        Tests whether the current instance has completed joining the cluster
        Returns:
        true if join is in progress, false otherwise
      • getCacheTopology

        LocalizedCacheTopology getCacheTopology()
        Returns:
        the current cache topology, which includes the read and write consistent hashes.
      • setCacheTopology

        @Deprecated
        void setCacheTopology​(org.infinispan.topology.CacheTopology cacheTopology)
        Deprecated.
        Internal only.
      • createLocalizedCacheTopology

        LocalizedCacheTopology createLocalizedCacheTopology​(org.infinispan.topology.CacheTopology cacheTopology)