Skip to content

Instantly share code, notes, and snippets.

@chbatey
Created February 9, 2015 13:39
Show Gist options
  • Select an option

  • Save chbatey/e256ceca0815215c31b9 to your computer and use it in GitHub Desktop.

Select an option

Save chbatey/e256ceca0815215c31b9 to your computer and use it in GitHub Desktop.
Versin with batches
public void storeEvents(ConsistencyLevel consistencyLevel, CustomerEvent... events) {
BatchStatement batchStatement = new BatchStatement(BatchStatement.Type.UNLOGGED);
batchStatement.enableTracing();
for (CustomerEvent event : events) {
batchStatement.add(createBoundStatement(consistencyLevel, event));
}
ResultSet execute = session.execute(batchStatement);
logTraceInfo(execute.getExecutionInfo());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment