@Override
public void handleEvents(List<Event> inputEvents) throws Exception {
for (Event event : inputEvents) {
if (event instanceof DataMovementEvent) {
DataMovementEvent dmEvent = (DataMovementEvent) event;
numCompletedInputs++;
LOG.info("Received DataMovement event sourceId : " + dmEvent.getSourceIndex() +
" targetId: " + dmEvent.getTargetIndex() +
" version: " + dmEvent.getVersion() +
" numInputs: " + numInputs +
" numCompletedInputs: " + numCompletedInputs);
this.completedInputVersion[dmEvent.getTargetIndex()] = dmEvent.getVersion();
this.inputValues[dmEvent.getTargetIndex()] =
ByteBuffer.wrap(dmEvent.getUserPayload()).getInt();
} else if (event instanceof InputFailedEvent) {
InputFailedEvent ifEvent = (InputFailedEvent) event;
numCompletedInputs--;
LOG.info("Received InputFailed event sourceId : " + ifEvent.getSourceIndex() +
" targetId: " + ifEvent.getTargetIndex() +