Package akka.cluster
Class ClusterReadView
- java.lang.Object
-
- akka.cluster.ClusterReadView
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class ClusterReadView extends java.lang.Object implements java.io.Closeable
Current state
-
-
Constructor Summary
Constructors Constructor Description ClusterReadView(Cluster cluster)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Unsubscribe to cluster events.boolean
isAvailable()
Returns true if the node is not unreachable and notDown
and notRemoved
.boolean
isLeader()
Is this node the current data center leaderboolean
isSingletonCluster()
Does the cluster consist of only one member?boolean
isTerminated()
Returns true if this cluster instance has be shutdown.ClusterEvent.CurrentInternalStats
latestStats()
INTERNAL APIscala.Option<Address>
leader()
Get the address of the current data center leaderscala.collection.immutable.SortedSet<Member>
members()
Current cluster members, sorted by address.Reachability
reachability()
void
refreshCurrentState()
INTERNAL APIscala.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.
-
-
-
Constructor Detail
-
ClusterReadView
public ClusterReadView(Cluster cluster)
-
-
Method Detail
-
close
public void close()
Unsubscribe to cluster events.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
isAvailable
public boolean isAvailable()
Returns true if the node is not unreachable and notDown
and notRemoved
.- Returns:
- (undocumented)
-
isLeader
public boolean isLeader()
Is this node the current data center leader- Returns:
- (undocumented)
-
isSingletonCluster
public boolean isSingletonCluster()
Does the cluster consist of only one member?- Returns:
- (undocumented)
-
isTerminated
public boolean isTerminated()
Returns true if this cluster instance has be shutdown.- Returns:
- (undocumented)
-
latestStats
public ClusterEvent.CurrentInternalStats latestStats()
INTERNAL API- Returns:
- (undocumented)
-
leader
public scala.Option<Address> leader()
Get the address of the current data center leader- Returns:
- (undocumented)
-
members
public scala.collection.immutable.SortedSet<Member> members()
Current cluster members, sorted by address.- Returns:
- (undocumented)
-
reachability
public Reachability reachability()
-
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)
-
self
public Member self()
-
selfAddress
public Address selfAddress()
-
state
public ClusterEvent.CurrentClusterState state()
-
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)
-
unreachableMembers
public scala.collection.immutable.Set<Member> unreachableMembers()
Members that has been detected as unreachable.- Returns:
- (undocumented)
-
-