Interface ClusterAvailability
- All Known Implementing Classes:
HealthMonitor
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Tells the router whether a cluster is currently worth sending traffic to.
Read selection needs this answer on every operation, so it has to be a cheap in-memory lookup - not a ping. This interface is that lookup, and it keeps routing independent of how availability is decided:
- Phase 3 uses
alwaysAvailable(), so balancing spreads over every registered cluster; - Phase 5 supplies the health monitor's windowed state, and read selection starts skipping unhealthy clusters with no change to the selectors themselves.
Implementations must be non-blocking and safe for concurrent use.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ClusterAvailabilityTreats every cluster as available - the Phase 3 default, before health monitoring exists.booleanisAvailable(String clusterName) Whether the named cluster should receive traffic right now.
-
Method Details
-
isAvailable
Whether the named cluster should receive traffic right now. -
alwaysAvailable
Treats every cluster as available - the Phase 3 default, before health monitoring exists.
-