Package akka.cluster

Class ClusterReadView

  • All Implemented Interfaces:, java.lang.AutoCloseable

    public class ClusterReadView
    extends java.lang.Object

    Read view of cluster state, updated via subscription of cluster events published on the event bus.

    • Constructor Detail

      • ClusterReadView

        public ClusterReadView​(Cluster cluster)
    • Method Detail

      • close

        public void close()
        Unsubscribe to cluster events.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface
      • isAvailable

        public boolean isAvailable()
        Returns true if the node is not unreachable and not Down and not Removed.
      • isLeader

        public boolean isLeader()
        Is this node the current data center leader
      • isSingletonCluster

        public boolean isSingletonCluster()
        Does the cluster consist of only one member?
      • isTerminated

        public boolean isTerminated()
        Returns true if this cluster instance has be shutdown.
      • leader

        public scala.Option<Address> leader()
        Get the address of the current data center leader
      • members

        public scala.collection.immutable.SortedSet<Member> members()
        Current cluster members, sorted by address.
      • seenBy

        public scala.collection.immutable.Set<Address> seenBy()
        INTERNAL API The nodes that has seen current version of the Gossip.
      • selfAddress

        public Address selfAddress()
      • status

        public MemberStatus status()
        Member status for this node (MemberStatus).

        NOTE: If the node has been removed from the cluster (and shut down) then it's status is set to the 'REMOVED' tombstone state and is no longer present in the node ring or any other part of the gossiping state. However in order to maintain the model and the semantics the user would expect, this method will in this situation return MemberStatus.Removed.

      • unreachableMembers

        public scala.collection.immutable.Set<Member> unreachableMembers()
        Members that has been detected as unreachable.