me.prettyprint.cassandra.connection
Class RoundRobinBalancingPolicy

java.lang.Object
  extended by me.prettyprint.cassandra.connection.RoundRobinBalancingPolicy
All Implemented Interfaces:
Serializable, LoadBalancingPolicy

public class RoundRobinBalancingPolicy
extends Object
implements LoadBalancingPolicy

Implements a RoundRobin balancing policy based off the contents of the active HClientPool. If a pool is shutdown by another thread in the midst of the selection process, we return the pool at position 0

Author:
zznate
See Also:
Serialized Form

Constructor Summary
RoundRobinBalancingPolicy()
           
 
Method Summary
 HClientPool createConnection(CassandraHost host)
           
 HClientPool getPool(Collection<HClientPool> pools, Set<CassandraHost> excludeHosts)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RoundRobinBalancingPolicy

public RoundRobinBalancingPolicy()
Method Detail

getPool

public HClientPool getPool(Collection<HClientPool> pools,
                           Set<CassandraHost> excludeHosts)
Specified by:
getPool in interface LoadBalancingPolicy

createConnection

public HClientPool createConnection(CassandraHost host)
Specified by:
createConnection in interface LoadBalancingPolicy


Copyright © 2011. All Rights Reserved.