poolConfig.setSeeds(StringUtils.join(endpoints, ":" + port + ","));
poolConfig.setLatencyScoreStrategy(latencyScoreStrategy);
logger.info("ConnectionPoolConfiguration: " + poolConfig.toString());
ConnectionPoolMonitor connectionPoolMonitor = new CountingConnectionPoolMonitor();
// set this as field for logging purpose only.
Builder builder = new AstyanaxContext.Builder();
builder.forCluster(getClusterName());
builder.forKeyspace(getKeyspaceName());
builder.withAstyanaxConfiguration(configuration);
builder.withConnectionPoolConfiguration(poolConfig);
builder.withConnectionPoolMonitor(connectionPoolMonitor);
builder.withConnectionPoolMonitor(new CountingConnectionPoolMonitor());
context = builder.buildKeyspace(ThriftFamilyFactory.getInstance());
context.start();
keyspace = context.getEntity();
return keyspace;