transport.open();
cassandraClient = new Cassandra.Client(new TBinaryProtocol.Factory().getProtocol(transport));
monitor.incConnectionCreated(getHost());
AuthenticationCredentials credentials = cpConfig.getAuthenticationCredentials();
if (credentials != null) {
Map<String, String> thriftCredentials = Maps.newHashMapWithExpectedSize(2);
thriftCredentials.put("username", credentials.getUsername());
thriftCredentials.put("password", credentials.getPassword());
cassandraClient.login(new AuthenticationRequest(thriftCredentials));
}
}
catch (Exception e) {
pool.addLatencySample(TimeUnit.NANOSECONDS.convert(cpConfig.getSocketTimeout(), TimeUnit.MILLISECONDS), System.nanoTime());