org.scale7.cassandra.pelops.pool
Interface CommonsBackedPool.INodeSuspensionStrategy

All Known Implementing Classes:
NoOpNodeSuspensionStrategy
Enclosing class:
CommonsBackedPool

public static interface CommonsBackedPool.INodeSuspensionStrategy

Interface used to define how nodes should be suspended for behaving badly. For example, if a node is reporting lots of corrupt connections then maybe it should be avoided for a while.

Implementations should indicate if a node is suspended by ensuring that CommonsBackedPool.INodeSuspensionState.isSuspended() returns true until the node should no longer be considered suspended.

Any state required to determine if a node should be suspended should be stored in the nodes PooledNode.getSuspensionState(). Note that the suspension state may be null if the node has not been evaluated before.

Also note that the evaluate(CommonsBackedPool, PooledNode) will be called by the scheduled tasks thread even when the node is currently suspended.


Method Summary
 boolean evaluate(CommonsBackedPool pool, org.scale7.cassandra.pelops.pool.PooledNode node)
          Called for each node in the pool by the pools background thread.
 

Method Detail

evaluate

boolean evaluate(CommonsBackedPool pool,
                 org.scale7.cassandra.pelops.pool.PooledNode node)
Called for each node in the pool by the pools background thread.

Parameters:
pool - the pool (just in case you need it)
node - the node to evaluate
Returns:
true if the node was suspending, otherwise false


Copyright © 2011. All Rights Reserved.