com.netflix.loadbalancer
Class DynamicServerListLoadBalancer<T extends Server>
java.lang.Object
com.netflix.loadbalancer.AbstractLoadBalancer
com.netflix.loadbalancer.BaseLoadBalancer
com.netflix.loadbalancer.DynamicServerListLoadBalancer<T>
- All Implemented Interfaces:
- IClientConfigAware, PrimeConnections.PrimeConnectionListener, ILoadBalancer
- Direct Known Subclasses:
- ZoneAwareLoadBalancer
public class DynamicServerListLoadBalancer<T extends Server>
- extends BaseLoadBalancer
A LoadBalancer that has the capabilities to obtain the candidate list of
servers using a dynamic source. i.e. The list of servers can potentially be
changed at Runtime. It also contains facilities wherein the list of servers
can be passed through a Filter criteria to filter out servers that do not
meet the desired criteria.
Fields inherited from class com.netflix.loadbalancer.BaseLoadBalancer |
allServerList, allServerLock, lbStats, lbTimer, maxTotalPingTimeSeconds, name, ping, pingInProgress, pingIntervalSeconds, rule, serverComparator, upServerList, upServerLock |
Methods inherited from class com.netflix.loadbalancer.BaseLoadBalancer |
addServer, addServers, cancelPingTask, choose, chooseServer, getLoadBalancerStats, getMaxTotalPingTime, getName, getPing, getPingInterval, getPrimeConnections, getRule, getServerByIndex, getServerCount, getServerList, getServerList, init, isEnablePrimingConnections, isPingInProgress, lockAllServerList, lockUpServerList, markServerDown, markServerDown, primeCompleted, setEnablePrimingConnections, setLoadBalancerStats, setMaxTotalPingTime, setPingInterval, setPrimeConnections |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
serverListUpdateInProgress
protected java.util.concurrent.atomic.AtomicBoolean serverListUpdateInProgress
DynamicServerListLoadBalancer
public DynamicServerListLoadBalancer()
DynamicServerListLoadBalancer
public DynamicServerListLoadBalancer(IClientConfig niwsClientConfig)
initWithNiwsConfig
public void initWithNiwsConfig(IClientConfig clientConfig)
- Description copied from interface:
IClientConfigAware
- Concrete implementation should implement this method so that the configuration set via
IClientConfig
(which in turn were set via Archaius properties) will be taken into consideration
- Specified by:
initWithNiwsConfig
in interface IClientConfigAware
- Overrides:
initWithNiwsConfig
in class BaseLoadBalancer
setServersList
public void setServersList(java.util.List lsrv)
- Description copied from class:
BaseLoadBalancer
- Set the list of servers used as the server pool. This overrides existing
server list.
- Overrides:
setServersList
in class BaseLoadBalancer
setServerListForZones
protected void setServerListForZones(java.util.Map<java.lang.String,java.util.List<Server>> zoneServersMap)
getServerListImpl
public ServerList<T> getServerListImpl()
setServerListImpl
public void setServerListImpl(ServerList<T> niwsServerList)
setPing
public void setPing(IPing ping)
- Overrides:
setPing
in class BaseLoadBalancer
setRule
public void setRule(IRule rule)
- Overrides:
setRule
in class BaseLoadBalancer
getFilter
public ServerListFilter<T> getFilter()
setFilter
public void setFilter(ServerListFilter<T> filter)
forceQuickPing
public void forceQuickPing()
- Overrides:
forceQuickPing
in class BaseLoadBalancer
enableAndInitLearnNewServersFeature
public void enableAndInitLearnNewServersFeature()
- Feature that lets us add new instances (from AMIs) to the list of
existing servers that the LB will use Call this method if you want this
feature enabled
shutdownExecutorPool
public void shutdownExecutorPool()
updateAllServerList
protected void updateAllServerList(java.util.List<T> ls)
- Update the AllServer list in the LoadBalancer if necessary and enabled
- Parameters:
ls
-
toString
public java.lang.String toString()
- Overrides:
toString
in class BaseLoadBalancer