Package com.hazelcast.client.config
Class ConnectionRetryConfig
java.lang.Object
com.hazelcast.client.config.ConnectionRetryConfig
Connection Retry Config is controls the period among the retries and when should a client gave up
 retrying. Exponential behaviour can be chosen or jitter can be added to wait periods.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intDefault value for the cluster connection timeout.static final intTimeout used by the failover client to start trying to connect alternative clusters when the cluster connection timeout is equal toDEFAULT_CLUSTER_CONNECT_TIMEOUT_MILLIS.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleanlongTimeout value in milliseconds for the client to give up to connect to the current cluster Depending on FailoverConfig, a client can shut down or start trying on alternative clusters after reaching the timeout.inthow long to wait after the first failure before retryingdoubleby how much to randomize backoffs.intWhen backoff reaches this upper bound, it does not increase anymore.doublefactor with which to multiply backoff after a failed retryinthashCode()setClusterConnectTimeoutMillis(long clusterConnectTimeoutMillis) setInitialBackoffMillis(int initialBackoffMillis) setJitter(double jitter) At each iteration calculated back-off is randomized via following method Random(-jitter * current_backoff, jitter * current_backoff)setMaxBackoffMillis(int maxBackoffMillis) When backoff reaches this upper bound, it does not increase anymore.setMultiplier(double multiplier) toString()
- 
Field Details- 
DEFAULT_CLUSTER_CONNECT_TIMEOUT_MILLISpublic static final int DEFAULT_CLUSTER_CONNECT_TIMEOUT_MILLISDefault value for the cluster connection timeout.- See Also:
 
- 
FAILOVER_CLIENT_DEFAULT_CLUSTER_CONNECT_TIMEOUT_MILLISpublic static final int FAILOVER_CLIENT_DEFAULT_CLUSTER_CONNECT_TIMEOUT_MILLISTimeout used by the failover client to start trying to connect alternative clusters when the cluster connection timeout is equal toDEFAULT_CLUSTER_CONNECT_TIMEOUT_MILLIS.- See Also:
 
 
- 
- 
Constructor Details- 
ConnectionRetryConfigpublic ConnectionRetryConfig()
- 
ConnectionRetryConfig
 
- 
- 
Method Details- 
getInitialBackoffMillispublic int getInitialBackoffMillis()how long to wait after the first failure before retrying- Returns:
- initialBackoffMillis
 
- 
setInitialBackoffMillis- Parameters:
- initialBackoffMillis- how long to wait after the first failure before retrying
- Returns:
- updated ConnectionRetryConfig
 
- 
getMaxBackoffMillispublic int getMaxBackoffMillis()When backoff reaches this upper bound, it does not increase anymore.- Returns:
- maxBackoffMillis
 
- 
setMaxBackoffMillisWhen backoff reaches this upper bound, it does not increase anymore.- Parameters:
- maxBackoffMillis- upper bound on backoff
- Returns:
- updated ConnectionRetryConfig
 
- 
getMultiplierpublic double getMultiplier()factor with which to multiply backoff after a failed retry- Returns:
- multiplier
 
- 
setMultiplier- Parameters:
- multiplier- factor with which to multiply backoff after a failed retry
- Returns:
- updated ConnectionRetryConfig
 
- 
getClusterConnectTimeoutMillispublic long getClusterConnectTimeoutMillis()Timeout value in milliseconds for the client to give up to connect to the current cluster Depending on FailoverConfig, a client can shut down or start trying on alternative clusters after reaching the timeout. If it is equal to-1, which is the default value, the client will not stop trying to connect to the cluster. If the failover client is used, for the default value, the client will start trying to connect alternative clusters afterFAILOVER_CLIENT_DEFAULT_CLUSTER_CONNECT_TIMEOUT_MILLIS. For any other value, both the failover and non-failover client will use that as it is.- Returns:
- clusterConnectTimeoutMillis
 
- 
setClusterConnectTimeoutMillis- Parameters:
- clusterConnectTimeoutMillis- timeout in milliseconds for the client to give up to connect to the current cluster Depending on FailoverConfig, a client can shut down or start trying on alternative clusters after reaching the timeout. If set to- -1, which is the default value, the client will not stop trying to connect to the cluster. If the failover client is used, for the default value, the client will start trying to connect alternative clusters after- FAILOVER_CLIENT_DEFAULT_CLUSTER_CONNECT_TIMEOUT_MILLIS. For any other value, both the failover and non-failover client will use that as it is.
- Returns:
- updated ConnectionRetryConfig
 
- 
getJitterpublic double getJitter()by how much to randomize backoffs. At each iteration calculated back-off is randomized via following method Random(-jitter * current_backoff, jitter * current_backoff)- Returns:
- jitter
 
- 
setJitterAt each iteration calculated back-off is randomized via following method Random(-jitter * current_backoff, jitter * current_backoff)- Parameters:
- jitter- by how much to randomize backoffs
- Returns:
- updated ConnectionRetryConfig
 
- 
equals
- 
hashCodepublic int hashCode()
- 
toString
 
-