Package com.hazelcast.client.config
Class ConnectionRetryConfig
java.lang.Object
com.hazelcast.client.config.ConnectionRetryConfig
public class ConnectionRetryConfig extends Object
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.
-
Constructor Summary
Constructors Constructor Description ConnectionRetryConfig()
ConnectionRetryConfig(ConnectionRetryConfig connectionRetryConfig)
-
Method Summary
Modifier and Type Method Description boolean
equals(Object o)
long
getClusterConnectTimeoutMillis()
Timeout value in seconds for the client to give up to connect to the current cluster Depending on FailoverConfig, a client can shutdown or start trying on alternative cluster after reaching the timeout.int
getInitialBackoffMillis()
how long to wait after the first failure before retryingdouble
getJitter()
by how much to randomize backoffs.int
getMaxBackoffMillis()
When backoff reaches this upper bound, it does not increase any more.double
getMultiplier()
factor with which to multiply backoff after a failed retryint
hashCode()
ConnectionRetryConfig
setClusterConnectTimeoutMillis(long clusterConnectTimeoutMillis)
ConnectionRetryConfig
setInitialBackoffMillis(int initialBackoffMillis)
ConnectionRetryConfig
setJitter(double jitter)
At each iteration calculated back-off is randomized via following method Random(-jitter * current_backoff, jitter * current_backoff)ConnectionRetryConfig
setMaxBackoffMillis(int maxBackoffMillis)
When backoff reaches this upper bound, it does not increase any more.ConnectionRetryConfig
setMultiplier(double multiplier)
String
toString()
-
Constructor Details
-
ConnectionRetryConfig
public ConnectionRetryConfig() -
ConnectionRetryConfig
-
-
Method Details
-
getInitialBackoffMillis
public 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
-
getMaxBackoffMillis
public int getMaxBackoffMillis()When backoff reaches this upper bound, it does not increase any more.- Returns:
- maxBackoffMillis
-
setMaxBackoffMillis
When backoff reaches this upper bound, it does not increase any more.- Parameters:
maxBackoffMillis
- upper bound on backoff- Returns:
- updated ConnectionRetryConfig
-
getMultiplier
public 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
-
getClusterConnectTimeoutMillis
public long getClusterConnectTimeoutMillis()Timeout value in seconds for the client to give up to connect to the current cluster Depending on FailoverConfig, a client can shutdown or start trying on alternative cluster after reaching the timeout.- 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 shutdown or start trying on alternative cluster after reaching the timeout.- Returns:
- updated ConnectionRetryConfig
-
getJitter
public 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
-
setJitter
At 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
-
hashCode
public int hashCode() -
toString
-