com.netflix.loadbalancer
Class AvailabilityFilteringRule
java.lang.Object
com.netflix.loadbalancer.AbstractLoadBalancerRule
com.netflix.loadbalancer.ClientConfigEnabledRoundRobinRule
com.netflix.loadbalancer.PredicateBasedRule
com.netflix.loadbalancer.AvailabilityFilteringRule
- All Implemented Interfaces:
- com.netflix.client.IClientConfigAware, IRule
public class AvailabilityFilteringRule
- extends PredicateBasedRule
A load balancer rule that filters out servers that:
- are in circuit breaker tripped state due to consecutive connection or read failures, or
- have active connections that exceeds a configurable limit (default is Integer.MAX_VALUE).
The property
to change this limit is
<clientName>.<nameSpace>.ActiveConnectionsLimit
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AvailabilityFilteringRule
public AvailabilityFilteringRule()
initWithNiwsConfig
public void initWithNiwsConfig(com.netflix.client.config.IClientConfig clientConfig)
- Specified by:
initWithNiwsConfig in interface com.netflix.client.IClientConfigAware- Overrides:
initWithNiwsConfig in class ClientConfigEnabledRoundRobinRule
getAvailableServersCount
@Monitor(name="AvailableServersCount",
type=GAUGE)
public int getAvailableServersCount()
choose
public Server choose(java.lang.Object key)
- This method is overridden to provide a more efficient implementation which does not iterate through
all servers. This is under the assumption that in most cases, there are more available instances
than not.
- Specified by:
choose in interface IRule- Overrides:
choose in class PredicateBasedRule
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