|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.netflix.loadbalancer.AbstractServerPredicate
public abstract class AbstractServerPredicate
A basic building block for server filtering logic which can be used in rules and server list filters.
The input object of the predicate is PredicateKey, which has Server and load balancer key
information. Therefore, it is possible to develop logic to filter servers by both Server and load balancer
key or either one of them.
| Field Summary | |
|---|---|
protected IRule |
rule
|
| Constructor Summary | |
|---|---|
AbstractServerPredicate()
|
|
AbstractServerPredicate(IRule rule)
|
|
AbstractServerPredicate(IRule rule,
com.netflix.client.config.IClientConfig clientConfig)
|
|
AbstractServerPredicate(LoadBalancerStats lbStats,
com.netflix.client.config.IClientConfig clientConfig)
|
|
| Method Summary | |
|---|---|
static AbstractServerPredicate |
alwaysTrue()
|
com.google.common.base.Optional<Server> |
chooseRandomlyAfterFiltering(java.util.List<Server> servers)
Choose a random server after the predicate filters a list of servers. |
com.google.common.base.Optional<Server> |
chooseRandomlyAfterFiltering(java.util.List<Server> servers,
java.lang.Object loadBalancerKey)
Choose a random server after the predicate filters list of servers given list of servers and load balancer key. |
com.google.common.base.Optional<Server> |
chooseRoundRobinAfterFiltering(java.util.List<Server> servers)
Choose a server in a round robin fashion after the predicate filters a list of servers. |
com.google.common.base.Optional<Server> |
chooseRoundRobinAfterFiltering(java.util.List<Server> servers,
java.lang.Object loadBalancerKey)
Choose a server in a round robin fashion after the predicate filters a given list of servers and load balancer key. |
java.util.List<Server> |
getEligibleServers(java.util.List<Server> servers)
Get servers filtered by this predicate from list of servers. |
java.util.List<Server> |
getEligibleServers(java.util.List<Server> servers,
java.lang.Object loadBalancerKey)
Get servers filtered by this predicate from list of servers. |
protected LoadBalancerStats |
getLBStats()
|
com.google.common.base.Predicate<Server> |
getServerOnlyPredicate()
Get the predicate to filter list of servers. |
static AbstractServerPredicate |
ofKeyPredicate(com.google.common.base.Predicate<PredicateKey> p)
Create an instance from a predicate. |
static AbstractServerPredicate |
ofServerPredicate(com.google.common.base.Predicate<Server> p)
Create an instance from a predicate. |
void |
setLoadBalancerStats(LoadBalancerStats stats)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.google.common.base.Predicate |
|---|
apply, equals |
| Field Detail |
|---|
protected IRule rule
| Constructor Detail |
|---|
public AbstractServerPredicate()
public AbstractServerPredicate(IRule rule)
public AbstractServerPredicate(IRule rule,
com.netflix.client.config.IClientConfig clientConfig)
public AbstractServerPredicate(LoadBalancerStats lbStats,
com.netflix.client.config.IClientConfig clientConfig)
| Method Detail |
|---|
public static AbstractServerPredicate alwaysTrue()
protected LoadBalancerStats getLBStats()
public void setLoadBalancerStats(LoadBalancerStats stats)
public com.google.common.base.Predicate<Server> getServerOnlyPredicate()
public java.util.List<Server> getEligibleServers(java.util.List<Server> servers)
getEligibleServers(List, Object)
public java.util.List<Server> getEligibleServers(java.util.List<Server> servers,
java.lang.Object loadBalancerKey)
public com.google.common.base.Optional<Server> chooseRandomlyAfterFiltering(java.util.List<Server> servers)
public com.google.common.base.Optional<Server> chooseRoundRobinAfterFiltering(java.util.List<Server> servers)
public com.google.common.base.Optional<Server> chooseRandomlyAfterFiltering(java.util.List<Server> servers,
java.lang.Object loadBalancerKey)
public com.google.common.base.Optional<Server> chooseRoundRobinAfterFiltering(java.util.List<Server> servers,
java.lang.Object loadBalancerKey)
public static AbstractServerPredicate ofKeyPredicate(com.google.common.base.Predicate<PredicateKey> p)
public static AbstractServerPredicate ofServerPredicate(com.google.common.base.Predicate<Server> p)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||