public final class ClientConfig extends Object
Modifier and Type | Field and Description |
---|---|
AWSCredentialsProvider |
mProvider
Deprecated.
|
String |
mRegion
Deprecated.
|
Constructor and Description |
---|
ClientConfig() |
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.
|
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 |
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 |
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 |
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 |
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 |
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 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()
public void setConnectTimeout(long connectTimeout, TimeUnit unit)
Defaults to 1s.
connectTimeout
- the timeoutunit
- the time unit for connectTimeoutpublic ClientConfig withConnectTimeout(long connectTimeout, TimeUnit unit)
Defaults to 1s.
connectTimeout
- the timeoutunit
- the time unit for connectTimeoutpublic long getRequestTimeout()
public void setRequestTimeout(long RequestTimeout, TimeUnit unit)
Defaults to 60s.
RequestTimeout
- the timeoutunit
- the time unit for readTimeoutpublic ClientConfig withRequestTimeout(long RequestTimeout, TimeUnit unit)
Defaults to 60s.
RequestTimeout
- the timeoutunit
- the time unit for readTimeoutpublic long getHealthCheckTimeout()
public void setHealthCheckTimeout(long healthCheckTimeout, TimeUnit unit)
Defaults to 1s.
healthCheckTimeout
- the timeoutunit
- the time unit for healthCheckTimeoutpublic ClientConfig withHealthCheckTimeout(long healthCheckTimeout, TimeUnit unit)
Defaults to 1s.
healthCheckTimeout
- the timeoutunit
- the time unit for healthCheckTimeoutpublic long getHealthCheckInterval()
public void setHealthCheckInterval(long healthCheckInterval, TimeUnit unit)
Defaults to 5s.
healthCheckInterval
- the intervalunit
- the time unit for healthCheckIntervalpublic ClientConfig withHealthCheckInterval(long healthCheckInterval, TimeUnit unit)
Defaults to 5s.
healthCheckInterval
- the intervalunit
- the time unit for healthCheckIntervalpublic int getWriteRetries()
public void setWriteRetries(int writeRetries)
Defaults to 2.
writeRetries
- the number of times to retrypublic ClientConfig withWriteRetries(int writeRetries)
Defaults to 2.
writeRetries
- the number of times to retrypublic int getMaxPendingConnectsPerHost()
public void setMaxPendingConnectsPerHost(int maxPending)
Defaults to 10.
maxPending
- the maximum number of pending connectionspublic ClientConfig withMaxPendingConnectsPerHost(int maxPending)
Defaults to 10.
maxPending
- the maximum number of pending connectionspublic int getReadRetries()
public void setReadRetries(int readRetries)
Defaults to 2.
readRetries
- the number of times to retrypublic ClientConfig withReadRetries(int readRetries)
Defaults to 2.
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.
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 10s.
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 10s.
threadKeepAlive
- the keep alive timeunit
- the time unit for threadKeepAlivepublic long getClusterUpdateInterval()
public void setClusterUpdateInterval(long clusterUpdateInterval, TimeUnit unit)
Defaults to 4000ms.
clusterUpdateInterval
- the interval between pollingunit
- the time unit for clusterUpdateIntervalpublic ClientConfig withClusterUpdateInterval(long clusterUpdateInterval, TimeUnit unit)
Defaults to 4000ms.
clusterUpdateInterval
- the interval between pollingunit
- the time unit for clusterUpdateIntervalpublic long getClusterUpdateThreshold()
public void setClusterUpdateThreshold(long clusterUpdateThreshold, TimeUnit unit)
Defaults to 125ms.
clusterUpdateThreshold
- the update thresholdunit
- the time unit for clusterUpdateThresholdpublic ClientConfig withClusterUpdateThreshold(long clusterUpdateThreshold, TimeUnit unit)
Defaults to 125ms.
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).
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 7s.
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 7s.
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 region