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);
KeyspaceDefinition keyspaceDef = cluster.describeKeyspace(cassandraKeyspace);
if (keyspaceDef == null) {
log.warn("Keyspace \" {} \" does not exist, creating it!", cassandraKeyspace);
keyspaceDef = new ThriftKsDef(cassandraKeyspace);
cluster.addKeyspace(keyspaceDef, true);
addColumnFamily(cluster, USER_CF, 0);
addColumnFamily(cluster, FRIENDS_CF, 0);
addColumnFamily(cluster, FOLLOWERS_CF, 0);
addColumnFamily(cluster, STATUS_CF, 0);