The Java driver provides several policies to configure behavior. Some of the policies are as follows:
- Load-balancing policy: This determines which Cassandra host to contact for each query. The policy is made aware of any changes in the cluster topology. They ensure that downed nodes are excluded and decommissioned, or removed nodes are removed from the connection pool.
- Retry policy: This determines the course of action whenever failures occur. It's usually triggered when a timeout or host unavailable exception happens. This minimizes exception handling from our side by automating query retry of failures.
- Reconnection policy: This policy decides how often reconnection to a dead node is attempted.