Class ClusterRegistry.Snapshot
- Enclosing class:
ClusterRegistry
-
Method Summary
Modifier and TypeMethodDescriptionactive()Name to proxy, in registration order.clusters()Failover order: configured priorities first, then any registered cluster the list omits, in registration order - so failover is never stranded by a partial configuration.booleanisEmpty()booleanisInReadRotation(String name) Whether this cluster may serve round-robin reads.booleanisPromotable(String name) Whether this cluster may be promoted to active.booleanWhetherREAD_ACTIVEreads currently go somewhere other than where mutations go.The priority list exactly as configured; empty means "registration order".The clusterREAD_ACTIVEreads go to: the pinned read cluster if there is one, otherwise the active cluster.The pinned read cluster, ornullwhen reads follow the active cluster.Clusters eligible for round-robin reads, in registration order.intsize()toString()
-
Method Details
-
clusters
-
isEmpty
public boolean isEmpty() -
size
public int size() -
find
-
findName
-
activeName
-
active
-
readActiveName
The clusterREAD_ACTIVEreads go to: the pinned read cluster if there is one, otherwise the active cluster. With no pin the two roles are one, which is the default and the only way to get read-your-writes. -
readActive
-
readActivePin
The pinned read cluster, ornullwhen reads follow the active cluster. -
isReadActiveSplit
public boolean isReadActiveSplit()WhetherREAD_ACTIVEreads currently go somewhere other than where mutations go. -
priorityList
-
readRotation
Clusters eligible for round-robin reads, in registration order.Registering a cluster puts it in, and only an explicit
ClusterRegistry.removeFromReadRotation(String)takes it out - a cluster that fails is reported rather than removed, and what becomes of it is the application's call. Membership is not availability: the rotation says where a cluster belongs, and health decides whether it is currently worth sending traffic to, so a cluster can be in the rotation and skipped by every read. It governsREAD_ROUND_ROBINreads only: the active cluster keeps servingREAD_ACTIVEreads, local calls and mutations even when it is out of the rotation, because otherwise removing it would silently stop all reads. -
isInReadRotation
Whether this cluster may serve round-robin reads. -
isPromotable
Whether this cluster may be promoted to active. -
failoverOrder
Failover order: configured priorities first, then any registered cluster the list omits, in registration order - so failover is never stranded by a partial configuration.A cluster explicitly removed from the priority list is a different thing from one that was simply never listed, and is left out entirely. Without that distinction a cluster dropped on failure would be re-elected as active by the very next promotion, which is exactly what removing it was meant to prevent.
-
asProxyMap
-
toString
-