com.netflix.loadbalancer
Class BestAvailableRule
java.lang.Object
com.netflix.loadbalancer.AbstractLoadBalancerRule
com.netflix.loadbalancer.ClientConfigEnabledRoundRobinRule
com.netflix.loadbalancer.BestAvailableRule
- All Implemented Interfaces:
- com.netflix.client.IClientConfigAware, IRule
public class BestAvailableRule
- extends ClientConfigEnabledRoundRobinRule
A rule that skips servers with "tripped" circuit breaker and picks the
server with lowest concurrent requests.
This rule should typically work with ServerListSubsetFilter which puts a limit on the
servers that is visible to the rule. This ensure that it only needs to find the minimal
concurrent requests among a small number of servers. Also, each client will get a random list of
servers which avoids the problem that one server with the lowest concurrent requests is
chosen by a large number of clients and immediately gets overwhelmed.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BestAvailableRule
public BestAvailableRule()
choose
public Server choose(java.lang.Object key)
- Specified by:
choose in interface IRule- Overrides:
choose in class ClientConfigEnabledRoundRobinRule
setLoadBalancer
public void setLoadBalancer(ILoadBalancer lb)
- Specified by:
setLoadBalancer in interface IRule- Overrides:
setLoadBalancer in class ClientConfigEnabledRoundRobinRule