public class RibbonLoadBalancer
extends java.lang.Object
implements io.micronaut.http.client.LoadBalancer, com.netflix.loadbalancer.ILoadBalancer
LoadBalancer
that is also a Ribbon ILoadBalancer
.Constructor and Description |
---|
RibbonLoadBalancer(com.netflix.client.config.IClientConfig niwsClientConfig,
com.netflix.loadbalancer.ServerList serverList,
com.netflix.loadbalancer.ServerListFilter serverListFilter,
com.netflix.loadbalancer.IRule rule,
com.netflix.loadbalancer.IPing ping)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addServers(java.util.List<com.netflix.loadbalancer.Server> newServers) |
com.netflix.loadbalancer.Server |
chooseServer(java.lang.Object key) |
protected com.netflix.loadbalancer.ILoadBalancer |
createLoadBalancer(com.netflix.client.config.IClientConfig clientConfig,
com.netflix.loadbalancer.IRule rule,
com.netflix.loadbalancer.IPing ping,
com.netflix.loadbalancer.ServerListFilter serverListFilter,
com.netflix.loadbalancer.ServerList<com.netflix.loadbalancer.Server> serverList)
Creates the
ILoadBalancer to use. |
java.util.List<com.netflix.loadbalancer.Server> |
getAllServers() |
com.netflix.client.config.IClientConfig |
getClientConfig() |
com.netflix.loadbalancer.ILoadBalancer |
getLoadBalancer() |
com.netflix.loadbalancer.LoadBalancerContext |
getLoadBalancerContext() |
java.util.List<com.netflix.loadbalancer.Server> |
getReachableServers() |
java.util.List<com.netflix.loadbalancer.Server> |
getServerList(boolean availableOnly) |
void |
markServerDown(com.netflix.loadbalancer.Server server) |
org.reactivestreams.Publisher<io.micronaut.discovery.ServiceInstance> |
select(java.lang.Object discriminator) |
public RibbonLoadBalancer(com.netflix.client.config.IClientConfig niwsClientConfig, com.netflix.loadbalancer.ServerList serverList, com.netflix.loadbalancer.ServerListFilter serverListFilter, com.netflix.loadbalancer.IRule rule, com.netflix.loadbalancer.IPing ping)
niwsClientConfig
- niwsClientConfigserverList
- serverListserverListFilter
- serverListFilterrule
- ruleping
- pingpublic com.netflix.client.config.IClientConfig getClientConfig()
IClientConfig
used to construct this load balancerpublic com.netflix.loadbalancer.ILoadBalancer getLoadBalancer()
public com.netflix.loadbalancer.LoadBalancerContext getLoadBalancerContext()
LoadBalancerContext
for this load balancerpublic org.reactivestreams.Publisher<io.micronaut.discovery.ServiceInstance> select(java.lang.Object discriminator)
select
in interface io.micronaut.http.client.LoadBalancer
public void addServers(java.util.List<com.netflix.loadbalancer.Server> newServers)
addServers
in interface com.netflix.loadbalancer.ILoadBalancer
public com.netflix.loadbalancer.Server chooseServer(java.lang.Object key)
chooseServer
in interface com.netflix.loadbalancer.ILoadBalancer
public void markServerDown(com.netflix.loadbalancer.Server server)
markServerDown
in interface com.netflix.loadbalancer.ILoadBalancer
public java.util.List<com.netflix.loadbalancer.Server> getServerList(boolean availableOnly)
getServerList
in interface com.netflix.loadbalancer.ILoadBalancer
public java.util.List<com.netflix.loadbalancer.Server> getReachableServers()
getReachableServers
in interface com.netflix.loadbalancer.ILoadBalancer
public java.util.List<com.netflix.loadbalancer.Server> getAllServers()
getAllServers
in interface com.netflix.loadbalancer.ILoadBalancer
protected com.netflix.loadbalancer.ILoadBalancer createLoadBalancer(com.netflix.client.config.IClientConfig clientConfig, com.netflix.loadbalancer.IRule rule, com.netflix.loadbalancer.IPing ping, com.netflix.loadbalancer.ServerListFilter serverListFilter, com.netflix.loadbalancer.ServerList<com.netflix.loadbalancer.Server> serverList)
ILoadBalancer
to use. Defaults to ZoneAwareLoadBalancer
. Subclasses can override to provide custom behaviourclientConfig
- The client configrule
- The IRule
ping
- THe IPing
serverListFilter
- The ServerListFilter
serverList
- The ServerList
ILoadBalancer
instance. Never null