com.netflix.loadbalancer
Class RandomRule

java.lang.Object
  extended by com.netflix.loadbalancer.AbstractLoadBalancerRule
      extended by com.netflix.loadbalancer.RandomRule
All Implemented Interfaces:
com.netflix.client.IClientConfigAware, IRule

public class RandomRule
extends AbstractLoadBalancerRule

A loadbalacing strategy that randomly distributes traffic amongst existing servers.


Constructor Summary
RandomRule()
           
 
Method Summary
 Server choose(ILoadBalancer lb, java.lang.Object key)
          Randomly choose from all living servers
 Server choose(java.lang.Object key)
           
 void initWithNiwsConfig(com.netflix.client.config.IClientConfig clientConfig)
           
 
Methods inherited from class com.netflix.loadbalancer.AbstractLoadBalancerRule
getLoadBalancer, setLoadBalancer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomRule

public RandomRule()
Method Detail

choose

public Server choose(ILoadBalancer lb,
                     java.lang.Object key)
Randomly choose from all living servers


choose

public Server choose(java.lang.Object key)

initWithNiwsConfig

public void initWithNiwsConfig(com.netflix.client.config.IClientConfig clientConfig)