@Test public void testCompleteAsync() throws Exception { BatchUpdateGroup group = new BatchUpdateGroup(getSession(), BatchStatement.Type.UNLOGGED, Executors.newSingleThreadExecutor()); group.addUpdate(QueryBuilder.insertInto("foo").value("bar", "baz")); getSession().execute(SchemaBuilder.createTable("foo").addPartitionKey("bar", DataType.varchar())); group.completeAsync().get(); assertEquals(1, getSession().execute("select bar from foo").all().size()); }
@Override public ListenableFuture<Void> completeAsync() { return Futures.transform(session.executeAsync(batchStatement), (Function<ResultSet, Void>) input -> null, executor); }
BatchUpdateGroup implements UpdateGroup { @Override public ListenableFuture<Void> completeAsync() { return Futures.transform(session.executeAsync(batchStatement), (Function<ResultSet, Void>) input -> null, executor); } }
BatchUpdateGroup implements UpdateGroup { @Override public ListenableFuture<Void> completeAsync() { return Futures.transform(session.executeAsync(batchStatement), (Function<ResultSet, Void>) input -> null, executor); } BatchUpdateGroup(Session session, Executor executor);  BatchUpdateGroup(Session session, BatchStatement batchStatement, Executor executor);  BatchUpdateGroup(Session session, BatchStatement.Type batchType, Executor executor); }
BatchUpdateGroup implements UpdateGroup { @Override public ListenableFuture<Void> completeAsync() { return Futures.transform(session.executeAsync(batchStatement), (Function<ResultSet, Void>) input -> null, executor); } BatchUpdateGroup(Session session, Executor executor);  BatchUpdateGroup(Session session, BatchStatement batchStatement, Executor executor);  BatchUpdateGroup(Session session, BatchStatement.Type batchType, Executor executor); void addUpdate(Statement statement); @Override void complete(); @Override ListenableFuture<Void> completeAsync(); BatchStatement getBatchStatement(); }
BatchUpdateGroup implements UpdateGroup { @Override public ListenableFuture<Void> completeAsync() { return Futures.transform(session.executeAsync(batchStatement), (Function<ResultSet, Void>) input -> null, executor); } BatchUpdateGroup(Session session, Executor executor);  BatchUpdateGroup(Session session, BatchStatement batchStatement, Executor executor);  BatchUpdateGroup(Session session, BatchStatement.Type batchType, Executor executor); void addUpdate(Statement statement); @Override void complete(); @Override ListenableFuture<Void> completeAsync(); BatchStatement getBatchStatement();  }