com.netflix.loadbalancer
Class ZoneAvoidanceRule
java.lang.Object
com.netflix.loadbalancer.AbstractLoadBalancerRule
com.netflix.loadbalancer.ClientConfigEnabledRoundRobinRule
com.netflix.loadbalancer.PredicateBasedRule
com.netflix.loadbalancer.ZoneAvoidanceRule
- All Implemented Interfaces:
- com.netflix.client.IClientConfigAware, IRule
public class ZoneAvoidanceRule
- extends PredicateBasedRule
A rule that uses the a CompositePredicate to filter servers based on zone and availability. The primary predicate is composed of
a ZoneAvoidancePredicate and AvailabilityPredicate, with the fallbacks to AvailabilityPredicate
and an "always true" predicate returned from AbstractServerPredicate.alwaysTrue()
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ZoneAvoidanceRule
public ZoneAvoidanceRule()
initWithNiwsConfig
public void initWithNiwsConfig(com.netflix.client.config.IClientConfig clientConfig)
- Specified by:
initWithNiwsConfig in interface com.netflix.client.IClientConfigAware- Overrides:
initWithNiwsConfig in class ClientConfigEnabledRoundRobinRule
getAvailableZones
public static java.util.Set<java.lang.String> getAvailableZones(java.util.Map<java.lang.String,ZoneSnapshot> snapshot,
double triggeringLoad,
double triggeringBlackoutPercentage)
getAvailableZones
public static java.util.Set<java.lang.String> getAvailableZones(LoadBalancerStats lbStats,
double triggeringLoad,
double triggeringBlackoutPercentage)
getPredicate
public AbstractServerPredicate getPredicate()
- Description copied from class:
PredicateBasedRule
- Method that provides an instance of
AbstractServerPredicate to be used by this class.
- Specified by:
getPredicate in class PredicateBasedRule