Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Cluster cluster = Cluster.builder().addContactPoint("10.17.0.1t").withPort(9042).build();
- final Metadata metadata = cluster.getMetadata();
- System.out.printf("Connected to cluster: %s\n", metadata.getClusterName());
- for (final Host host : metadata.getAllHosts())
- {
- System.out.printf("Datacenter: %s; Host: %s; Rack: %s\n",
- host.getDatacenter(), host.getAddress(), host.getRack());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement