static Set<String> sanityCheckDatacenters(CassandraClient client, CassandraKeyValueServiceConfig config) throws TException { createSimpleRfTestKeyspaceIfNotExists(client); Multimap<String, String> datacenterToRack = HashMultimap.create(); Set<String> hosts = Sets.newHashSet(); for (TokenRange tokenRange : client.describe_ring(CassandraConstants.SIMPLE_RF_TEST_KEYSPACE)) { for (EndpointDetails details : tokenRange.getEndpoint_details()) { datacenterToRack.put(details.datacenter, details.rack); hosts.add(details.host); } } if (clusterHasExactlyOneDatacenter(datacenterToRack) && config.replicationFactor() > 1) { checkNodeTopologyIsSet(config, datacenterToRack); checkMoreRacksThanRfOrFewerHostsThanRf(config, hosts, datacenterToRack); } return datacenterToRack.keySet(); }
static Set<String> sanityCheckDatacenters(CassandraClient client, CassandraKeyValueServiceConfig config) throws TException { createSimpleRfTestKeyspaceIfNotExists(client); Multimap<String, String> datacenterToRack = HashMultimap.create(); Set<String> hosts = Sets.newHashSet(); for (TokenRange tokenRange : client.describe_ring(CassandraConstants.SIMPLE_RF_TEST_KEYSPACE)) { for (EndpointDetails details : tokenRange.getEndpoint_details()) { datacenterToRack.put(details.datacenter, details.rack); hosts.add(details.host); } } if (clusterHasExactlyOneDatacenter(datacenterToRack) && config.replicationFactor() > 1) { checkNodeTopologyIsSet(config, datacenterToRack); checkMoreRacksThanRfOrFewerHostsThanRf(config, hosts, datacenterToRack); } return datacenterToRack.keySet(); }