voldemort.client
Class ClientConfig

java.lang.Object
  extended by voldemort.client.ClientConfig

public class ClientConfig
extends java.lang.Object

A configuration object that holds configuration parameters for the client.


Field Summary
static java.lang.String ALLOW_PARTIAL_GETALLS_PROPERTY
           
static java.lang.String ASYNC_CHECK_METADATA_INTERVAL
           
static java.lang.String ASYNC_JOB_THREAD_POOL_SIZE
           
static java.lang.String BOOTSTRAP_URLS_PROPERTY
           
static java.lang.String CLIENT_CONTEXT_NAME
           
static java.lang.String CLIENT_REGISTRY_REFRESH_INTERVAL
           
static java.lang.String CLIENT_ZONE_ID
           
static java.lang.String CONNECTION_TIMEOUT_MS_PROPERTY
           
static java.lang.String DELETE_ROUTING_TIMEOUT_MS_PROPERTY
           
static java.lang.String ENABLE_COMPRESSION_LAYER
           
static java.lang.String ENABLE_HINTED_HANDOFF_PROPERTY
           
static java.lang.String ENABLE_INCONSISTENCY_RESOLVING_LAYER
           
static java.lang.String ENABLE_JMX_PROPERTY
           
static java.lang.String ENABLE_LAZY_PROPERTY
           
static java.lang.String ENABLE_SERIALIZATION_LAYER
           
static java.lang.String FAILUREDETECTOR_ASYNCRECOVERY_INTERVAL_PROPERTY
           
static java.lang.String FAILUREDETECTOR_BANNAGE_PERIOD_PROPERTY
           
static java.lang.String FAILUREDETECTOR_CATASTROPHIC_ERROR_TYPES_PROPERTY
           
static java.lang.String FAILUREDETECTOR_IMPLEMENTATION_PROPERTY
           
static java.lang.String FAILUREDETECTOR_REQUEST_LENGTH_THRESHOLD_PROPERTY
           
static java.lang.String FAILUREDETECTOR_THRESHOLD_COUNTMINIMUM_PROPERTY
           
static java.lang.String FAILUREDETECTOR_THRESHOLD_INTERVAL_PROPERTY
           
static java.lang.String FAILUREDETECTOR_THRESHOLD_PROPERTY
           
static java.lang.String FAT_CLIENT_WRAPPER_CORE_POOL_SIZE_PROPERTY
           
static java.lang.String FAT_CLIENT_WRAPPER_MAX_POOL_SIZE_PROPERTY
           
static java.lang.String FAT_CLIENT_WRAPPER_POOL_KEEPALIVE_IN_SECS
           
static java.lang.String GET_OP_ZONE_AFFINITY
           
static java.lang.String GET_ROUTING_TIMEOUT_MS_PROPERTY
           
static java.lang.String GET_VERSIONS_ROUTING_TIMEOUT_MS_PROPERTY
           
static java.lang.String GETALL_OP_ZONE_AFFINITY
           
static java.lang.String GETALL_ROUTING_TIMEOUT_MS_PROPERTY
           
static java.lang.String GETVERSIONS_OP_ZONE_AFFINITY
           
static java.lang.String MAX_BOOTSTRAP_RETRIES
           
static java.lang.String MAX_CONNECTIONS_PER_NODE_PROPERTY
           
static java.lang.String MAX_QUEUED_REQUESTS_PROPERTY
           
static java.lang.String MAX_THREADS_PROPERTY
           
static java.lang.String MAX_TOTAL_CONNECTIONS_PROPERTY
           
static java.lang.String NODE_BANNAGE_MS_PROPERTY
           
static java.lang.String PUT_ROUTING_TIMEOUT_MS_PROPERTY
           
static java.lang.String REQUEST_FORMAT_PROPERTY
           
static java.lang.String ROUTING_TIMEOUT_MS_PROPERTY
           
static java.lang.String SELECTORS_PROPERTY
           
static java.lang.String SERIALIZER_FACTORY_CLASS_PROPERTY
           
static java.lang.String SOCKET_BUFFER_SIZE_PROPERTY
           
static java.lang.String SOCKET_KEEPALIVE_PROPERTY
           
static java.lang.String SOCKET_TIMEOUT_MS_PROPERTY
           
static java.lang.String SYS_CONNECTION_TIMEOUT_MS
           
static java.lang.String SYS_ENABLE_JMX
           
static java.lang.String SYS_MAX_CONNECTIONS_PER_NODE
           
static java.lang.String SYS_ROUTING_TIMEOUT_MS
           
static java.lang.String SYS_SOCKET_TIMEOUT_MS
           
static java.lang.String THREAD_IDLE_MS_PROPERTY
           
static java.lang.String USE_DEFAULT_CLIENT
           
 
Constructor Summary
ClientConfig()
           
ClientConfig(java.io.File propertyFile)
          Instantiate the client config using a properties file
ClientConfig(java.util.Properties properties)
          Initiate the client config from a set of properties.
 
Method Summary
 ClientConfig enableDefaultClient(boolean enableDefault)
          Whether or not a ZenStoreClient is created as opposed to a DefaultStoreClient true = DefaultStoreClient and false = ZenStoreClient
 int getAsyncJobThreadPoolSize()
           
 long getAsyncMetadataRefreshInMs()
           
 java.lang.String[] getBootstrapUrls()
           
 java.lang.String getClientContextName()
           
 int getClientRegistryUpdateIntervalInSecs()
           
 int getClientZoneId()
           
 int getConnectionTimeout(java.util.concurrent.TimeUnit unit)
           
 long getFailureDetectorAsyncRecoveryInterval()
           
 long getFailureDetectorBannagePeriod()
           
 java.util.List<java.lang.String> getFailureDetectorCatastrophicErrorTypes()
           
 java.lang.String getFailureDetectorImplementation()
           
 long getFailureDetectorRequestLengthThreshold()
           
 int getFailureDetectorThreshold()
           
 int getFailureDetectorThresholdCountMinimum()
           
 long getFailureDetectorThresholdInterval()
           
 int getFatClientWrapperCorePoolSize()
           
 int getFatClientWrapperKeepAliveInSecs()
           
 int getFatClientWrapperMaxPoolSize()
           
 int getMaxBootstrapRetries()
           
 int getMaxConnectionsPerNode()
           
 int getMaxQueuedRequests()
           
 int getMaxThreads()
           
 int getMaxTotalConnections()
          Deprecated. 
 int getNodeBannagePeriod(java.util.concurrent.TimeUnit unit)
          Deprecated. Use getFailureDetectorBannagePeriod() instead
 RequestFormatType getRequestFormatType()
           
 RoutingTier getRoutingTier()
           
 int getRoutingTimeout(java.util.concurrent.TimeUnit unit)
           
 int getSelectors()
           
 SerializerFactory getSerializerFactory()
           
 int getSocketBufferSize()
           
 boolean getSocketKeepAlive()
           
 int getSocketTimeout(java.util.concurrent.TimeUnit unit)
           
 int getSysConnectionTimeout()
           
 boolean getSysEnableJmx()
           
 int getSysMaxConnectionsPerNode()
           
 int getSysRoutingTimeout()
           
 int getSysSocketTimeout()
           
 int getThreadIdleTime(java.util.concurrent.TimeUnit unit)
          Deprecated. 
 TimeoutConfig getTimeoutConfig()
          Get the timeouts for voldemort operations
 ZoneAffinity getZoneAffinity()
           
 boolean isDefaultClientEnabled()
           
 boolean isEnableCompressionLayer()
           
 boolean isEnableInconsistencyResolvingLayer()
           
 boolean isEnableSerializationLayer()
           
 boolean isJmxEnabled()
           
 boolean isLazyEnabled()
           
 ClientConfig setAsyncJobThreadPoolSize(int asyncJobThreadPoolSize)
          Set the # of threads for the async.
 ClientConfig setAsyncMetadataRefreshInMs(long asyncCheckMetadataIntervalMs)
          Set the interval on which client checks for metadata change on servers
 ClientConfig setBootstrapUrls(java.util.List<java.lang.String> bootstrapUrls)
          Set the bootstrap urls from which to attempt a connection
 ClientConfig setBootstrapUrls(java.lang.String... bootstrapUrls)
          Set the bootstrap urls from which to attempt a connection
 ClientConfig setClientContextName(java.lang.String clientContextName)
          Set the client context name
 ClientConfig setClientRegistryUpdateIntervalInSecs(int clientRegistryRefrshIntervalInSecs)
          Set the interval on which client refreshes its corresponding entry of the client registry on the servers
 ClientConfig setClientZoneId(int clientZoneId)
          Sets the zone the client belongs to.
 ClientConfig setConnectionTimeout(int connectionTimeout, java.util.concurrent.TimeUnit unit)
          Set the maximum allowable time to block waiting for a free connection
 ClientConfig setEnableCompressionLayer(boolean enableCompressionLayer)
           
 ClientConfig setEnableInconsistencyResolvingLayer(boolean enableInconsistencyResolvingLayer)
           
 ClientConfig setEnableJmx(boolean enableJmx)
          Enable JMX monitoring of the clients?
 ClientConfig setEnableLazy(boolean enableLazy)
          Enable lazy initialization of clients?
 ClientConfig setEnableSerializationLayer(boolean enableSerializationLayer)
           
 ClientConfig setFailureDetectorAsyncRecoveryInterval(long failureDetectorAsyncRecoveryInterval)
          Number of milliseconds, to try to check if a marked down server has come back up again
 ClientConfig setFailureDetectorBannagePeriod(long failureDetectorBannagePeriod)
           
 ClientConfig setFailureDetectorCatastrophicErrorTypes(java.util.List<java.lang.String> failureDetectorCatastrophicErrorTypes)
          Sets the exception types that should be treated as catastrophic,by the failure detector, resulting in the server being immediately considered down.
 ClientConfig setFailureDetectorImplementation(java.lang.String failureDetectorImplementation)
          FailureDetector to use.
 ClientConfig setFailureDetectorRequestLengthThreshold(long failureDetectorRequestLengthThreshold)
          Sets the maximum amount of time a request is allowed to take, to be not considered as a "slow" request and count against the server, in terms of failure detection
 ClientConfig setFailureDetectorThreshold(int failureDetectorThreshold)
          Set the percentage of exceptions that tolerated in a given failure detector window.
 ClientConfig setFailureDetectorThresholdCountMinimum(int failureDetectorThresholdCountMinimum)
          Sets the minimum number of failures (exceptions/slow responses) in a given failure detector window, for a server to be marked down.
 ClientConfig setFailureDetectorThresholdInterval(long failureDetectorThresholdIntervalMs)
          Time window in ms, over which the failure detector accounts the failures and successes
 ClientConfig setFatClientWrapperCorePoolSize(int fatClientWrapperCorePoolSize)
           
 ClientConfig setFatClientWrapperKeepAliveInSecs(int fatClientWrapperKeepAliveInSecs)
           
 ClientConfig setFatClientWrapperMaxPoolSize(int fatClientWrapperMaxPoolSize)
           
 ClientConfig setMaxBootstrapRetries(int maxBootstrapRetries)
          If we are unable to bootstrap, how many times should we re-try?
 ClientConfig setMaxConnectionsPerNode(int maxConnectionsPerNode)
          Set the maximum number of connections allowed to each voldemort node.
 ClientConfig setMaxQueuedRequests(int maxQueuedRequests)
          Set the maximum number of queued node operations before client actions will be blocked
 ClientConfig setMaxThreads(int maxThreads)
          Set the maximum number of client threads
 ClientConfig setMaxTotalConnections(int maxTotalConnections)
          Deprecated. 
 ClientConfig setNodeBannagePeriod(int nodeBannagePeriod, java.util.concurrent.TimeUnit unit)
          Deprecated. Use setFailureDetectorBannagePeriod(long) instead
 ClientConfig setRequestFormatType(RequestFormatType requestFormatType)
          Set the request format type used for network communications (for example protocol buffers)
 ClientConfig setRoutingTier(RoutingTier routingTier)
          Set the tier at which routing occurs.
 ClientConfig setRoutingTimeout(int routingTimeout, java.util.concurrent.TimeUnit unit)
          Set the timeout for all blocking operations to complete on all nodes.
 ClientConfig setSelectors(int selectors)
          Number of NIO selector threads to use, to handle communication with the server.Typically, this is same as the number of cores in the client machine
 ClientConfig setSerializerFactory(SerializerFactory serializerFactory)
          Set the SerializerFactory used to serialize and deserialize values
 ClientConfig setSocketBufferSize(int socketBufferSize)
          Set the size of the socket buffer to use for both socket reads and socket writes
 ClientConfig setSocketKeepAlive(boolean socketKeepAlive)
          Enabled/disable SO_KEEPALIVE on the connection created with the voldemort servers
 ClientConfig setSocketTimeout(int socketTimeout, java.util.concurrent.TimeUnit unit)
          Set the SO_TIMEOUT for the socket if using HTTP or socket based network communication.
 ClientConfig setSysEnableJmx(boolean sysEnableJmx)
          Whether or not JMX monitoring is enabled for the system store
 ClientConfig setThreadIdleTime(long threadIdleTime, java.util.concurrent.TimeUnit unit)
          Deprecated. 
 ClientConfig setTimeoutConfig(TimeoutConfig tConfig)
          Set the timeout configuration for the voldemort operations
 int toInt(long l)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX_CONNECTIONS_PER_NODE_PROPERTY

public static final java.lang.String MAX_CONNECTIONS_PER_NODE_PROPERTY
See Also:
Constant Field Values

MAX_TOTAL_CONNECTIONS_PROPERTY

public static final java.lang.String MAX_TOTAL_CONNECTIONS_PROPERTY
See Also:
Constant Field Values

MAX_THREADS_PROPERTY

public static final java.lang.String MAX_THREADS_PROPERTY
See Also:
Constant Field Values

MAX_QUEUED_REQUESTS_PROPERTY

public static final java.lang.String MAX_QUEUED_REQUESTS_PROPERTY
See Also:
Constant Field Values

THREAD_IDLE_MS_PROPERTY

public static final java.lang.String THREAD_IDLE_MS_PROPERTY
See Also:
Constant Field Values

CONNECTION_TIMEOUT_MS_PROPERTY

public static final java.lang.String CONNECTION_TIMEOUT_MS_PROPERTY
See Also:
Constant Field Values

SOCKET_TIMEOUT_MS_PROPERTY

public static final java.lang.String SOCKET_TIMEOUT_MS_PROPERTY
See Also:
Constant Field Values

SOCKET_KEEPALIVE_PROPERTY

public static final java.lang.String SOCKET_KEEPALIVE_PROPERTY
See Also:
Constant Field Values

SELECTORS_PROPERTY

public static final java.lang.String SELECTORS_PROPERTY
See Also:
Constant Field Values

ROUTING_TIMEOUT_MS_PROPERTY

public static final java.lang.String ROUTING_TIMEOUT_MS_PROPERTY
See Also:
Constant Field Values

GETALL_ROUTING_TIMEOUT_MS_PROPERTY

public static final java.lang.String GETALL_ROUTING_TIMEOUT_MS_PROPERTY
See Also:
Constant Field Values

PUT_ROUTING_TIMEOUT_MS_PROPERTY

public static final java.lang.String PUT_ROUTING_TIMEOUT_MS_PROPERTY
See Also:
Constant Field Values

GET_ROUTING_TIMEOUT_MS_PROPERTY

public static final java.lang.String GET_ROUTING_TIMEOUT_MS_PROPERTY
See Also:
Constant Field Values

GET_VERSIONS_ROUTING_TIMEOUT_MS_PROPERTY

public static final java.lang.String GET_VERSIONS_ROUTING_TIMEOUT_MS_PROPERTY
See Also:
Constant Field Values

DELETE_ROUTING_TIMEOUT_MS_PROPERTY

public static final java.lang.String DELETE_ROUTING_TIMEOUT_MS_PROPERTY
See Also:
Constant Field Values

ALLOW_PARTIAL_GETALLS_PROPERTY

public static final java.lang.String ALLOW_PARTIAL_GETALLS_PROPERTY
See Also:
Constant Field Values

NODE_BANNAGE_MS_PROPERTY

public static final java.lang.String NODE_BANNAGE_MS_PROPERTY
See Also:
Constant Field Values

SOCKET_BUFFER_SIZE_PROPERTY

public static final java.lang.String SOCKET_BUFFER_SIZE_PROPERTY
See Also:
Constant Field Values

SERIALIZER_FACTORY_CLASS_PROPERTY

public static final java.lang.String SERIALIZER_FACTORY_CLASS_PROPERTY
See Also:
Constant Field Values

BOOTSTRAP_URLS_PROPERTY

public static final java.lang.String BOOTSTRAP_URLS_PROPERTY
See Also:
Constant Field Values

REQUEST_FORMAT_PROPERTY

public static final java.lang.String REQUEST_FORMAT_PROPERTY
See Also:
Constant Field Values

ENABLE_JMX_PROPERTY

public static final java.lang.String ENABLE_JMX_PROPERTY
See Also:
Constant Field Values

ENABLE_HINTED_HANDOFF_PROPERTY

public static final java.lang.String ENABLE_HINTED_HANDOFF_PROPERTY
See Also:
Constant Field Values

ENABLE_LAZY_PROPERTY

public static final java.lang.String ENABLE_LAZY_PROPERTY
See Also:
Constant Field Values

CLIENT_ZONE_ID

public static final java.lang.String CLIENT_ZONE_ID
See Also:
Constant Field Values

FAILUREDETECTOR_IMPLEMENTATION_PROPERTY

public static final java.lang.String FAILUREDETECTOR_IMPLEMENTATION_PROPERTY
See Also:
Constant Field Values

FAILUREDETECTOR_BANNAGE_PERIOD_PROPERTY

public static final java.lang.String FAILUREDETECTOR_BANNAGE_PERIOD_PROPERTY
See Also:
Constant Field Values

FAILUREDETECTOR_THRESHOLD_PROPERTY

public static final java.lang.String FAILUREDETECTOR_THRESHOLD_PROPERTY
See Also:
Constant Field Values

FAILUREDETECTOR_THRESHOLD_INTERVAL_PROPERTY

public static final java.lang.String FAILUREDETECTOR_THRESHOLD_INTERVAL_PROPERTY
See Also:
Constant Field Values

FAILUREDETECTOR_THRESHOLD_COUNTMINIMUM_PROPERTY

public static final java.lang.String FAILUREDETECTOR_THRESHOLD_COUNTMINIMUM_PROPERTY
See Also:
Constant Field Values

FAILUREDETECTOR_ASYNCRECOVERY_INTERVAL_PROPERTY

public static final java.lang.String FAILUREDETECTOR_ASYNCRECOVERY_INTERVAL_PROPERTY
See Also:
Constant Field Values

FAILUREDETECTOR_CATASTROPHIC_ERROR_TYPES_PROPERTY

public static final java.lang.String FAILUREDETECTOR_CATASTROPHIC_ERROR_TYPES_PROPERTY
See Also:
Constant Field Values

FAILUREDETECTOR_REQUEST_LENGTH_THRESHOLD_PROPERTY

public static final java.lang.String FAILUREDETECTOR_REQUEST_LENGTH_THRESHOLD_PROPERTY
See Also:
Constant Field Values

MAX_BOOTSTRAP_RETRIES

public static final java.lang.String MAX_BOOTSTRAP_RETRIES
See Also:
Constant Field Values

CLIENT_CONTEXT_NAME

public static final java.lang.String CLIENT_CONTEXT_NAME
See Also:
Constant Field Values

ASYNC_CHECK_METADATA_INTERVAL

public static final java.lang.String ASYNC_CHECK_METADATA_INTERVAL
See Also:
Constant Field Values

USE_DEFAULT_CLIENT

public static final java.lang.String USE_DEFAULT_CLIENT
See Also:
Constant Field Values

CLIENT_REGISTRY_REFRESH_INTERVAL

public static final java.lang.String CLIENT_REGISTRY_REFRESH_INTERVAL
See Also:
Constant Field Values

ASYNC_JOB_THREAD_POOL_SIZE

public static final java.lang.String ASYNC_JOB_THREAD_POOL_SIZE
See Also:
Constant Field Values

SYS_MAX_CONNECTIONS_PER_NODE

public static final java.lang.String SYS_MAX_CONNECTIONS_PER_NODE
See Also:
Constant Field Values

SYS_ROUTING_TIMEOUT_MS

public static final java.lang.String SYS_ROUTING_TIMEOUT_MS
See Also:
Constant Field Values

SYS_CONNECTION_TIMEOUT_MS

public static final java.lang.String SYS_CONNECTION_TIMEOUT_MS
See Also:
Constant Field Values

SYS_SOCKET_TIMEOUT_MS

public static final java.lang.String SYS_SOCKET_TIMEOUT_MS
See Also:
Constant Field Values

SYS_ENABLE_JMX

public static final java.lang.String SYS_ENABLE_JMX
See Also:
Constant Field Values

ENABLE_COMPRESSION_LAYER

public static final java.lang.String ENABLE_COMPRESSION_LAYER
See Also:
Constant Field Values

ENABLE_SERIALIZATION_LAYER

public static final java.lang.String ENABLE_SERIALIZATION_LAYER
See Also:
Constant Field Values

ENABLE_INCONSISTENCY_RESOLVING_LAYER

public static final java.lang.String ENABLE_INCONSISTENCY_RESOLVING_LAYER
See Also:
Constant Field Values

FAT_CLIENT_WRAPPER_MAX_POOL_SIZE_PROPERTY

public static final java.lang.String FAT_CLIENT_WRAPPER_MAX_POOL_SIZE_PROPERTY
See Also:
Constant Field Values

FAT_CLIENT_WRAPPER_CORE_POOL_SIZE_PROPERTY

public static final java.lang.String FAT_CLIENT_WRAPPER_CORE_POOL_SIZE_PROPERTY
See Also:
Constant Field Values

FAT_CLIENT_WRAPPER_POOL_KEEPALIVE_IN_SECS

public static final java.lang.String FAT_CLIENT_WRAPPER_POOL_KEEPALIVE_IN_SECS
See Also:
Constant Field Values

GET_OP_ZONE_AFFINITY

public static final java.lang.String GET_OP_ZONE_AFFINITY
See Also:
Constant Field Values

GETALL_OP_ZONE_AFFINITY

public static final java.lang.String GETALL_OP_ZONE_AFFINITY
See Also:
Constant Field Values

GETVERSIONS_OP_ZONE_AFFINITY

public static final java.lang.String GETVERSIONS_OP_ZONE_AFFINITY
See Also:
Constant Field Values
Constructor Detail

ClientConfig

public ClientConfig()

ClientConfig

public ClientConfig(java.io.File propertyFile)
Instantiate the client config using a properties file

Parameters:
propertyFile - Properties file

ClientConfig

public ClientConfig(java.util.Properties properties)
Initiate the client config from a set of properties. This is useful for wiring from Spring or for externalizing client properties to a properties file

Parameters:
properties - The properties to use
Method Detail

getSysMaxConnectionsPerNode

public int getSysMaxConnectionsPerNode()

getSysRoutingTimeout

public int getSysRoutingTimeout()

getSysSocketTimeout

public int getSysSocketTimeout()

getSysConnectionTimeout

public int getSysConnectionTimeout()

setSysEnableJmx

public ClientConfig setSysEnableJmx(boolean sysEnableJmx)
Whether or not JMX monitoring is enabled for the system store

Parameters:
sysEnableJmx -
Returns:
modified ClientConfig

getSysEnableJmx

public boolean getSysEnableJmx()

getMaxConnectionsPerNode

public int getMaxConnectionsPerNode()

setMaxConnectionsPerNode

public ClientConfig setMaxConnectionsPerNode(int maxConnectionsPerNode)
Set the maximum number of connections allowed to each voldemort node. Play with this value to determine how many connections are enough for your workload. Without high enough connections, you may not be able to throw enough traffic at the servers

Parameters:
maxConnectionsPerNode - The maximum number of connections

getSocketTimeout

public int getSocketTimeout(java.util.concurrent.TimeUnit unit)

setSocketTimeout

public ClientConfig setSocketTimeout(int socketTimeout,
                                     java.util.concurrent.TimeUnit unit)
Set the SO_TIMEOUT for the socket if using HTTP or socket based network communication. This is the maximum amount of time the socket will block waiting for network activity.

Parameters:
socketTimeout - The socket timeout
unit - The time unit of the timeout value

getSocketKeepAlive

public boolean getSocketKeepAlive()

setSocketKeepAlive

public ClientConfig setSocketKeepAlive(boolean socketKeepAlive)
Enabled/disable SO_KEEPALIVE on the connection created with the voldemort servers

Parameters:
socketKeepAlive -
Returns:
modified ClientConfig

getSelectors

public int getSelectors()

setSelectors

public ClientConfig setSelectors(int selectors)
Number of NIO selector threads to use, to handle communication with the server.Typically, this is same as the number of cores in the client machine

Parameters:
selectors -
Returns:
modified ClientConfig

getRoutingTimeout

public int getRoutingTimeout(java.util.concurrent.TimeUnit unit)

setRoutingTimeout

public ClientConfig setRoutingTimeout(int routingTimeout,
                                      java.util.concurrent.TimeUnit unit)
Set the timeout for all blocking operations to complete on all nodes. The number of blocking operations can be configured using the preferred-reads and preferred-writes configuration for the store. See GETALL_ROUTING_TIMEOUT_MS_PROPERTY, GET_ROUTING_TIMEOUT_MS_PROPERTY, PUT_ROUTING_TIMEOUT_MS_PROPERTY, DELETE_ROUTING_TIMEOUT_MS_PROPERTY to override timeouts for specific operations

Parameters:
routingTimeout - The timeout for all operations to complete.
unit - The time unit of the timeout value

setTimeoutConfig

public ClientConfig setTimeoutConfig(TimeoutConfig tConfig)
Set the timeout configuration for the voldemort operations

Parameters:
tConfig -
Returns:
modified ClientConfig

getTimeoutConfig

public TimeoutConfig getTimeoutConfig()
Get the timeouts for voldemort operations

Returns:
modified ClientConfig

getNodeBannagePeriod

@Deprecated
public int getNodeBannagePeriod(java.util.concurrent.TimeUnit unit)
Deprecated. Use getFailureDetectorBannagePeriod() instead


setNodeBannagePeriod

@Deprecated
public ClientConfig setNodeBannagePeriod(int nodeBannagePeriod,
                                                    java.util.concurrent.TimeUnit unit)
Deprecated. Use setFailureDetectorBannagePeriod(long) instead

The period of time to ban a node that gives an error on an operation.

Parameters:
nodeBannagePeriod - The period of time to ban the node
unit - The time unit of the given value

getConnectionTimeout

public int getConnectionTimeout(java.util.concurrent.TimeUnit unit)

setConnectionTimeout

public ClientConfig setConnectionTimeout(int connectionTimeout,
                                         java.util.concurrent.TimeUnit unit)
Set the maximum allowable time to block waiting for a free connection

Parameters:
connectionTimeout - The connection timeout
unit - The time unit of the given value

getSocketBufferSize

public int getSocketBufferSize()

setSocketBufferSize

public ClientConfig setSocketBufferSize(int socketBufferSize)
Set the size of the socket buffer to use for both socket reads and socket writes

Parameters:
socketBufferSize - The size of the socket buffer in bytes

getSerializerFactory

public SerializerFactory getSerializerFactory()

setSerializerFactory

public ClientConfig setSerializerFactory(SerializerFactory serializerFactory)
Set the SerializerFactory used to serialize and deserialize values


getBootstrapUrls

public java.lang.String[] getBootstrapUrls()

setBootstrapUrls

public ClientConfig setBootstrapUrls(java.util.List<java.lang.String> bootstrapUrls)
Set the bootstrap urls from which to attempt a connection

Parameters:
bootstrapUrls - The urls to bootstrap from

setBootstrapUrls

public ClientConfig setBootstrapUrls(java.lang.String... bootstrapUrls)
Set the bootstrap urls from which to attempt a connection

Parameters:
bootstrapUrls - The urls to bootstrap from

getRequestFormatType

public RequestFormatType getRequestFormatType()

setRequestFormatType

public ClientConfig setRequestFormatType(RequestFormatType requestFormatType)
Set the request format type used for network communications (for example protocol buffers)

Parameters:
requestFormatType - The type of the network protocol

getRoutingTier

public RoutingTier getRoutingTier()

setRoutingTier

public ClientConfig setRoutingTier(RoutingTier routingTier)
Set the tier at which routing occurs. Client-side routing occurs on the client, and server-side routing on the server. NOTE : Server side routing is not used, as yet. The java client only supports client-side routing.

Parameters:
routingTier - The routing tier to use for routing requests

getMaxThreads

public int getMaxThreads()

setMaxThreads

public ClientConfig setMaxThreads(int maxThreads)
Set the maximum number of client threads

Parameters:
maxThreads - The maximum number of client threads

getMaxTotalConnections

@Deprecated
public int getMaxTotalConnections()
Deprecated. 


getThreadIdleTime

@Deprecated
public int getThreadIdleTime(java.util.concurrent.TimeUnit unit)
Deprecated. 


setThreadIdleTime

@Deprecated
public ClientConfig setThreadIdleTime(long threadIdleTime,
                                                 java.util.concurrent.TimeUnit unit)
Deprecated. 

The amount of time to keep an idle client thread alive

Parameters:
threadIdleTime -

getMaxQueuedRequests

public int getMaxQueuedRequests()

setMaxQueuedRequests

public ClientConfig setMaxQueuedRequests(int maxQueuedRequests)
Set the maximum number of queued node operations before client actions will be blocked

Parameters:
maxQueuedRequests - The maximum number of queued requests

setMaxTotalConnections

@Deprecated
public ClientConfig setMaxTotalConnections(int maxTotalConnections)
Deprecated. 

Set the maximum number of connections allowed to all voldemort nodes. Note: This has no effect when using NIO based pipeline routing

Parameters:
maxTotalConnections - The maximum total number of connections

toInt

public int toInt(long l)

isJmxEnabled

public boolean isJmxEnabled()

setEnableJmx

public ClientConfig setEnableJmx(boolean enableJmx)
Enable JMX monitoring of the clients?

Parameters:
enableJmx - If true JMX monitoring of the clients will be enabled

isLazyEnabled

public boolean isLazyEnabled()

setEnableLazy

public ClientConfig setEnableLazy(boolean enableLazy)
Enable lazy initialization of clients?

Parameters:
enableLazy - If true clients will be lazily initialized

setClientZoneId

public ClientConfig setClientZoneId(int clientZoneId)
Sets the zone the client belongs to. This is very important in zoned configurations since the client always has an "affinity" towards the servers in its zone. Default : zone 0

Parameters:
clientZoneId -
Returns:
modified ClientConfig

getClientZoneId

public int getClientZoneId()

enableDefaultClient

public ClientConfig enableDefaultClient(boolean enableDefault)
Whether or not a ZenStoreClient is created as opposed to a DefaultStoreClient true = DefaultStoreClient and false = ZenStoreClient

Parameters:
enableDefault -
Returns:
modified ClientConfig

isDefaultClientEnabled

public boolean isDefaultClientEnabled()

getFailureDetectorImplementation

public java.lang.String getFailureDetectorImplementation()

setFailureDetectorImplementation

public ClientConfig setFailureDetectorImplementation(java.lang.String failureDetectorImplementation)
FailureDetector to use. Its highly recommended to use ThresholdFailureDetector as opposed to using BannagePeriodFailureDetector

Parameters:
failureDetectorImplementation -
Returns:
modified ClientConfig

getFailureDetectorBannagePeriod

public long getFailureDetectorBannagePeriod()

setFailureDetectorBannagePeriod

public ClientConfig setFailureDetectorBannagePeriod(long failureDetectorBannagePeriod)

getFailureDetectorThreshold

public int getFailureDetectorThreshold()

setFailureDetectorThreshold

public ClientConfig setFailureDetectorThreshold(int failureDetectorThreshold)
Set the percentage of exceptions that tolerated in a given failure detector window. If the client experiences more exceptions than this threshold, it will mark the erring server down

Parameters:
failureDetectorThreshold -
Returns:
modified ClientConfig

getFailureDetectorThresholdCountMinimum

public int getFailureDetectorThresholdCountMinimum()

setFailureDetectorThresholdCountMinimum

public ClientConfig setFailureDetectorThresholdCountMinimum(int failureDetectorThresholdCountMinimum)
Sets the minimum number of failures (exceptions/slow responses) in a given failure detector window, for a server to be marked down. Guards against a very small number of exceptions tripping the Failure detector due to low activity

Parameters:
failureDetectorThresholdCountMinimum -
Returns:
modified ClientConfig

getFailureDetectorThresholdInterval

public long getFailureDetectorThresholdInterval()

setFailureDetectorThresholdInterval

public ClientConfig setFailureDetectorThresholdInterval(long failureDetectorThresholdIntervalMs)
Time window in ms, over which the failure detector accounts the failures and successes

Parameters:
failureDetectorThresholdIntervalMs -
Returns:
modified ClientConfig

getFailureDetectorAsyncRecoveryInterval

public long getFailureDetectorAsyncRecoveryInterval()

setFailureDetectorAsyncRecoveryInterval

public ClientConfig setFailureDetectorAsyncRecoveryInterval(long failureDetectorAsyncRecoveryInterval)
Number of milliseconds, to try to check if a marked down server has come back up again

Parameters:
failureDetectorAsyncRecoveryInterval -
Returns:
modified ClientConfig

getFailureDetectorCatastrophicErrorTypes

public java.util.List<java.lang.String> getFailureDetectorCatastrophicErrorTypes()

setFailureDetectorCatastrophicErrorTypes

public ClientConfig setFailureDetectorCatastrophicErrorTypes(java.util.List<java.lang.String> failureDetectorCatastrophicErrorTypes)
Sets the exception types that should be treated as catastrophic,by the failure detector, resulting in the server being immediately considered down. Input string list should be populated by something like ConnectException.class.getName()

Parameters:
failureDetectorCatastrophicErrorTypes -
Returns:
modified ClientConfig

getFailureDetectorRequestLengthThreshold

public long getFailureDetectorRequestLengthThreshold()

setFailureDetectorRequestLengthThreshold

public ClientConfig setFailureDetectorRequestLengthThreshold(long failureDetectorRequestLengthThreshold)
Sets the maximum amount of time a request is allowed to take, to be not considered as a "slow" request and count against the server, in terms of failure detection

Parameters:
failureDetectorRequestLengthThreshold -
Returns:
modified ClientConfig

getMaxBootstrapRetries

public int getMaxBootstrapRetries()

setMaxBootstrapRetries

public ClientConfig setMaxBootstrapRetries(int maxBootstrapRetries)
If we are unable to bootstrap, how many times should we re-try?

Parameters:
maxBootstrapRetries - Maximum times to retry bootstrapping (must be >= 1)
Throws:
java.lang.IllegalArgumentException - If maxBootstrapRetries < 1

getClientContextName

public java.lang.String getClientContextName()

setClientContextName

public ClientConfig setClientContextName(java.lang.String clientContextName)
Set the client context name

Parameters:
clientContextName - The name of client context

getAsyncMetadataRefreshInMs

public long getAsyncMetadataRefreshInMs()

setAsyncMetadataRefreshInMs

public ClientConfig setAsyncMetadataRefreshInMs(long asyncCheckMetadataIntervalMs)
Set the interval on which client checks for metadata change on servers

Parameters:
asyncCheckMetadataIntervalMs - The metadata change interval

getClientRegistryUpdateIntervalInSecs

public int getClientRegistryUpdateIntervalInSecs()

setClientRegistryUpdateIntervalInSecs

public ClientConfig setClientRegistryUpdateIntervalInSecs(int clientRegistryRefrshIntervalInSecs)
Set the interval on which client refreshes its corresponding entry of the client registry on the servers

Parameters:
clientRegistryRefrshIntervalInSecs - The refresh interval in seconds
Returns:
modified ClientConfig

getAsyncJobThreadPoolSize

public int getAsyncJobThreadPoolSize()

setAsyncJobThreadPoolSize

public ClientConfig setAsyncJobThreadPoolSize(int asyncJobThreadPoolSize)
Set the # of threads for the async. job thread pool

Parameters:
asyncJobThreadPoolSize - The max # of threads in the async job

isEnableCompressionLayer

public boolean isEnableCompressionLayer()

setEnableCompressionLayer

public ClientConfig setEnableCompressionLayer(boolean enableCompressionLayer)

isEnableSerializationLayer

public boolean isEnableSerializationLayer()

setEnableSerializationLayer

public ClientConfig setEnableSerializationLayer(boolean enableSerializationLayer)

isEnableInconsistencyResolvingLayer

public boolean isEnableInconsistencyResolvingLayer()

setEnableInconsistencyResolvingLayer

public ClientConfig setEnableInconsistencyResolvingLayer(boolean enableInconsistencyResolvingLayer)

getZoneAffinity

public ZoneAffinity getZoneAffinity()

getFatClientWrapperMaxPoolSize

public int getFatClientWrapperMaxPoolSize()

setFatClientWrapperMaxPoolSize

public ClientConfig setFatClientWrapperMaxPoolSize(int fatClientWrapperMaxPoolSize)
Parameters:
fatClientWrapperMaxPoolSize - Defines the Maximum pool size for the thread pool used in the Fat client wrapper

getFatClientWrapperCorePoolSize

public int getFatClientWrapperCorePoolSize()

setFatClientWrapperCorePoolSize

public ClientConfig setFatClientWrapperCorePoolSize(int fatClientWrapperCorePoolSize)
Parameters:
fatClientWrapperCorePoolSize - Defines the Core pool size for the thread pool used in the Fat client wrapper

getFatClientWrapperKeepAliveInSecs

public int getFatClientWrapperKeepAliveInSecs()

setFatClientWrapperKeepAliveInSecs

public ClientConfig setFatClientWrapperKeepAliveInSecs(int fatClientWrapperKeepAliveInSecs)
Parameters:
fatClientWrapperKeepAliveInSecs - Defines the Keep alive period in seconds for the thread pool used in the Fat client wrapper

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Jay Kreps, Roshan Sumbaly, Alex Feinberg, Bhupesh Bansal, Lei Gao, Chinmay Soman, Vinoth Chandar, Zhongjie Wu