use of com.datastax.oss.driver.api.core.servererrors.InvalidQueryException in project zipkin by openzipkin.
the class CassandraStorageExtension method clear.
void clear(CassandraStorage storage) {
// Clear any key cache
CassandraSpanConsumer spanConsumer = storage.spanConsumer;
if (spanConsumer != null)
spanConsumer.clear();
CqlSession session = storage.session.session;
if (session == null)
session = globalSession;
List<String> toTruncate = new ArrayList<>(SEARCH_TABLES);
toTruncate.add(TABLE_DEPENDENCY);
toTruncate.add(TABLE_SPAN);
for (String table : toTruncate) {
try {
session.execute("TRUNCATE " + storage.keyspace + "." + table);
} catch (InvalidQueryException e) {
assertThat(e).hasMessage("unconfigured table " + table);
}
}
blockWhileInFlight(storage);
}
Aggregations