@Override public void notifyCheckpointComplete(final long checkpointID) { final AbstractInvokable invokable = this.invokable; if (executionState == ExecutionState.RUNNING && invokable != null) { Runnable runnable = new Runnable() { @Override public void run() { try { invokable.notifyCheckpointComplete(checkpointID); taskStateManager.notifyCheckpointComplete(checkpointID); } catch (Throwable t) { if (getExecutionState() == ExecutionState.RUNNING) { // fail task if checkpoint confirmation failed. failExternally(new RuntimeException( "Error while confirming checkpoint", t)); } } } }; executeAsyncCallRunnable(runnable, "Checkpoint Confirmation for " + taskNameWithSubtask); } else { LOG.debug("Ignoring checkpoint commit notification for non-running task {}.", taskNameWithSubtask); } }
@Override public void notifyCheckpointComplete(final long checkpointID) { final AbstractInvokable invokable = this.invokable; if (executionState == ExecutionState.RUNNING && invokable != null) { Runnable runnable = new Runnable() { @Override public void run() { try { invokable.notifyCheckpointComplete(checkpointID); taskStateManager.notifyCheckpointComplete(checkpointID); } catch (Throwable t) { if (getExecutionState() == ExecutionState.RUNNING) { // fail task if checkpoint confirmation failed. failExternally(new RuntimeException( "Error while confirming checkpoint", t)); } } } }; executeAsyncCallRunnable(runnable, "Checkpoint Confirmation for " + taskNameWithSubtask); } else { LOG.debug("Ignoring checkpoint commit notification for non-running task {}.", taskNameWithSubtask); } }
@Override public void notifyCheckpointComplete(final long checkpointID) { final AbstractInvokable invokable = this.invokable; if (executionState == ExecutionState.RUNNING && invokable != null) { Runnable runnable = new Runnable() { @Override public void run() { try { invokable.notifyCheckpointComplete(checkpointID); taskStateManager.notifyCheckpointComplete(checkpointID); } catch (Throwable t) { if (getExecutionState() == ExecutionState.RUNNING) { // fail task if checkpoint confirmation failed. failExternally(new RuntimeException( "Error while confirming checkpoint", t)); } } } }; executeAsyncCallRunnable(runnable, "Checkpoint Confirmation for " + taskNameWithSubtask); } else { LOG.debug("Ignoring checkpoint commit notification for non-running task {}.", taskNameWithSubtask); } }
executeAsyncCallRunnable(runnable, "Checkpoint Confirmation for " + taskName);
/** * Stops the executing task by calling {@link StoppableTask#stop()}. * <p> * This method never blocks. * </p> * * @throws UnsupportedOperationException * if the {@link AbstractInvokable} does not implement {@link StoppableTask} */ public void stopExecution() throws UnsupportedOperationException { LOG.info("Attempting to stop task {} ({}).", taskNameWithSubtask, executionId); if (invokable instanceof StoppableTask) { Runnable runnable = new Runnable() { @Override public void run() { try { ((StoppableTask)invokable).stop(); } catch(RuntimeException e) { LOG.error("Stopping task {} ({}) failed.", taskNameWithSubtask, executionId, e); taskManagerActions.failTask(executionId, e); } } }; executeAsyncCallRunnable(runnable, String.format("Stopping source task %s (%s).", taskNameWithSubtask, executionId)); } else { throw new UnsupportedOperationException(String.format("Stopping not supported by task %s (%s).", taskNameWithSubtask, executionId)); } }
executeAsyncCallRunnable(runnable, String.format("Stopping source task %s (%s).", taskNameWithSubtask, executionId)); } else { throw new UnsupportedOperationException(String.format("Stopping not supported by task %s (%s).", taskNameWithSubtask, executionId));
executeAsyncCallRunnable(runnable, String.format("Stopping source task %s (%s).", taskNameWithSubtask, executionId)); } else { throw new UnsupportedOperationException(String.format("Stopping not supported by task %s (%s).", taskNameWithSubtask, executionId));
executeAsyncCallRunnable(runnable, String.format("Stopping source task %s (%s).", taskNameWithSubtask, executionId)); } else { throw new UnsupportedOperationException(String.format("Stopping not supported by task %s (%s).", taskNameWithSubtask, executionId));
executeAsyncCallRunnable(runnable, String.format("Checkpoint Trigger for %s (%s).", taskNameWithSubtask, executionId));
executeAsyncCallRunnable(runnable, String.format("Checkpoint Trigger for %s (%s).", taskNameWithSubtask, executionId));
executeAsyncCallRunnable(runnable, String.format("Checkpoint Trigger for %s (%s).", taskNameWithSubtask, executionId));
executeAsyncCallRunnable(runnable, String.format("Checkpoint Trigger for %s (%s).", taskNameWithSubtask, executionId));