If the driver loses a connection to a node, it tries to re-establish it according to a configurable policy. This is used in two places:
ReconnectionPolicy controls the interval between each attempt. The policy to use may be provided using Cluster.Builder.withReconnectionPolicy. For example, the following configures an ExponentialReconnectionPolicy with a base delay of 1 second, and a max delay of 10 minutes (this is the default behavior).
Cluster.builder() .withReconnectionPolicy(new ExponentialReconnectionPolicy(1000, 10 * 60 * 1000)) .build();
ConstantReconnectionPolicy uses the same delay every time, regardless of the previous number of attempts.
You can also write your own policy; it must implement ReconnectionPolicy.
For best results, use reasonable values: very low values (for example a constant delay of 10 milliseconds) will quickly saturate your system.