use of org.apache.cassandra.stress.util.JavaDriverClient in project cassandra by apache.
the class SettingsCommand method truncateTables.
protected void truncateTables(StressSettings settings, String ks, String... tables) {
JavaDriverClient client = settings.getJavaDriverClient(false);
assert settings.command.truncate != SettingsCommand.TruncateWhen.NEVER;
for (String table : tables) {
String cql = String.format("TRUNCATE %s.%s", ks, table);
client.execute(cql, org.apache.cassandra.db.ConsistencyLevel.ONE);
}
System.out.println(String.format("Truncated %s.%s. Sleeping %ss for propagation.", ks, Arrays.toString(tables), settings.node.nodes.size()));
Uninterruptibles.sleepUninterruptibly(settings.node.nodes.size(), TimeUnit.SECONDS);
}
Aggregations