use of com.datastax.oss.driver.api.core.metadata.schema.KeyspaceMetadata in project zipkin by openzipkin.
the class ITEnsureSchema method upgradesOldSchema_autocomplete.
@Test
void upgradesOldSchema_autocomplete() {
Schema.applyCqlFile(storage.keyspace, session(), "/zipkin2-schema.cql");
Schema.applyCqlFile(storage.keyspace, session(), "/zipkin2-schema-indexes-original.cql");
Schema.ensureExists(storage.keyspace, true, session());
KeyspaceMetadata metadata = session().getMetadata().getKeyspace(storage.keyspace).get();
assertThat(Schema.hasUpgrade1_autocompleteTags(metadata)).isTrue();
}
use of com.datastax.oss.driver.api.core.metadata.schema.KeyspaceMetadata in project zipkin by openzipkin.
the class ITEnsureSchema method installsTablesWhenMissing.
@Test
void installsTablesWhenMissing() {
session().execute("CREATE KEYSPACE " + storage.keyspace + " WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'};");
Schema.ensureExists(storage.keyspace, false, session());
KeyspaceMetadata metadata = session().getMetadata().getKeyspace(storage.keyspace).get();
assertThat(metadata.getTable(TABLE_SPAN)).isNotNull();
assertThat(metadata.getTable(TABLE_DEPENDENCY)).isNotNull();
for (String searchTable : SEARCH_TABLES) {
assertThat(metadata.getTable(searchTable)).withFailMessage("Expected to not find " + searchTable).isEmpty();
}
}
use of com.datastax.oss.driver.api.core.metadata.schema.KeyspaceMetadata in project zipkin by openzipkin.
the class ITEnsureSchema method upgradesOldSchema_remoteService.
@Test
void upgradesOldSchema_remoteService() {
Schema.applyCqlFile(storage.keyspace, session(), "/zipkin2-schema.cql");
Schema.applyCqlFile(storage.keyspace, session(), "/zipkin2-schema-indexes-original.cql");
Schema.applyCqlFile(storage.keyspace, session(), "/zipkin2-schema-upgrade-1.cql");
Schema.ensureExists(storage.keyspace, true, session());
KeyspaceMetadata metadata = session().getMetadata().getKeyspace(storage.keyspace).get();
assertThat(Schema.hasUpgrade2_remoteService(metadata)).isTrue();
}
use of com.datastax.oss.driver.api.core.metadata.schema.KeyspaceMetadata in project zipkin by openzipkin.
the class ITEnsureSchema method installsKeyspaceWhenMissing.
@Test
void installsKeyspaceWhenMissing() {
Schema.ensureExists(storage.keyspace, false, session());
KeyspaceMetadata metadata = session().getMetadata().getKeyspace(storage.keyspace).get();
assertThat(metadata).isNotNull();
}
use of com.datastax.oss.driver.api.core.metadata.schema.KeyspaceMetadata in project zipkin by openzipkin.
the class ITEnsureSchema method installsSearchTablesWhenMissing.
@Test
void installsSearchTablesWhenMissing() {
session().execute("CREATE KEYSPACE " + storage.keyspace + " WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'};");
Schema.ensureExists(storage.keyspace, true, session());
KeyspaceMetadata metadata = session().getMetadata().getKeyspace(storage.keyspace).get();
for (String searchTable : SEARCH_TABLES) {
assertThat(metadata.getTable(searchTable)).withFailMessage("Expected to find " + searchTable).isPresent();
}
}
Aggregations