if(this.useCqlBatching && allPreparable) {
cqlExecutor.executeBatch(statementIterators);
} else {
List<StatementIteratorConsumer> consumers = Lists.newArrayList();
for(CQLStatementIterator statementIterator : statementIterators) {
StatementIteratorConsumer consumer = new StatementIteratorConsumer((BoundedCQLStatementIterator) statementIterator, cqlExecutor, batchTimeout);
consumer.start();
consumers.add(consumer);
}
for(StatementIteratorConsumer consumer : consumers) {
consumer.join();
}
}
logger.debug("Async execution took {}us", (System.nanoTime() - start) / 1000);
} else {
logger.debug("Executing statements sync");