Class CacheTopology

  • Direct Known Subclasses:
    LocalizedCacheTopology

    public class CacheTopology
    extends Object
    The status of a cache from a distribution/state transfer point of view.

    The pending CH can be null if we don't have a state transfer in progress.

    The topologyId is incremented every time the topology changes (e.g. a member leaves, state transfer starts or ends). The rebalanceId is not modified when the consistent hashes are updated without requiring state transfer (e.g. when a member leaves).

    Since:
    5.2
    Author:
    Dan Berindei
    • Method Detail

      • getTopologyId

        public int getTopologyId()
      • getCurrentCH

        public ConsistentHash getCurrentCH()
        The current consistent hash.
      • getPendingCH

        public ConsistentHash getPendingCH()
        The future consistent hash. Should be null if there is no rebalance in progress.
      • getUnionCH

        public ConsistentHash getUnionCH()
        The union of the current and future consistent hashes. Should be null if there is no rebalance in progress.
      • getRebalanceId

        public int getRebalanceId()
        The id of the latest started rebalance.
      • getMembers

        public List<Address> getMembers()
        Returns:
        The nodes that are members in both consistent hashes (if pendingCH != null, otherwise the members of the current CH).
        See Also:
        getActualMembers()
      • getActualMembers

        public List<Address> getActualMembers()
        Returns:
        The nodes that are active members of the cache. It should be equal to getMembers() when the cache is available, and a strict subset if the cache is in degraded mode.
        See Also:
        AvailabilityMode
      • getReadConsistentHash

        public ConsistentHash getReadConsistentHash()
        Read operations should always go to the "current" owners.
      • getWriteConsistentHash

        public ConsistentHash getWriteConsistentHash()
        When there is a rebalance in progress, write operations should go to the union of the "current" and "future" owners.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • logRoutingTableInformation

        public final void logRoutingTableInformation()