April 2017
Beginner to intermediate
360 pages
9h 35m
English
This is the default load-balancing policy. This is a straightforward implementation and chooses hosts in a round robin fashion to execute queries. This implementation is not datacenter aware. If a host fails in a query, the next one in the round robin is used.
Suppose you have three hosts in a cluster. Your query execution sequence could look like this:
To use this policy, create a Cluster object as follows:
Cluster cluster = Cluster.builder().addContactPoints("127.0.0.1").withLoadBalancingPolicy(new RoundRobinPolicy()).build();
Read now
Unlock full access