|
||||||||||
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 CommonsBackedPoolMBean
public void shutdown()
IThriftPool
shutdown
in interface IThriftPool
public IThriftPool.IPooledConnection getConnection() throws NoConnectionsAvailableException
IThriftPool
getConnection
in interface IThriftPool
NoConnectionsAvailableException
public IThriftPool.IPooledConnection getConnectionExcept(String notNodeHint) throws NoConnectionsAvailableException
IThriftPool
getConnectionExcept
in interface IThriftPool
notNodeHint
- the node to avoid if possible
NoConnectionsAvailableException
public 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 IThriftPool
public String getKeyspace()
IThriftPool
getKeyspace
in interface IThriftPool
public 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 CommonsBackedPoolMBean
public int getConnectionsDestroyed()
getConnectionsDestroyed
in interface CommonsBackedPoolMBean
public int getConnectionsCorrupted()
getConnectionsCorrupted
in interface CommonsBackedPoolMBean
public int getConnectionsActive()
getConnectionsActive
in interface CommonsBackedPoolMBean
public int getNodesActive()
getNodesActive
in interface CommonsBackedPoolMBean
public int getNodesSuspended()
getNodesSuspended
in interface CommonsBackedPoolMBean
public int getConnectionsBorrowedTotal()
getConnectionsBorrowedTotal
in interface CommonsBackedPoolMBean
public int getConnectionsReleasedTotal()
getConnectionsReleasedTotal
in interface CommonsBackedPoolMBean
public int getMaxActivePerNode()
getMaxActivePerNode
in interface CommonsBackedPoolMBean
public void setMaxActivePerNode(int maxActivePerNode)
setMaxActivePerNode
in interface CommonsBackedPoolMBean
public int getMaxIdlePerNode()
getMaxIdlePerNode
in interface CommonsBackedPoolMBean
public void setMaxIdlePerNode(int maxIdlePerNode)
setMaxIdlePerNode
in interface CommonsBackedPoolMBean
public int getMaxTotal()
getMaxTotal
in interface CommonsBackedPoolMBean
public void setMaxTotal(int maxTotal)
setMaxTotal
in interface CommonsBackedPoolMBean
public int getMinIdlePerNode()
getMinIdlePerNode
in interface CommonsBackedPoolMBean
public void setMinIdlePerNode(int minIdlePerNode)
setMinIdlePerNode
in interface CommonsBackedPoolMBean
public int getMaxWaitForConnection()
getMaxWaitForConnection
in interface CommonsBackedPoolMBean
public void setMaxWaitForConnection(int maxWaitForConnection)
setMaxWaitForConnection
in interface CommonsBackedPoolMBean
public boolean isTestConnectionsWhileIdle()
isTestConnectionsWhileIdle
in interface CommonsBackedPoolMBean
public void setTestConnectionsWhileIdle(boolean testConnectionsWhileIdle)
setTestConnectionsWhileIdle
in interface CommonsBackedPoolMBean
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |