|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.scale7.cassandra.pelops.pool.ThriftPoolBase
org.scale7.cassandra.pelops.pool.CommonsBackedPool
public class CommonsBackedPool
| Nested Class Summary | |
|---|---|
static interface |
CommonsBackedPool.IConnectionValidator
Interface used to define how a connection is validated while idle. |
static interface |
CommonsBackedPool.INodeSelectionStrategy
Interface used to define how nodes should be selected. |
static interface |
CommonsBackedPool.INodeSuspensionState
Interface used to define a pooled nodes suspension status. |
static interface |
CommonsBackedPool.INodeSuspensionStrategy
Interface used to define how nodes should be suspended for behaving badly. |
static class |
CommonsBackedPool.Policy
|
class |
CommonsBackedPool.PooledConnection
|
static class |
CommonsBackedPool.RunningStatistics
|
| 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.CommonsBackedPoolMBean |
|---|
JMX_MBEAN_OBJ_NAME |
| Constructor Summary | |
|---|---|
CommonsBackedPool(Cluster cluster,
String keyspace)
Create a new instance with reasonable defaults. |
|
CommonsBackedPool(Cluster cluster,
String keyspace,
CommonsBackedPool.Policy policy,
OperandPolicy operandPolicy)
Create a new instance with reasonable defaults. |
|
CommonsBackedPool(Cluster cluster,
String keyspace,
CommonsBackedPool.Policy policy,
OperandPolicy operandPolicy,
CommonsBackedPool.INodeSelectionStrategy nodeSelectionStrategy,
CommonsBackedPool.INodeSuspensionStrategy nodeSuspensionStrategy,
CommonsBackedPool.IConnectionValidator connectionValidator)
Create a new instance of 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 |
|---|
public CommonsBackedPool(Cluster cluster,
String keyspace)
cluster - the cluster this pool is pooling connections tokeyspace - the keyspace this pool is forCommonsBackedPool(org.scale7.cassandra.pelops.Cluster, String, org.scale7.cassandra.pelops.pool.CommonsBackedPool.Policy,org.scale7.cassandra.pelops.OperandPolicy, org.scale7.cassandra.pelops.pool.CommonsBackedPool.INodeSelectionStrategy, org.scale7.cassandra.pelops.pool.CommonsBackedPool.INodeSuspensionStrategy, org.scale7.cassandra.pelops.pool.CommonsBackedPool.IConnectionValidator)
public CommonsBackedPool(Cluster cluster,
String keyspace,
CommonsBackedPool.Policy policy,
OperandPolicy operandPolicy)
cluster - the cluster this pool is pooling connections tokeyspace - the keyspace this pool is forpolicy - the pool configoperandPolicy - the operand configCommonsBackedPool(org.scale7.cassandra.pelops.Cluster, String, org.scale7.cassandra.pelops.pool.CommonsBackedPool.Policy,org.scale7.cassandra.pelops.OperandPolicy, org.scale7.cassandra.pelops.pool.CommonsBackedPool.INodeSelectionStrategy, org.scale7.cassandra.pelops.pool.CommonsBackedPool.INodeSuspensionStrategy, org.scale7.cassandra.pelops.pool.CommonsBackedPool.IConnectionValidator)
public CommonsBackedPool(Cluster cluster,
String keyspace,
CommonsBackedPool.Policy policy,
OperandPolicy operandPolicy,
CommonsBackedPool.INodeSelectionStrategy nodeSelectionStrategy,
CommonsBackedPool.INodeSuspensionStrategy nodeSuspensionStrategy,
CommonsBackedPool.IConnectionValidator connectionValidator)
cluster - the cluster this pool is pooling connections tokeyspace - the keyspace this pool is forpolicy - the pool configoperandPolicy - the operand confignodeSelectionStrategy - the node selection strategy (if null then LeastLoadedNodeSelectionStrategy is used)nodeSuspensionStrategy - the node suspend strategy (if null then NoOpNodeSuspensionStrategy is used)connectionValidator - validator used to validate idle connections (if null then DescribeVersionConnectionValidator is used)| Method Detail |
|---|
public void runMaintenanceTasks()
runMaintenanceTasks in interface CommonsBackedPoolMBeanpublic void shutdown()
IThriftPool
shutdown in interface IThriftPool
public IThriftPool.IPooledConnection getConnection()
throws NoConnectionsAvailableException
IThriftPool
getConnection in interface IThriftPoolNoConnectionsAvailableException
public IThriftPool.IPooledConnection getConnectionExcept(String notNodeHint)
throws NoConnectionsAvailableException
IThriftPool
getConnectionExcept in interface IThriftPoolnotNodeHint - the node to avoid if possible
NoConnectionsAvailableExceptionpublic org.scale7.cassandra.pelops.pool.PooledNode getPooledNode(String nodeAddress)
nodeAddress - the node address
protected void configureBackingPool()
protected void releaseConnection(CommonsBackedPool.PooledConnection connection)
protected void reportConnectionCreated(String nodeAddress)
protected void reportConnectionDestroyed(String nodeAddress)
protected void reportConnectionCorrupted(String nodeAddress)
protected void reportConnectionBorrowed(String nodeAddress)
protected void reportConnectionReleased(String nodeAddress)
public OperandPolicy getOperandPolicy()
IThriftPool
getOperandPolicy in interface IThriftPoolpublic String getKeyspace()
IThriftPool
getKeyspace in interface IThriftPoolpublic CommonsBackedPool.Policy getPolicy()
public Cluster getCluster()
public CommonsBackedPool.INodeSelectionStrategy getNodeSelectionStrategy()
public CommonsBackedPool.INodeSuspensionStrategy getNodeSuspensionStrategy()
public CommonsBackedPool.IConnectionValidator getConnectionValidator()
public CommonsBackedPool.RunningStatistics getStatistics()
public int getConnectionsCreated()
getConnectionsCreated in interface CommonsBackedPoolMBeanpublic int getConnectionsDestroyed()
getConnectionsDestroyed in interface CommonsBackedPoolMBeanpublic int getConnectionsCorrupted()
getConnectionsCorrupted in interface CommonsBackedPoolMBeanpublic int getConnectionsActive()
getConnectionsActive in interface CommonsBackedPoolMBeanpublic int getNodesActive()
getNodesActive in interface CommonsBackedPoolMBeanpublic int getNodesSuspended()
getNodesSuspended in interface CommonsBackedPoolMBeanpublic int getConnectionsBorrowedTotal()
getConnectionsBorrowedTotal in interface CommonsBackedPoolMBeanpublic int getConnectionsReleasedTotal()
getConnectionsReleasedTotal in interface CommonsBackedPoolMBeanpublic int getMaxActivePerNode()
getMaxActivePerNode in interface CommonsBackedPoolMBeanpublic void setMaxActivePerNode(int maxActivePerNode)
setMaxActivePerNode in interface CommonsBackedPoolMBeanpublic int getMaxIdlePerNode()
getMaxIdlePerNode in interface CommonsBackedPoolMBeanpublic void setMaxIdlePerNode(int maxIdlePerNode)
setMaxIdlePerNode in interface CommonsBackedPoolMBeanpublic int getMaxTotal()
getMaxTotal in interface CommonsBackedPoolMBeanpublic void setMaxTotal(int maxTotal)
setMaxTotal in interface CommonsBackedPoolMBeanpublic int getMinIdlePerNode()
getMinIdlePerNode in interface CommonsBackedPoolMBeanpublic void setMinIdlePerNode(int minIdlePerNode)
setMinIdlePerNode in interface CommonsBackedPoolMBeanpublic int getMaxWaitForConnection()
getMaxWaitForConnection in interface CommonsBackedPoolMBeanpublic void setMaxWaitForConnection(int maxWaitForConnection)
setMaxWaitForConnection in interface CommonsBackedPoolMBeanpublic boolean isTestConnectionsWhileIdle()
isTestConnectionsWhileIdle in interface CommonsBackedPoolMBeanpublic void setTestConnectionsWhileIdle(boolean testConnectionsWhileIdle)
setTestConnectionsWhileIdle in interface CommonsBackedPoolMBean
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||