Class LocalizedCacheTopology


  • public class LocalizedCacheTopology
    extends CacheTopology
    Extends CacheTopology with information about keys owned by the local node.
    Since:
    9.0
    Author:
    Dan Berindei
    • Method Detail

      • makeSingletonTopology

        public static LocalizedCacheTopology makeSingletonTopology​(CacheMode cacheMode,
                                                                   Address localAddress)
        Parameters:
        cacheMode - Ignored, the result topology is always LOCAL
        localAddress - Address of the local node
      • isReadOwner

        public boolean isReadOwner​(Object key)
        Returns:
        true iff key key can be read without going remote.
      • isSegmentReadOwner

        public boolean isSegmentReadOwner​(int segment)
      • isWriteOwner

        public boolean isWriteOwner​(Object key)
        Returns:
        true iff writing a value for key key will update it on the local node.
      • isSegmentWriteOwner

        public boolean isSegmentWriteOwner​(int segment)
      • getSegment

        public int getSegment​(Object key)
        Returns:
        The consistent hash segment of key key
      • getDistributionForSegment

        @Deprecated
        public DistributionInfo getDistributionForSegment​(int segmentId)
        Deprecated.
        since 9.3 please use getSegmentDistribution(int) instead.
        Returns:
        Information about the ownership of segment segment, including the primary owner.
      • getSegmentDistribution

        public DistributionInfo getSegmentDistribution​(int segmentId)
      • getDistribution

        public DistributionInfo getDistribution​(Object key)
        Returns:
        Information about the ownership of key key, including the primary owner.
      • getWriteOwners

        public Collection<Address> getWriteOwners​(Object key)
        Returns:
        An unordered collection with the write owners of key.
      • getWriteOwners

        public Collection<Address> getWriteOwners​(Collection<?> keys)
        Returns:
        An unordered collection with the write owners of keys.
      • getLocalReadSegments

        public org.infinispan.commons.util.IntSet getLocalReadSegments()
        Returns:
        The segments owned by the local node for reading.
      • getLocalAddress

        public Address getLocalAddress()
        Returns:
        The address of the local node.
      • getMembersSet

        public Set<Address> getMembersSet()
      • isConnected

        public boolean isConnected()
        Returns:
        true if the local node received this topology from the coordinator, false otherwise (e.g. during preload).