org.scale7.cassandra.pelops.pool
Class LeastLoadedNodeSelectionStrategy

java.lang.Object
  extended by org.scale7.cassandra.pelops.pool.LeastLoadedNodeSelectionStrategy
All Implemented Interfaces:
CommonsBackedPool.INodeSelectionStrategy

public class LeastLoadedNodeSelectionStrategy
extends Object
implements CommonsBackedPool.INodeSelectionStrategy

Selects a node based on the number of connections a node currently has in use. The node that has the least active connections will be chosen.


Nested Class Summary
 class LeastLoadedNodeSelectionStrategy.Candidate
           
 
Constructor Summary
LeastLoadedNodeSelectionStrategy()
           
 
Method Summary
 org.scale7.cassandra.pelops.pool.PooledNode select(CommonsBackedPool pool, Set<String> nodeAddresses, String notNodeHint)
          Called when a node need to be selected.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LeastLoadedNodeSelectionStrategy

public LeastLoadedNodeSelectionStrategy()
Method Detail

select

public org.scale7.cassandra.pelops.pool.PooledNode select(CommonsBackedPool pool,
                                                          Set<String> nodeAddresses,
                                                          String notNodeHint)
Description copied from interface: CommonsBackedPool.INodeSelectionStrategy
Called when a node need to be selected.

Specified by:
select in interface CommonsBackedPool.INodeSelectionStrategy
Parameters:
pool - the pool (just in case you need it)
nodeAddresses - the node addresses to select from
notNodeHint - a hint of the node address that the selection strategy should avoid (possible null)
Returns:
the selected node (null if none are available)


Copyright © 2011. All Rights Reserved.