August 2016
Intermediate to advanced
196 pages
4h 21m
English
To get connected, you will start by creating a Cluster reference, which you will then construct using a builder pattern. You will specify each additional option by chaining method calls together to produce the desired configuration, then finally calling the build() method to initialize Cluster.
Let's build a cluster that's initialized with a list of possible initial contact points:
private Cluster cluster; // defined at class level
// you should only build the cluster once per app
cluster = Cluster.builder()
.addContactPoints("10.10.10.1", "10.10.10.2", "10.10.10.3")
.build();
You should only have one instance of Cluster in your application for each physical cluster, as this class controls the list of contact points ...
Read now
Unlock full access