org.scale7.cassandra.pelops.pool
Class CachePerNodePool

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

Deprecated. Use CommonsBackedPool instead

@Deprecated
public class CachePerNodePool
extends ThriftPoolBase
implements CachePerNodePoolMBean

Provides intelligent pooling of Thrift connections to the Cassandra cluster including balancing the load created by actual client activity. This is achieved by balancing those connections actually engaged in writing requests or reading responses evenly across the cluster's nodes. Later versions may also poll cluster nodes to detect response times in order to further improve connection distribution.

Author:
dominicwilliams

Nested Class Summary
static class CachePerNodePool.Policy
          Deprecated.  
 class CachePerNodePool.PooledConnection
          Deprecated. Encapsulates a connection to a Cassandra node.
 
Nested classes/interfaces inherited from interface org.scale7.cassandra.pelops.pool.IThriftPool
IThriftPool.IPooledConnection
 
Field Summary
 
Fields inherited from interface org.scale7.cassandra.pelops.pool.CachePerNodePoolMBean
JMX_MBEAN_OBJ_NAME
 
Constructor Summary
CachePerNodePool(Cluster cluster, String keyspace, OperandPolicy generalPolicy, CachePerNodePool.Policy poolPolicy)
          Deprecated. Constructs a pool instance.
 
Method Summary
 long getCacheConnNotSelectedCount()
          Deprecated.  
 long getCacheConnSelectedCount()
          Deprecated.  
 long getConnAddToCacheCount()
          Deprecated.  
 long getConnCannotOpenCount()
          Deprecated.  
 long getConnClosedCount()
          Deprecated.  
 long getConnCreatedCount()
          Deprecated.  
 long getConnCreateExceptionCount()
          Deprecated.  
 IThriftPool.IPooledConnection getConnection()
          Deprecated. Get a Cassandra connection to the least loaded node represented in the connection pool.
 IThriftPool.IPooledConnection getConnectionExcept(String notNode)
          Deprecated. Get a Cassandra connection to the least loaded node represented in the connection pool.
 long getConnOpenedCount()
          Deprecated.  
 long getConnReleaseCalledCount()
          Deprecated.  
 long getConnReturnedToCacheCount()
          Deprecated.  
 long getConnSelectedAlreadyOpenCount()
          Deprecated.  
 long getConnSelectedNotAlreadyOpenCount()
          Deprecated.  
 long getDeadConnCount()
          Deprecated.  
 long getGetConnBackoffCount()
          Deprecated.  
 long getGetConnCount()
          Deprecated.  
 String getKeyspace()
          Deprecated. The keyspace this connection operates on.
 long getLeastLoadedNotSelectedCount()
          Deprecated.  
 long getLeastLoadedSelectedCount()
          Deprecated.  
 long getNetworkExceptionCount()
          Deprecated.  
 OperandPolicy getOperandPolicy()
          Deprecated. Get the current policy in force, which controls the general behavior of pelops.
 CachePerNodePool.Policy getPoolPolicy()
          Deprecated. Get the current policy in force, which controls the behavioral parameters of the connection pool.
 long getPurgeAllSessionConnsCount()
          Deprecated.  
 long getRefillBackoffCount()
          Deprecated.  
 long getRefillNeedConnCount()
          Deprecated.  
 void shutdown()
          Deprecated. Cleanly shutdown this pool and associated Thrift connections and operations.
 
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

CachePerNodePool

public CachePerNodePool(Cluster cluster,
                        String keyspace,
                        OperandPolicy generalPolicy,
                        CachePerNodePool.Policy poolPolicy)
Deprecated. 
Constructs a pool instance. Note: unless you are performing management options the keyspace should be provided.

Parameters:
cluster - the cluster info to connect to
keyspace - the keyspace to use (note: as of 0.7.0 this is basically a required parameter)
generalPolicy - the general pelops policy
poolPolicy - the pool policy
Method Detail

getConnection

public IThriftPool.IPooledConnection getConnection()
                                            throws NoConnectionsAvailableException
Deprecated. 
Get a Cassandra connection to the least loaded node represented in the connection pool.

Specified by:
getConnection in interface IThriftPool
Returns:
A connection to Cassandra
Throws:
NoConnectionsAvailableException

getConnectionExcept

public IThriftPool.IPooledConnection getConnectionExcept(String notNode)
                                                  throws NoConnectionsAvailableException
Deprecated. 
Get a Cassandra connection to the least loaded node represented in the connection pool. If specified, a specified node is avoided if any other nodes are available. This is useful if a node has just failed for a particular operation and it wishes to try another.

Specified by:
getConnectionExcept in interface IThriftPool
Parameters:
notNode - A node to try and avoid, for example because using it just failed
Returns:
A connection to a Cassandra
Throws:
Exception
NoConnectionsAvailableException

shutdown

public void shutdown()
Deprecated. 
Cleanly shutdown this pool and associated Thrift connections and operations. TODO wait until all in-use connections are returned to the pool before exiting.

Specified by:
shutdown in interface IThriftPool

getPoolPolicy

public CachePerNodePool.Policy getPoolPolicy()
Deprecated. 
Get the current policy in force, which controls the behavioral parameters of the connection pool.

Returns:
The current policy

getOperandPolicy

public OperandPolicy getOperandPolicy()
Deprecated. 
Get the current policy in force, which controls the general behavior of pelops.

Specified by:
getOperandPolicy in interface IThriftPool
Returns:
the current policy

getKeyspace

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

Specified by:
getKeyspace in interface IThriftPool
Returns:
the keyspace

getGetConnCount

public long getGetConnCount()
Deprecated. 
Specified by:
getGetConnCount in interface CachePerNodePoolMBean

getLeastLoadedSelectedCount

public long getLeastLoadedSelectedCount()
Deprecated. 
Specified by:
getLeastLoadedSelectedCount in interface CachePerNodePoolMBean

getLeastLoadedNotSelectedCount

public long getLeastLoadedNotSelectedCount()
Deprecated. 
Specified by:
getLeastLoadedNotSelectedCount in interface CachePerNodePoolMBean

getCacheConnNotSelectedCount

public long getCacheConnNotSelectedCount()
Deprecated. 
Specified by:
getCacheConnNotSelectedCount in interface CachePerNodePoolMBean

getCacheConnSelectedCount

public long getCacheConnSelectedCount()
Deprecated. 
Specified by:
getCacheConnSelectedCount in interface CachePerNodePoolMBean

getConnSelectedAlreadyOpenCount

public long getConnSelectedAlreadyOpenCount()
Deprecated. 
Specified by:
getConnSelectedAlreadyOpenCount in interface CachePerNodePoolMBean

getConnSelectedNotAlreadyOpenCount

public long getConnSelectedNotAlreadyOpenCount()
Deprecated. 
Specified by:
getConnSelectedNotAlreadyOpenCount in interface CachePerNodePoolMBean

getConnCannotOpenCount

public long getConnCannotOpenCount()
Deprecated. 
Specified by:
getConnCannotOpenCount in interface CachePerNodePoolMBean

getConnClosedCount

public long getConnClosedCount()
Deprecated. 
Specified by:
getConnClosedCount in interface CachePerNodePoolMBean

getConnCreatedCount

public long getConnCreatedCount()
Deprecated. 
Specified by:
getConnCreatedCount in interface CachePerNodePoolMBean

getConnReleaseCalledCount

public long getConnReleaseCalledCount()
Deprecated. 
Specified by:
getConnReleaseCalledCount in interface CachePerNodePoolMBean

getConnAddToCacheCount

public long getConnAddToCacheCount()
Deprecated. 
Specified by:
getConnAddToCacheCount in interface CachePerNodePoolMBean

getConnCreateExceptionCount

public long getConnCreateExceptionCount()
Deprecated. 
Specified by:
getConnCreateExceptionCount in interface CachePerNodePoolMBean

getConnOpenedCount

public long getConnOpenedCount()
Deprecated. 
Specified by:
getConnOpenedCount in interface CachePerNodePoolMBean

getConnReturnedToCacheCount

public long getConnReturnedToCacheCount()
Deprecated. 
Specified by:
getConnReturnedToCacheCount in interface CachePerNodePoolMBean

getDeadConnCount

public long getDeadConnCount()
Deprecated. 
Specified by:
getDeadConnCount in interface CachePerNodePoolMBean

getNetworkExceptionCount

public long getNetworkExceptionCount()
Deprecated. 
Specified by:
getNetworkExceptionCount in interface CachePerNodePoolMBean

getPurgeAllSessionConnsCount

public long getPurgeAllSessionConnsCount()
Deprecated. 
Specified by:
getPurgeAllSessionConnsCount in interface CachePerNodePoolMBean

getRefillBackoffCount

public long getRefillBackoffCount()
Deprecated. 
Specified by:
getRefillBackoffCount in interface CachePerNodePoolMBean

getRefillNeedConnCount

public long getRefillNeedConnCount()
Deprecated. 
Specified by:
getRefillNeedConnCount in interface CachePerNodePoolMBean

getGetConnBackoffCount

public long getGetConnBackoffCount()
Deprecated. 
Specified by:
getGetConnBackoffCount in interface CachePerNodePoolMBean


Copyright © 2011. All Rights Reserved.