com.netflix.loadbalancer
Interface ILoadBalancer

All Known Implementing Classes:
AbstractLoadBalancer, BaseLoadBalancer, DynamicServerListLoadBalancer, NoOpLoadBalancer, ZoneAwareLoadBalancer

public interface ILoadBalancer

Interface that defines the operations for a software loadbalancer. A typical loadbalancer minimally need a set of servers to loadbalance for, a method to mark a particular server to be out of rotation and a call that will choose a server from the existing list of server.


Method Summary
 void addServers(java.util.List<Server> newServers)
          Initial list of servers.
 Server chooseServer(java.lang.Object key)
          Choose a server from load balancer.
 void markServerDown(Server server)
          To be called by the clients of the load balancer to notify that a Server is down else, the LB will think its still Alive until the next Ping cycle - potentially (assuming that the LB Impl does a ping)
 

Method Detail

addServers

void addServers(java.util.List<Server> newServers)
Initial list of servers. This API also serves to add additional ones at a later time The same logical server (host:port) could essentially be added multiple times (helpful in cases where you want to give more "weightage" perhaps ..)

Parameters:
newServers - new servers to add

chooseServer

Server chooseServer(java.lang.Object key)
Choose a server from load balancer.

Parameters:
key - An object that the load balancer may use to determine which server to return. null if the load balancer does not use this parameter.
Returns:
server chosen

markServerDown

void markServerDown(Server server)
To be called by the clients of the load balancer to notify that a Server is down else, the LB will think its still Alive until the next Ping cycle - potentially (assuming that the LB Impl does a ping)

Parameters:
server - Server to mark as down