org.scale7.cassandra.pelops.pool
Class DebuggingPool

java.lang.Object
  extended by org.scale7.cassandra.pelops.pool.ThriftPoolBase
      extended by org.scale7.cassandra.pelops.pool.DebuggingPool
All Implemented Interfaces:
IThriftPool

public class DebuggingPool
extends ThriftPoolBase

A basic non-pooled pool impl. A new connection is opened each time the getConnection() or getConnectionExcept(String) is called. This class is useful for diagnostics.


Nested Class Summary
 class DebuggingPool.PooledConnection
           
 
Nested classes/interfaces inherited from interface org.scale7.cassandra.pelops.pool.IThriftPool
IThriftPool.IPooledConnection
 
Constructor Summary
DebuggingPool(Cluster cluster, String keyspace, OperandPolicy generalPolicy)
           
 
Method Summary
 IThriftPool.IPooledConnection getConnection()
          Get a connection from the pool.
 IThriftPool.IPooledConnection getConnectionExcept(String notNode)
          Get a connection from the pool trying to avoid the node specified by the notNode param.
 String getKeyspace()
          The keyspace this connection operates on.
 OperandPolicy getOperandPolicy()
          Get the current policy in force, which controls the general behavior of pelops.
 void shutdown()
          Shuts down the pool.
 
Methods inherited from class org.scale7.cassandra.pelops.pool.ThriftPoolBase
createMutator, createMutator, createMutator, createMutator, createMutator, createRowDeletor, createRowDeletor, createSelector
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DebuggingPool

public DebuggingPool(Cluster cluster,
                     String keyspace,
                     OperandPolicy generalPolicy)
Method Detail

getConnection

public IThriftPool.IPooledConnection getConnection()
                                            throws NoConnectionsAvailableException
Description copied from interface: IThriftPool
Get a connection from the pool.

Returns:
the connection
Throws:
NoConnectionsAvailableException

getConnectionExcept

public IThriftPool.IPooledConnection getConnectionExcept(String notNode)
                                                  throws NoConnectionsAvailableException
Description copied from interface: IThriftPool
Get a connection from the pool trying to avoid the node specified by the notNode param.

Parameters:
notNode - the node to avoid if possible
Returns:
the connection
Throws:
NoConnectionsAvailableException

shutdown

public void shutdown()
Description copied from interface: IThriftPool
Shuts down the pool.

Calling this method after the pool has been shutdown should have no affect.


getOperandPolicy

public OperandPolicy getOperandPolicy()
Description copied from interface: IThriftPool
Get the current policy in force, which controls the general behavior of pelops.

Returns:
the current policy

getKeyspace

public String getKeyspace()
Description copied from interface: IThriftPool
The keyspace this connection operates on.

Returns:
the keyspace


Copyright © 2011. All Rights Reserved.