|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.datastax.driver.core.policies.ExponentialReconnectionPolicy
public class ExponentialReconnectionPolicy
A reconnection policy that waits exponentially longer between each reconnection attempt (but keeps a constant delay once a maximum delay is reached).
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.datastax.driver.core.policies.ReconnectionPolicy |
|---|
ReconnectionPolicy.ReconnectionSchedule |
| Constructor Summary | |
|---|---|
ExponentialReconnectionPolicy(long baseDelayMs,
long maxDelayMs)
Creates a reconnection policy waiting exponentially longer for each new attempt. |
|
| Method Summary | |
|---|---|
long |
getBaseDelayMs()
The base delay in milliseconds for this policy (e.g. |
long |
getMaxDelayMs()
The maximum delay in milliseconds between reconnection attempts for this policy. |
ReconnectionPolicy.ReconnectionSchedule |
newSchedule()
A new schedule that used an exponentially growing delay between reconnection attempts. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ExponentialReconnectionPolicy(long baseDelayMs,
long maxDelayMs)
baseDelayMs - the base delay in milliseconds to use for
the schedules created by this policy.maxDelayMs - the maximum delay to wait between two attempts.| Method Detail |
|---|
public long getBaseDelayMs()
public long getMaxDelayMs()
public ReconnectionPolicy.ReconnectionSchedule newSchedule()
For this schedule, reconnection attempt i will be tried
Math.min(2^(i-1) * getBaseDelayMs(), getMaxDelayMs()) milliseconds after the previous one.
newSchedule in interface ReconnectionPolicy
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||