com.netflix.loadbalancer
Class NoOpLoadBalancer

java.lang.Object
  extended by com.netflix.loadbalancer.AbstractLoadBalancer
      extended by com.netflix.loadbalancer.NoOpLoadBalancer
All Implemented Interfaces:
ILoadBalancer

public class NoOpLoadBalancer
extends AbstractLoadBalancer

A noOp Loadbalancer i.e. doesnt do anything "loadbalancer like"


Nested Class Summary
 
Nested classes/interfaces inherited from class com.netflix.loadbalancer.AbstractLoadBalancer
AbstractLoadBalancer.ServerGroup
 
Constructor Summary
NoOpLoadBalancer()
           
 
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.
 LoadBalancerStats getLoadBalancerStats()
          Obtain LoadBalancer related Statistics
 java.util.List<Server> getServerList(AbstractLoadBalancer.ServerGroup serverGroup)
          List of servers that this Loadbalancer knows about
 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)
 
Methods inherited from class com.netflix.loadbalancer.AbstractLoadBalancer
chooseServer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NoOpLoadBalancer

public NoOpLoadBalancer()
Method Detail

addServers

public void addServers(java.util.List<Server> newServers)
Description copied from interface: ILoadBalancer
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

public Server chooseServer(java.lang.Object key)
Description copied from interface: ILoadBalancer
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

getLoadBalancerStats

public LoadBalancerStats getLoadBalancerStats()
Description copied from class: AbstractLoadBalancer
Obtain LoadBalancer related Statistics

Specified by:
getLoadBalancerStats in class AbstractLoadBalancer
Returns:

getServerList

public java.util.List<Server> getServerList(AbstractLoadBalancer.ServerGroup serverGroup)
Description copied from class: AbstractLoadBalancer
List of servers that this Loadbalancer knows about

Specified by:
getServerList in class AbstractLoadBalancer
Returns:

markServerDown

public void markServerDown(Server server)
Description copied from interface: ILoadBalancer
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