me.prettyprint.cassandra.connection
Class LeastActiveBalancingPolicy

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

public class LeastActiveBalancingPolicy
extends Object
implements LoadBalancingPolicy

Selects the least active host based on the number of active connections. The list of hosts is shuffled on each pass to account for the case where a number of hosts are at the minimum number of connections (ie. they are not busy).

Author:
zznate
See Also:
Serialized Form

Constructor Summary
LeastActiveBalancingPolicy()
           
 
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

LeastActiveBalancingPolicy

public LeastActiveBalancingPolicy()
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.