use of com.datastax.oss.driver.api.core.metadata.schema.KeyspaceMetadata in project zipkin by openzipkin.
the class Schema method readMetadata.
static Metadata readMetadata(CqlSession session, String keyspace) {
KeyspaceMetadata keyspaceMetadata = ensureKeyspaceMetadata(session, keyspace);
Map<String, String> replication = keyspaceMetadata.getReplication();
if ("SimpleStrategy".equals(replication.get("class"))) {
if ("1".equals(replication.get("replication_factor"))) {
LOG.warn("running with RF=1, this is not suitable for production. Optimal is 3+");
}
}
boolean hasAutocompleteTags = hasUpgrade1_autocompleteTags(keyspaceMetadata);
if (!hasAutocompleteTags) {
LOG.warn("schema lacks autocomplete indexing: apply {}, or set CassandraStorage.ensureSchema=true", UPGRADE_1);
}
boolean hasRemoteService = hasUpgrade2_remoteService(keyspaceMetadata);
if (!hasRemoteService) {
LOG.warn("schema lacks remote service indexing: apply {}, or set CassandraStorage.ensureSchema=true", UPGRADE_2);
}
return new Metadata(hasAutocompleteTags, hasRemoteService);
}
Aggregations