@Override public void truncateTables(final Set<TableReference> tableRefs) throws InsufficientConsistencyException { if (tableRefs.isEmpty()) { return; } run((Function<DSLContext, Void>) ctx -> { for (TableReference tableRef : tableRefs) { ctx.truncate(tableName(tableRef)).execute(); } return null; }); }
/** Visible for testing */ void clear() { try (Connection conn = datasource.getConnection()) { context.get(conn).truncate(ZIPKIN_SPANS).execute(); context.get(conn).truncate(ZIPKIN_ANNOTATIONS).execute(); context.get(conn).truncate(ZIPKIN_DEPENDENCIES).execute(); } catch (SQLException | RuntimeException e) { throw new AssertionError(e); } } }