public interface ReconnectionPolicy extends AutoCloseable
When a reconnection starts, the driver invokes this policy to create a
ReconnectionSchedule instance. That schedule's
nextDelay() method will get called each time the driver needs
to program the next connection attempt. When the reconnection succeeds, the schedule is
discarded; if the connection is lost again later, the next reconnection attempt will query the
policy again to obtain a new schedule.
There are two types of reconnection:
advanced.connection.pool.*.sizein the configuration), a reconnection starts for that pool.
advanced.reconnect-on-initis set and the driver has to retry the initial connection.
|Modifier and Type||Interface and Description|
The reconnection schedule from the time a connection is lost, to the time all connections to this node have been restored.
|Modifier and Type||Method and Description|
Called when the cluster that this policy is associated with closes.
Creates a new schedule for the control connection.
Creates a new schedule for the given node.
@NonNull ReconnectionPolicy.ReconnectionSchedule newNodeSchedule(@NonNull Node node)
@NonNull ReconnectionPolicy.ReconnectionSchedule newControlConnectionSchedule(boolean isInitialConnection)
isInitialConnection- whether this schedule is generated for the driver's initial attempt to connect to the cluster.
truemeans that the configuration option
advanced.reconnect-on-initis set, the driver failed to reach any contact point, and it is now scheduling reattempts.
falsemeans that the driver was already initialized, lost connection to the control node, and is now scheduling attempts to connect to another node.
Copyright © 2017–2023. All rights reserved.