Class AbstractInvokable

    • Constructor Detail

      • AbstractInvokable

        public AbstractInvokable​(Environment environment)
        Create an Invokable task and set its environment.
        Parameters:
        environment - The environment assigned to this invokable.
    • Method Detail

      • cancel

        public void cancel()
                    throws Exception
        Description copied from interface: TaskInvokable
        This method is called when a task is canceled either as a result of a user abort or an execution failure. It can be overwritten to respond to shut down the user code properly.
        Specified by:
        cancel in interface TaskInvokable
        Throws:
        Exception
      • maybeInterruptOnCancel

        public void maybeInterruptOnCancel​(Thread toInterrupt,
                                           @Nullable
                                           String taskName,
                                           @Nullable
                                           Long timeout)
        Description copied from interface: TaskInvokable
        Checks whether the task should be interrupted during cancellation and if so, execute the specified Runnable interruptAction.
        Specified by:
        maybeInterruptOnCancel in interface TaskInvokable
        taskName - optional taskName to log stack trace
        timeout - optional timeout to log stack trace
      • getEnvironment

        public final Environment getEnvironment()
        Returns the environment of this task.
        Returns:
        The environment of this task.
      • getUserCodeClassLoader

        public final ClassLoader getUserCodeClassLoader()
        Returns the user code class loader of this invokable.
        Returns:
        user code class loader of this invokable.
      • getCurrentNumberOfSubtasks

        public int getCurrentNumberOfSubtasks()
        Returns the current number of subtasks the respective task is split into.
        Returns:
        the current number of subtasks the respective task is split into
      • getIndexInSubtaskGroup

        public int getIndexInSubtaskGroup()
        Returns the index of this subtask in the subtask group.
        Returns:
        the index of this subtask in the subtask group
      • getTaskConfiguration

        public final Configuration getTaskConfiguration()
        Returns the task configuration object which was attached to the original JobVertex.
        Returns:
        the task configuration object which was attached to the original JobVertex
      • getJobConfiguration

        public Configuration getJobConfiguration()
        Returns the job configuration object which was attached to the original JobGraph.
        Returns:
        the job configuration object which was attached to the original JobGraph
      • getExecutionConfig

        public ExecutionConfig getExecutionConfig()
        Returns the global ExecutionConfig.
      • triggerCheckpointOnBarrier

        public void triggerCheckpointOnBarrier​(CheckpointMetaData checkpointMetaData,
                                               CheckpointOptions checkpointOptions,
                                               CheckpointMetricsBuilder checkpointMetrics)
                                        throws IOException
        Description copied from interface: CheckpointableTask
        This method is called when a checkpoint is triggered as a result of receiving checkpoint barriers on all input streams.
        Specified by:
        triggerCheckpointOnBarrier in interface CheckpointableTask
        Parameters:
        checkpointMetaData - Meta data for about this checkpoint
        checkpointOptions - Options for performing this checkpoint
        checkpointMetrics - Metrics about this checkpoint
        Throws:
        IOException - Exceptions thrown as the result of triggering a checkpoint are forwarded.
      • notifyCheckpointCompleteAsync

        public Future<Void> notifyCheckpointCompleteAsync​(long checkpointId)
        Description copied from interface: CheckpointableTask
        Invoked when a checkpoint has been completed, i.e., when the checkpoint coordinator has received the notification from all participating tasks.
        Specified by:
        notifyCheckpointCompleteAsync in interface CheckpointableTask
        Parameters:
        checkpointId - The ID of the checkpoint that is complete.
        Returns:
        future that completes when the notification has been processed by the task.
      • notifyCheckpointAbortAsync

        public Future<Void> notifyCheckpointAbortAsync​(long checkpointId,
                                                       long latestCompletedCheckpointId)
        Description copied from interface: CheckpointableTask
        Invoked when a checkpoint has been aborted, i.e., when the checkpoint coordinator has received a decline message from one task and try to abort the targeted checkpoint by notification.
        Specified by:
        notifyCheckpointAbortAsync in interface CheckpointableTask
        Parameters:
        checkpointId - The ID of the checkpoint that is aborted.
        latestCompletedCheckpointId - The ID of the latest completed checkpoint.
        Returns:
        future that completes when the notification has been processed by the task.
      • notifyCheckpointSubsumedAsync

        public Future<Void> notifyCheckpointSubsumedAsync​(long checkpointId)
        Description copied from interface: CheckpointableTask
        Invoked when a checkpoint has been subsumed, i.e., when the checkpoint coordinator has confirmed one checkpoint has been finished, and try to remove the first previous checkpoint.
        Specified by:
        notifyCheckpointSubsumedAsync in interface CheckpointableTask
        Parameters:
        checkpointId - The ID of the checkpoint that is subsumed.
        Returns:
        future that completes when the notification has been processed by the task.