org.scale7.cassandra.pelops.pool
Class CachePerNodePool.Policy

java.lang.Object
  extended by org.scale7.cassandra.pelops.pool.CachePerNodePool.Policy
Enclosing class:
CachePerNodePool

public static class CachePerNodePool.Policy
extends Object


Constructor Summary
CachePerNodePool.Policy()
           
 
Method Summary
 Integer getConnectionTimeout()
          The timeout value passed to the org.apache.thrift.transport.TSocket constructor.
 int getDefaultTargetRefillCheckPause()
           
 boolean getDynamicNodeDiscovery()
           
 int getMaxConnectionsPerNode()
           
 int getMaxGetConnectionRetryDelay()
           
 int getMaxGetConnectionRetryWait()
           
 int getMinCachedConnectionsPerNode()
           
 int getMinGetConnectionRetryDelay()
           
 int getTargetConnectionsPerNode()
           
 boolean isKillNodeConnsOnException()
           
 void setConnectionTimeout(Integer connectionTimeout)
          The timeout value passed to the org.apache.thrift.transport.TSocket constructor.
 void setDynamicNodeDiscovery(boolean dynamicNodeDiscovery)
          If dynamic node discovery is switched on, Pelops will periodically attempt to discover the current set of nodes comprising the complete cluster.
 void setKillNodeConnsOnException(boolean killNodeConnsOnException)
          On some networks, for some unknown reason, the Thrift TSocket is not able to detect when it has been disconnected.
 void setMaxConnectionsPerNode(int maxConnectionsPerNode)
          Set the maximum number of connections per node we will allow to exist.
 void setMinCachedConnectionsPerNode(int minCachedConnectionsPerNode)
          Set the minimum cached connections per node.
 void setTargetConnectionsPerNode(int targetConnectionsPerNode)
          Set the total number of connections per node we would like to hold in hand.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachePerNodePool.Policy

public CachePerNodePool.Policy()
Method Detail

getDynamicNodeDiscovery

public boolean getDynamicNodeDiscovery()

setDynamicNodeDiscovery

public void setDynamicNodeDiscovery(boolean dynamicNodeDiscovery)
If dynamic node discovery is switched on, Pelops will periodically attempt to discover the current set of nodes comprising the complete cluster. This means that if new nodes have been bootstrapped, it automatically starts directing operations to them even though initially they were not specified in the list of contact nodes. If you use this option, you must make sure that your cluster nodes are listening on addresses that you can reach e.g. as configured via listen_address in their cassandra.yaml configuration (this option controls what node addresses are reported to Pelops).

Parameters:
dynamicNodeDiscovery - The value for dynamic node discovery feature

setMinCachedConnectionsPerNode

public void setMinCachedConnectionsPerNode(int minCachedConnectionsPerNode)
Set the minimum cached connections per node. These are held ready so that operations that require them are not delayed while a connection is made.


getMinCachedConnectionsPerNode

public int getMinCachedConnectionsPerNode()

setTargetConnectionsPerNode

public void setTargetConnectionsPerNode(int targetConnectionsPerNode)
Set the total number of connections per node we would like to hold in hand. This includes both in-use connections and cached connections.


getTargetConnectionsPerNode

public int getTargetConnectionsPerNode()

setMaxConnectionsPerNode

public void setMaxConnectionsPerNode(int maxConnectionsPerNode)
Set the maximum number of connections per node we will allow to exist. This includes both in-use connections and cached connections. Pass -1 to allow unlimited connections.


getMaxConnectionsPerNode

public int getMaxConnectionsPerNode()

getMinGetConnectionRetryDelay

public int getMinGetConnectionRetryDelay()

getMaxGetConnectionRetryDelay

public int getMaxGetConnectionRetryDelay()

getMaxGetConnectionRetryWait

public int getMaxGetConnectionRetryWait()

getDefaultTargetRefillCheckPause

public int getDefaultTargetRefillCheckPause()

isKillNodeConnsOnException

public boolean isKillNodeConnsOnException()

setKillNodeConnsOnException

public void setKillNodeConnsOnException(boolean killNodeConnsOnException)
On some networks, for some unknown reason, the Thrift TSocket is not able to detect when it has been disconnected. The Cassandra node can be shutdown, and the TSocket still thinks it is connected! The only way around this it seems is to remove all connections to the node when the problem occurs. TODO find out what is going on with Thrift


getConnectionTimeout

public Integer getConnectionTimeout()
The timeout value passed to the org.apache.thrift.transport.TSocket constructor.

Returns:
the timeout value

setConnectionTimeout

public void setConnectionTimeout(Integer connectionTimeout)
The timeout value passed to the org.apache.thrift.transport.TSocket constructor.

If null (default) the default Thrift value will be used.

Parameters:
connectionTimeout - the timeout value


Copyright © 2011. All Rights Reserved.