me.prettyprint.cassandra.service
Class CassandraHostConfigurator

java.lang.Object
  extended by me.prettyprint.cassandra.service.CassandraHostConfigurator
All Implemented Interfaces:
Serializable

public final class CassandraHostConfigurator
extends Object
implements Serializable

See Also:
Serialized Form

Field Summary
static ClockResolution DEF_CLOCK_RESOLUTION
           
 
Constructor Summary
CassandraHostConfigurator()
           
CassandraHostConfigurator(String hosts)
           
 
Method Summary
 void applyConfig(CassandraHost cassandraHost)
           
 CassandraHost[] buildCassandraHosts()
           
 boolean getAutoDiscoverHosts()
           
 List<String> getAutoDiscoveryDataCenters()
          Retrieves the 'local' datacenter names that the DiscoveryService recognizes as valid in order to discover new hosts.
 int getAutoDiscoveryDelayInSeconds()
           
 ClockResolution getClockResolution()
           
 int getHostTimeoutCounter()
           
 int getHostTimeoutSuspensionDurationInSeconds()
           
 int getHostTimeoutUnsuspendCheckDelay()
           
 int getHostTimeoutWindow()
           
 boolean getLifo()
           
 LoadBalancingPolicy getLoadBalancingPolicy()
           
 HOpTimer getOpTimer()
           
 int getPort()
           
 boolean getRetryDownedHosts()
           
 int getRetryDownedHostsDelayInSeconds()
           
 int getRetryDownedHostsQueueSize()
           
 boolean getRunAutoDiscoveryAtStartup()
           
 boolean getUseHostTimeoutTracker()
           
 boolean getUseSocketKeepalive()
           
 boolean isUseKerberosAuthentication()
          Retrieves whether Kerberos authentication is enabled or not.
 void setAutoDiscoverHosts(boolean autoDiscoverHosts)
           
 void setAutoDiscoveryDataCenter(List<String> dataCenters)
          Sets the datacenters for the DiscoveryService.
 void setAutoDiscoveryDataCenter(String dataCenter)
          Sets the local datacenter for the DiscoveryService.
 void setAutoDiscoveryDelayInSeconds(int autoDiscoveryDelayInSeconds)
           
 void setCassandraThriftSocketTimeout(int cassandraThriftSocketTimeout)
          The value (in milliseconds) which gets passed down to Socket.setSoTimeout(int) used by the underlying Thrift transport.
 void setClockResolution(ClockResolution clockResolution)
           
 void setClockResolution(String resolutionString)
           
 void setHosts(String hosts)
           
 void setHostTimeoutCounter(int hostTimeoutCounter)
           
 void setHostTimeoutSuspensionDurationInSeconds(int hostTimeoutSuspensionDurationInSeconds)
           
 void setHostTimeoutUnsuspendCheckDelay(int hostTimeoutUnsuspendCheckDelay)
           
 void setHostTimeoutWindow(int hostTimeoutWindow)
           
 void setLifo(boolean lifo)
           
 void setLoadBalancingPolicy(LoadBalancingPolicy loadBalancingPolicy)
           
 void setMaxActive(int maxActive)
           
 void setMaxWaitTimeWhenExhausted(long maxWaitTimeWhenExhausted)
           
 void setOpTimer(HOpTimer opTimer)
           
 void setPort(int port)
           
 void setRetryDownedHosts(boolean retryDownedHosts)
           
 void setRetryDownedHostsDelayInSeconds(int retryDownedHostsDelayInSeconds)
           
 void setRetryDownedHostsQueueSize(int retryDownedHostsQueueSize)
           
 void setRunAutoDiscoveryAtStartup(boolean runAutoDiscoveryAtStartup)
          Set to true to run NodeAutoDiscoverService at startup.
 void setUseHostTimeoutTracker(boolean useHostTimeoutTracker)
           
 void setUseKerberosAuthentication(boolean useKerberosAuthentication)
          Set Kerberos Authentication.
 void setUseSocketKeepalive(boolean useSocketKeepalive)
          Enable SO_KEEPALIVE on the underlying socket.
 void setUseThriftFramedTransport(boolean useThriftFramedTransport)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEF_CLOCK_RESOLUTION

public static final ClockResolution DEF_CLOCK_RESOLUTION
Constructor Detail

CassandraHostConfigurator

public CassandraHostConfigurator()

CassandraHostConfigurator

public CassandraHostConfigurator(String hosts)
Method Detail

buildCassandraHosts

public CassandraHost[] buildCassandraHosts()

applyConfig

public void applyConfig(CassandraHost cassandraHost)

setHosts

public void setHosts(String hosts)

setMaxActive

public void setMaxActive(int maxActive)

setMaxWaitTimeWhenExhausted

public void setMaxWaitTimeWhenExhausted(long maxWaitTimeWhenExhausted)

setCassandraThriftSocketTimeout

public void setCassandraThriftSocketTimeout(int cassandraThriftSocketTimeout)
The value (in milliseconds) which gets passed down to Socket.setSoTimeout(int) used by the underlying Thrift transport.


getRetryDownedHosts

public boolean getRetryDownedHosts()

setRetryDownedHosts

public void setRetryDownedHosts(boolean retryDownedHosts)

setRetryDownedHostsQueueSize

public void setRetryDownedHostsQueueSize(int retryDownedHostsQueueSize)

getRetryDownedHostsQueueSize

public int getRetryDownedHostsQueueSize()

setRetryDownedHostsDelayInSeconds

public void setRetryDownedHostsDelayInSeconds(int retryDownedHostsDelayInSeconds)

getRetryDownedHostsDelayInSeconds

public int getRetryDownedHostsDelayInSeconds()

setClockResolution

public void setClockResolution(String resolutionString)
Parameters:
resolutionString - one of "SECONDS", "MILLISECONDS", "MICROSECONDS" or "MICROSECONDS_SYNC"

getOpTimer

public HOpTimer getOpTimer()

setOpTimer

public void setOpTimer(HOpTimer opTimer)

toString

public String toString()
Overrides:
toString in class Object

getLifo

public boolean getLifo()

setLifo

public void setLifo(boolean lifo)

getPort

public int getPort()

setPort

public void setPort(int port)

setUseThriftFramedTransport

public void setUseThriftFramedTransport(boolean useThriftFramedTransport)

getClockResolution

public ClockResolution getClockResolution()

setClockResolution

public void setClockResolution(ClockResolution clockResolution)

getAutoDiscoverHosts

public boolean getAutoDiscoverHosts()

setAutoDiscoverHosts

public void setAutoDiscoverHosts(boolean autoDiscoverHosts)

getAutoDiscoveryDelayInSeconds

public int getAutoDiscoveryDelayInSeconds()

setAutoDiscoveryDelayInSeconds

public void setAutoDiscoveryDelayInSeconds(int autoDiscoveryDelayInSeconds)

setAutoDiscoveryDataCenter

public void setAutoDiscoveryDataCenter(String dataCenter)
Sets the local datacenter for the DiscoveryService. Nodes out of this datacenter will be discarded.

Parameters:
dataCenter - DataCenter name

setAutoDiscoveryDataCenter

public void setAutoDiscoveryDataCenter(List<String> dataCenters)
Sets the datacenters for the DiscoveryService. Nodes out of these datacenters will be discarded.


getAutoDiscoveryDataCenters

public List<String> getAutoDiscoveryDataCenters()
Retrieves the 'local' datacenter names that the DiscoveryService recognizes as valid in order to discover new hosts.

Returns:
a list of 'local' datacenter names

getLoadBalancingPolicy

public LoadBalancingPolicy getLoadBalancingPolicy()

setLoadBalancingPolicy

public void setLoadBalancingPolicy(LoadBalancingPolicy loadBalancingPolicy)

getHostTimeoutCounter

public int getHostTimeoutCounter()

setHostTimeoutCounter

public void setHostTimeoutCounter(int hostTimeoutCounter)

getHostTimeoutWindow

public int getHostTimeoutWindow()

setHostTimeoutWindow

public void setHostTimeoutWindow(int hostTimeoutWindow)

getHostTimeoutSuspensionDurationInSeconds

public int getHostTimeoutSuspensionDurationInSeconds()

setHostTimeoutSuspensionDurationInSeconds

public void setHostTimeoutSuspensionDurationInSeconds(int hostTimeoutSuspensionDurationInSeconds)

getHostTimeoutUnsuspendCheckDelay

public int getHostTimeoutUnsuspendCheckDelay()

setHostTimeoutUnsuspendCheckDelay

public void setHostTimeoutUnsuspendCheckDelay(int hostTimeoutUnsuspendCheckDelay)

getUseHostTimeoutTracker

public boolean getUseHostTimeoutTracker()

setUseHostTimeoutTracker

public void setUseHostTimeoutTracker(boolean useHostTimeoutTracker)

getRunAutoDiscoveryAtStartup

public boolean getRunAutoDiscoveryAtStartup()

setRunAutoDiscoveryAtStartup

public void setRunAutoDiscoveryAtStartup(boolean runAutoDiscoveryAtStartup)
Set to true to run NodeAutoDiscoverService at startup. You must also call setAutoDiscoverHosts(boolean) to true for this to have an effect.

Parameters:
runAutoDiscoveryAtStartup -

getUseSocketKeepalive

public boolean getUseSocketKeepalive()

setUseSocketKeepalive

public void setUseSocketKeepalive(boolean useSocketKeepalive)
Enable SO_KEEPALIVE on the underlying socket. OFF by default (per java.net.Socket)


isUseKerberosAuthentication

public boolean isUseKerberosAuthentication()
Retrieves whether Kerberos authentication is enabled or not.

Returns:
TRUE if Kerberos in enabled. FALSE otherwise.

setUseKerberosAuthentication

public void setUseKerberosAuthentication(boolean useKerberosAuthentication)
Set Kerberos Authentication.

Parameters:
useKerberosAuthentication -


Copyright © 2012. All Rights Reserved.