akka.cluster
Class ClusterReadView

java.lang.Object
  extended by akka.cluster.ClusterReadView
All Implemented Interfaces:
java.io.Closeable

public class ClusterReadView
extends java.lang.Object
implements java.io.Closeable

INTERNAL API

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


Constructor Summary
ClusterReadView(Cluster cluster)
           
 
Method Summary
 void close()
          Unsubscribe to cluster events.
 scala.collection.immutable.Set<NodeMetrics> clusterMetrics()
          Current cluster metrics.
 boolean isAvailable()
          Returns true if the node is not unreachable and not Down and not Removed.
 boolean isLeader()
          Is this node the leader?
 boolean isSingletonCluster()
          Does the cluster consist of only one member?
 boolean isTerminated()
          Returns true if this cluster instance has be shutdown.
 ClusterEvent.CurrentInternalStats latestStats()
          INTERNAL API
 scala.Option<Address> leader()
          Get the address of the current leader.
 scala.collection.immutable.SortedSet<Member> members()
          Current cluster members, sorted by address.
 Reachability reachability()
           
 void refreshCurrentState()
          INTERNAL API
 scala.collection.immutable.Set<Address> seenBy()
          INTERNAL API The nodes that has seen current version of the Gossip.
 Member self()
           
 Address selfAddress()
           
 ClusterEvent.CurrentClusterState state()
           
 MemberStatus status()
          Member status for this node (MemberStatus).
 scala.collection.immutable.Set<Member> unreachableMembers()
          Members that has been detected as unreachable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClusterReadView

public ClusterReadView(Cluster cluster)
Method Detail

selfAddress

public Address selfAddress()

state

public ClusterEvent.CurrentClusterState state()

self

public Member self()

isTerminated

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

Returns:
(undocumented)

members

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

Returns:
(undocumented)

unreachableMembers

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

Returns:
(undocumented)

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.

Returns:
(undocumented)

isLeader

public boolean isLeader()
Is this node the leader?

Returns:
(undocumented)

leader

public scala.Option<Address> leader()
Get the address of the current leader.

Returns:
(undocumented)

isSingletonCluster

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

Returns:
(undocumented)

isAvailable

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

Returns:
(undocumented)

reachability

public Reachability reachability()

clusterMetrics

public scala.collection.immutable.Set<NodeMetrics> clusterMetrics()
Current cluster metrics.

Returns:
(undocumented)

refreshCurrentState

public void refreshCurrentState()
INTERNAL API


seenBy

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

Returns:
(undocumented)

latestStats

public ClusterEvent.CurrentInternalStats latestStats()
INTERNAL API

Returns:
(undocumented)

close

public void close()
Unsubscribe to cluster events.

Specified by:
close in interface java.io.Closeable