You can execute statements on a session objects in two different ways. Calling execute blocks the calling thread until the statement finishes executing, but a session also allows for asynchronous and non-blocking I/O by calling the executeAsync method.
If a Cassandra node fails or becomes unreachable, the Java driver automatically and transparently tries other nodes in the cluster and schedules reconnections to the dead nodes in the background.
You have several options to help in debugging your application.
The Java driver automatically discovers and uses all of the nodes in a Cassandra cluster, including newly bootstrapped ones.
You can modify the tuning policies and connection options for a cluster as you build it.
The query builder class helps to create executable CQL statements dynamically without resorting to building query strings by hand.