public final class ClientConfig extends Object
Modifier and Type | Field and Description |
---|---|
AWSCredentialsProvider |
mProvider
Deprecated.
|
String |
mRegion
Deprecated.
|
Constructor and Description |
---|
ClientConfig()
Constructs a new default initialized instance
|
Modifier and Type | Method and Description |
---|---|
long |
getClusterUpdateInterval()
Returns the interval between polling of cluster members for membership changes.
|
long |
getClusterUpdateThreshold()
Returns the threshold below which the cluster will not be polled for membership changes.
|
long |
getConnectTimeout()
Returns the timeout for connections with the DAX cluster.
|
AWSCredentialsProvider |
getCredentialsProvider()
Sets the credentials provider used to sign requests to the DAX cluster.
|
long |
getHealthCheckInterval()
Returns the interval between health checks with the DAX cluster.
|
long |
getHealthCheckTimeout()
Returns the health check timeout for connections with the DAX cluster.
|
HostPort[] |
getHostPorts()
Returns the DAX cluster discovery endpoints.
|
long |
getIdleConnectionTimeout()
Returns the timeout for idle connections with the DAX cluster.
|
int |
getMaxPendingConnectsPerHost()
Returns the maximum number of pending connections per DAX node.
|
long |
getMaxRetryDelay()
Returns the maximum delay between retries when the cluster is believed to be recovering.
|
int |
getReadRetries()
Returns the number of times to retry reads (not counting the initial try).
|
String |
getRegion()
Returns the AWS region.
|
long |
getRequestTimeout()
Returns the request timeout for connections with the DAX cluster.
|
long |
getThreadKeepAlive()
Returns the health check thread keep alive time.
|
int |
getUnhealthyConsecutiveErrorCount()
Returns the number of errors required to signal node unhealthy within health check interval
|
int |
getWriteRetries()
Returns the number of times to retry writes (not counting the initial try).
|
void |
setClusterUpdateInterval(long clusterUpdateInterval,
TimeUnit unit)
Sets the interval between polling of cluster members for membership changes.
|
void |
setClusterUpdateThreshold(long clusterUpdateThreshold,
TimeUnit unit)
Sets the threshold below which explicit unforced cluster refresh
requests will not be attempted to poll for membership changes.
|
void |
setConnectTimeout(long connectTimeout,
TimeUnit unit)
Sets the timeout for connections with the DAX cluster.
|
void |
setCredentialsProvider(AWSCredentialsProvider provider)
Sets the credentials provider used to sign requests to the DAX cluster.
|
void |
setEndpoints(String... hosts)
Sets the DAX cluster discovery endpoints.
|
void |
setHealthCheckInterval(long healthCheckInterval,
TimeUnit unit)
Sets the interval between health checks with the DAX cluster.
|
void |
setHealthCheckTimeout(long healthCheckTimeout,
TimeUnit unit)
Sets the health check timeout for connections with the DAX cluster.
|
void |
setIdleConnectionTimeout(long idleTimeout,
TimeUnit unit)
Sets the timeout for idle connections with the DAX cluster.
|
void |
setMaxPendingConnectsPerHost(int maxPending)
Sets the maximum number of pending connections per DAX node.
|
void |
setMaxRetryDelay(long retryDelayCap,
TimeUnit unit)
Sets the maximum delay between retries when the cluster is believed to be recovering.
|
void |
setReadRetries(int readRetries)
Sets the number of times to retry reads (not counting the initial try).
|
void |
setRegion(Region region)
Sets the AWS region.
|
void |
setRegion(String region)
Sets the AWS region.
|
void |
setRequestTimeout(long RequestTimeout,
TimeUnit unit)
Sets the request timeout for connections with the DAX cluster.
|
void |
setThreadKeepAlive(long threadKeepAlive,
TimeUnit unit)
Sets the health check thread keep alive time.
|
void |
setUnhealthyConsecutiveErrorCount(int errorCount)
Sets the number of consecutive errors required to signal node unhealthy within health check interval.
|
void |
setWriteRetries(int writeRetries)
Sets the number of times to retry writes (not counting the initial try).
|
ClientConfig |
withClusterUpdateInterval(long clusterUpdateInterval,
TimeUnit unit)
Sets the interval between polling of cluster members for membership changes.
|
ClientConfig |
withClusterUpdateThreshold(long clusterUpdateThreshold,
TimeUnit unit)
Sets the threshold below which explicit unforced cluster refresh
requests will not be attempted to poll for membership changes.
|
ClientConfig |
withConnectTimeout(long connectTimeout,
TimeUnit unit)
Sets the timeout for connections with the DAX cluster.
|
ClientConfig |
withCredentialsProvider(AWSCredentialsProvider provider)
Sets the credentials provider used to sign requests to the DAX cluster.
|
ClientConfig |
withEndpoints(String... hosts)
Sets the DAX cluster discovery endpoints.
|
ClientConfig |
withHealthCheckInterval(long healthCheckInterval,
TimeUnit unit)
Sets the interval between health checks with the DAX cluster.
|
ClientConfig |
withHealthCheckTimeout(long healthCheckTimeout,
TimeUnit unit)
Sets the health check timeout for connections with the DAX cluster.
|
ClientConfig |
withIdleConnectionTimeout(long idleTimeout,
TimeUnit unit)
Sets the timeout for idle connections with the DAX cluster.
|
ClientConfig |
withMaxPendingConnectsPerHost(int maxPending)
Sets the maximum number of pending connections per DAX node.
|
ClientConfig |
withMaxRetryDelay(long retryDelayCap,
TimeUnit unit)
Sets the maximum delay between retries when the cluster is believed to be recovering.
|
ClientConfig |
withReadRetries(int readRetries)
Sets the number of times to retry reads (not counting the initial try).
|
ClientConfig |
withRegion(Region region)
Sets the AWS region.
|
ClientConfig |
withRegion(String region)
Sets the AWS region.
|
ClientConfig |
withRequestTimeout(long RequestTimeout,
TimeUnit unit)
Sets the request timeout for connections with the DAX cluster.
|
ClientConfig |
withThreadKeepAlive(long threadKeepAlive,
TimeUnit unit)
Sets the health check thread keep alive time.
|
ClientConfig |
withUnhealthyConsecutiveErrorCount(int errorCount)
Sets the number of consecutive errors required to signal node unhealthy within health check interval.
|
ClientConfig |
withWriteRetries(int writeRetries)
Sets the number of times to retry writes (not counting the initial try).
|
@Deprecated public AWSCredentialsProvider mProvider
@Deprecated public String mRegion
public ClientConfig()
withConnectTimeout(long, TimeUnit)
set to ms,
withRequestTimeout(long, TimeUnit)
set to ms,
withHealthCheckInterval(long, TimeUnit)
set to ms,
withHealthCheckTimeout(long, TimeUnit)
set to ms,
withIdleConnectionTimeout(long, TimeUnit)
set to ms,
withClusterUpdateInterval(long, TimeUnit)
set to ms,
withClusterUpdateThreshold(long, TimeUnit)
set to ms,
withThreadKeepAlive(long, TimeUnit)
set to ms,
withMaxPendingConnectsPerHost(int)
set to ,
withWriteRetries(int)
set to ,
withReadRetries(int)
set to ,
withMaxRetryDelay(long, TimeUnit)
set to ms
public HostPort[] getHostPorts()
withEndpoints(String...)
,
setEndpoints(String...)
public void setEndpoints(String... hosts)
Cluster discovery endpoints are available from the DynamoDB console or by calling describe-clusters with the AWS CLI or DAX control plane client.
hosts
- the cluster discovery endpoints, in the form hostname:portgetHostPorts()
public ClientConfig withEndpoints(String... hosts)
Cluster discovery endpoints are available from the DynamoDB console or by calling describe-clusters with the AWS CLI or DAX control plane client.
hosts
- the cluster discovery endpoints, in the form hostname:portgetHostPorts()
public long getConnectTimeout()
Defaults to ms.
public void setConnectTimeout(long connectTimeout, TimeUnit unit)
Defaults to ms.
connectTimeout
- the timeoutunit
- the time unit for connectTimeoutpublic ClientConfig withConnectTimeout(long connectTimeout, TimeUnit unit)
Defaults to ms.
connectTimeout
- the timeoutunit
- the time unit for connectTimeoutpublic long getRequestTimeout()
Defaults to ms.
public void setRequestTimeout(long RequestTimeout, TimeUnit unit)
Defaults to ms.
RequestTimeout
- the timeoutunit
- the time unit for readTimeoutpublic ClientConfig withRequestTimeout(long RequestTimeout, TimeUnit unit)
Defaults to ms.
RequestTimeout
- the timeoutunit
- the time unit for readTimeoutpublic long getHealthCheckTimeout()
public void setHealthCheckTimeout(long healthCheckTimeout, TimeUnit unit)
Defaults to ms.
healthCheckTimeout
- the timeoutunit
- the time unit for healthCheckTimeoutpublic ClientConfig withHealthCheckTimeout(long healthCheckTimeout, TimeUnit unit)
Defaults to ms.
healthCheckTimeout
- the timeoutunit
- the time unit for healthCheckTimeoutpublic long getHealthCheckInterval()
public void setHealthCheckInterval(long healthCheckInterval, TimeUnit unit)
Defaults to ms.
healthCheckInterval
- the intervalunit
- the time unit for healthCheckIntervalpublic ClientConfig withHealthCheckInterval(long healthCheckInterval, TimeUnit unit)
Defaults to ms.
healthCheckInterval
- the intervalunit
- the time unit for healthCheckIntervalpublic long getIdleConnectionTimeout()
public void setIdleConnectionTimeout(long idleTimeout, TimeUnit unit)
Defaults to ms.
idleTimeout
- the timeoutunit
- the time unit for idleTimeoutpublic ClientConfig withIdleConnectionTimeout(long idleTimeout, TimeUnit unit)
Defaults to ms.
idleTimeout
- the timeoutunit
- the time unit for idleTimeoutpublic int getWriteRetries()
public void setWriteRetries(int writeRetries)
Defaults to .
writeRetries
- the number of times to retrypublic ClientConfig withWriteRetries(int writeRetries)
Defaults to .
writeRetries
- the number of times to retrypublic int getMaxPendingConnectsPerHost()
Pending connections are connections which are currently connecting.
Defaults to .
public void setMaxPendingConnectsPerHost(int maxPending)
Pending connections are connections which are currently connecting.
Defaults to .
maxPending
- the maximum number of pending connectionspublic ClientConfig withMaxPendingConnectsPerHost(int maxPending)
Pending connections are connections which are currently connecting.
Defaults to .
maxPending
- the maximum number of pending connectionspublic int getReadRetries()
public void setReadRetries(int readRetries)
Defaults to .
readRetries
- the number of times to retrypublic ClientConfig withReadRetries(int readRetries)
Defaults to .
readRetries
- the number of times to retrypublic long getThreadKeepAlive()
This is the length of time before idle threads will be terminated. The affected threads are monitoring connections to the DAX cluster. Defaults to ms.
public void setThreadKeepAlive(long threadKeepAlive, TimeUnit unit)
This is the length of time before idle threads will be terminated. The affected threads are monitoring connections to the DAX cluster. Defaults to ms.
threadKeepAlive
- the keep alive timeunit
- the time unit for threadKeepAlivepublic ClientConfig withThreadKeepAlive(long threadKeepAlive, TimeUnit unit)
This is the length of time before idle threads will be terminated. The affected threads are monitoring connections to the DAX cluster. Defaults to ms.
threadKeepAlive
- the keep alive timeunit
- the time unit for threadKeepAlivepublic long getClusterUpdateInterval()
public void setClusterUpdateInterval(long clusterUpdateInterval, TimeUnit unit)
Defaults to ms.
clusterUpdateInterval
- the interval between pollingunit
- the time unit for clusterUpdateIntervalpublic ClientConfig withClusterUpdateInterval(long clusterUpdateInterval, TimeUnit unit)
Defaults to ms.
clusterUpdateInterval
- the interval between pollingunit
- the time unit for clusterUpdateIntervalpublic long getClusterUpdateThreshold()
public void setClusterUpdateThreshold(long clusterUpdateThreshold, TimeUnit unit)
Defaults to ms.
clusterUpdateThreshold
- the update thresholdunit
- the time unit for clusterUpdateThresholdpublic ClientConfig withClusterUpdateThreshold(long clusterUpdateThreshold, TimeUnit unit)
Defaults to ms.
clusterUpdateThreshold
- the update thresholdunit
- the time unit for clusterUpdateThresholdpublic AWSCredentialsProvider getCredentialsProvider()
public void setCredentialsProvider(AWSCredentialsProvider provider)
provider
- the credentials providerpublic ClientConfig withCredentialsProvider(AWSCredentialsProvider provider)
provider
- the credentials providerpublic long getMaxRetryDelay()
If the cluster is believed to be healthy this delay is not used; instead a retry is immediately attempted (on another node if the cluster has more than one member). Defaults to ms.
public void setMaxRetryDelay(long retryDelayCap, TimeUnit unit)
If the cluster is believed to be healthy this delay is not used; instead a retry is immediately attempted (on another node if the cluster has more than one member). Defaults to ms.
retryDelayCap
- the maximum delayunit
- the time unit for retryDelayCappublic ClientConfig withMaxRetryDelay(long retryDelayCap, TimeUnit unit)
If the cluster is believed to be healthy this delay is not used; instead a retry is immediately attempted (on another node if the cluster has more than one member). Defaults to ms.
retryDelayCap
- the maximum delayunit
- the time unit for retryDelayCappublic String getRegion()
The region is necessary for signing requests; it is not used for cluster discovery.
public void setRegion(Region region)
The region is necessary for signing requests; it is not used for cluster discovery.
region
- the regionpublic void setRegion(String region)
The region is necessary for signing requests; it is not used for cluster discovery.
region
- the regionpublic ClientConfig withRegion(Region region)
The region is necessary for signing requests; it is not used for cluster discovery.
region
- the regionpublic ClientConfig withRegion(String region)
The region is necessary for signing requests; it is not used for cluster discovery.
region
- the regionpublic int getUnhealthyConsecutiveErrorCount()
Defaults to .
public void setUnhealthyConsecutiveErrorCount(int errorCount)
Defaults to .
errorCount
- number of errorspublic ClientConfig withUnhealthyConsecutiveErrorCount(int errorCount)
Defaults to .
errorCount
- number of errors