void canCommit(final DataTreeCandidate tip) throws ExecutionException, TimeoutException {
Collection<CanCommit> messages = registry.createCanCommitMessages(txId, tip, schema);
Future<Iterable<Object>> canCommitsFuture =
Futures.traverse(messages, new Function<CanCommit, Future<Object>>() {
@Override
public Future<Object> apply(final CanCommit input) {
return Patterns.ask(input.getCohort(), input, timeout).recover(EXCEPTION_TO_MESSAGE,
ExecutionContexts.global());
}
}, ExecutionContexts.global());
changeStateFrom(State.IDLE, State.CAN_COMMIT_SENT);
processResponses(canCommitsFuture, State.CAN_COMMIT_SENT, State.CAN_COMMIT_SUCCESSFUL);
}