Class TaskInfo


  • @Internal
    public class TaskInfo
    extends Object
    Encapsulates task-specific information: name, index of subtask, parallelism and attempt number.
    • Constructor Detail

      • TaskInfo

        public TaskInfo​(String taskName,
                        int maxNumberOfParallelSubtasks,
                        int indexOfSubtask,
                        int numberOfParallelSubtasks,
                        int attemptNumber)
      • TaskInfo

        public TaskInfo​(String taskName,
                        int maxNumberOfParallelSubtasks,
                        int indexOfSubtask,
                        int numberOfParallelSubtasks,
                        int attemptNumber,
                        String allocationIDAsString)
    • Method Detail

      • getTaskName

        public String getTaskName()
        Returns the name of the task
        Returns:
        The name of the task
      • getMaxNumberOfParallelSubtasks

        public int getMaxNumberOfParallelSubtasks()
        Gets the max parallelism aka the max number of subtasks.
      • getIndexOfThisSubtask

        public int getIndexOfThisSubtask()
        Gets the number of this parallel subtask. The numbering starts from 0 and goes up to parallelism-1 (parallelism as returned by getNumberOfParallelSubtasks()).
        Returns:
        The index of the parallel subtask.
      • getNumberOfParallelSubtasks

        public int getNumberOfParallelSubtasks()
        Gets the parallelism with which the parallel task runs.
        Returns:
        The parallelism with which the parallel task runs.
      • getAttemptNumber

        public int getAttemptNumber()
        Gets the attempt number of this parallel subtask. First attempt is numbered 0. The attempt number corresponds to the number of times this task has been restarted(after failure/cancellation) since the job was initially started.
        Returns:
        Attempt number of the subtask.
      • getAllocationIDAsString

        public String getAllocationIDAsString()
        Returns the allocation id for where this task is executed.
        Returns:
        the allocation id for where this task is executed.