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.*.size
in the configuration), a reconnection starts for that
pool.
Modifier and Type | Interface and Description |
---|---|
static interface |
ReconnectionPolicy.ReconnectionSchedule
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 |
---|---|
void |
close()
Called when the cluster that this policy is associated with closes.
|
ReconnectionPolicy.ReconnectionSchedule |
newControlConnectionSchedule()
Creates a new schedule for the control connection.
|
ReconnectionPolicy.ReconnectionSchedule |
newNodeSchedule(Node node)
Creates a new schedule for the given node.
|
@NonNull ReconnectionPolicy.ReconnectionSchedule newNodeSchedule(@NonNull Node node)
@NonNull ReconnectionPolicy.ReconnectionSchedule newControlConnectionSchedule()
void close()
close
in interface AutoCloseable
Copyright © 2017–2018. All rights reserved.