log.info("Configuring Cassandra keyspace");
String cassandraHost = env.getProperty("cassandra.host");
String cassandraClusterName = env.getProperty("cassandra.clusterName");
String cassandraKeyspace = env.getProperty("cassandra.keyspace");
CassandraHostConfigurator cassandraHostConfigurator = new CassandraHostConfigurator(cassandraHost);
cassandraHostConfigurator.setMaxActive(100);
if (env.acceptsProfiles(Constants.SPRING_PROFILE_METRICS)) {
log.debug("Cassandra Metrics monitoring enabled");
HOpTimer hOpTimer = new MetricsOpTimer(cassandraClusterName);
cassandraHostConfigurator.setOpTimer(hOpTimer);
}
ThriftCluster cluster = new ThriftCluster(cassandraClusterName, cassandraHostConfigurator);
this.myCluster = cluster; // Keep a pointer to the cluster, as Hector is buggy and can't find it again...
ConfigurableConsistencyLevel consistencyLevelPolicy = new ConfigurableConsistencyLevel();
consistencyLevelPolicy.setDefaultReadConsistencyLevel(HConsistencyLevel.ONE);