Created
February 9, 2015 13:39
-
-
Save chbatey/e256ceca0815215c31b9 to your computer and use it in GitHub Desktop.
Versin with batches
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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