com.datastax.driver.core.policies
Interface ReconnectionPolicy
- All Known Implementing Classes:
- ConstantReconnectionPolicy, ExponentialReconnectionPolicy
public interface ReconnectionPolicy
Policy that decides how often the reconnection to a dead node is attempted.
Each time a node is detected dead (because a connection error occurs), a new
ReconnectionSchedule
instance is created (through the newSchedule()
).
Then each call to the ReconnectionPolicy.ReconnectionSchedule.nextDelayMs()
method of
this instance will decide when the next reconnection attempt to this node
will be tried.
Note that if the driver receives a push notification from the Cassandra cluster
that a node is UP, any existing ReconnectionSchedule
on that node
will be cancelled and a new one will be created (in effect, the driver reset
the scheduler).
The default ExponentialReconnectionPolicy
policy is usually
adequate.
newSchedule
ReconnectionPolicy.ReconnectionSchedule newSchedule()
- Creates a new schedule for reconnection attempts.
Copyright © 2013. All Rights Reserved.