Source:
<code>public Optional<CqlClient> constructClient( TaggedMetricRegistry taggedMetricRegistry, CassandraKeyValueServiceConfig config, boolean initializeAsync) { return config.servers().accept(new CassandraServersConfigs.Visitor<Optional<CqlClient>>() { @Override public Optional<CqlClient> visit(CassandraServersConfigs.DefaultConfig defaultConfig) { return Optional.empty(); } @Override public Optional<CqlClient> visit(CassandraServersConfigs.CqlCapableConfig cqlCapableConfig) { if (!cqlCapableConfig.validateHosts()) { log.warn("Your CQL capable config is wrong, the hosts for CQL and Thrift are not the same, using " <START> + "async API will result in an exception."); <END> return Optional.empty(); } Set<InetSocketAddress> servers = cqlCapableConfig.cqlHosts(); Cluster.Builder clusterBuilder = cqlClusterBuilderFactory.get() .addContactPointsWithPorts(servers) .withCredentials(config.credentials().username(), config.credentials().password()) .withCompression(ProtocolOptions.Compression.LZ4) .withRetryPolicy(DefaultRetryPolicy.INSTANCE) .withoutJMXReporting() .withProtocolVersion(ProtocolVersion.V3) .withThreadingOptions(new ThreadingOptions()); clusterBuilder = withSslOptions(clusterBuilder, config); clusterBuilder = withPoolingOptions(clusterBuilder, config); clusterBuilder = withQueryOptions(clusterBuilder, config); clusterBuilder = withLoadBalancingPolicy(clusterBuilder, config, servers); clusterBuilder = withSocketOptions(clusterBuilder, config); return Optional.of(CqlClientImpl.create( taggedMetricRegistry, clusterBuilder.build(), cqlCapableConfig.tuning(), initializeAsync)); } }); }</code><technical_language>nit: This log message is longer accurate change (we async API result in undefined behaviour: I officially sync API, I necessarily need guarantee that)</technical_language>

Target:
public Optional<CqlClient> constructClient( TaggedMetricRegistry taggedMetricRegistry, CassandraKeyValueServiceConfig config, boolean initializeAsync) { return config.servers().accept(new CassandraServersConfigs.Visitor<Optional<CqlClient>>() { @Override public Optional<CqlClient> visit(CassandraServersConfigs.DefaultConfig defaultConfig) { return Optional.empty(); } @Override public Optional<CqlClient> visit(CassandraServersConfigs.CqlCapableConfig cqlCapableConfig) { if (!cqlCapableConfig.validateHosts()) { log.warn("Your CQL capable config is wrong, the hosts for CQL and Thrift are not the same, using " + "async API will be falling back to synchronous implementations."); return Optional.empty(); } Set<InetSocketAddress> servers = cqlCapableConfig.cqlHosts(); Cluster.Builder clusterBuilder = cqlClusterBuilderFactory.get() .addContactPointsWithPorts(servers) .withCredentials(config.credentials().username(), config.credentials().password()) .withCompression(ProtocolOptions.Compression.LZ4) .withRetryPolicy(DefaultRetryPolicy.INSTANCE) .withoutJMXReporting() .withProtocolVersion(ProtocolVersion.V3) .withThreadingOptions(new ThreadingOptions()); clusterBuilder = withSslOptions(clusterBuilder, config); clusterBuilder = withPoolingOptions(clusterBuilder, config); clusterBuilder = withQueryOptions(clusterBuilder, config); clusterBuilder = withLoadBalancingPolicy(clusterBuilder, config, servers); clusterBuilder = withSocketOptions(clusterBuilder, config); return Optional.of(CqlClientImpl.create( taggedMetricRegistry, clusterBuilder.build(), cqlCapableConfig.tuning(), initializeAsync)); } }); }