Package org.apache.flink.api.common
Interface TaskInfo
-
- All Known Implementing Classes:
TaskInfoImpl
@PublicEvolving public interface TaskInfoTheTaskInforepresents the meta information of current task.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetAllocationIDAsString()Returns the allocation id for where this task is executed.intgetAttemptNumber()Gets the attempt number of this parallel subtask.intgetIndexOfThisSubtask()Gets the number of this parallel subtask.intgetMaxNumberOfParallelSubtasks()Gets the max parallelism aka the max number of subtasks.intgetNumberOfParallelSubtasks()Gets the parallelism with which the parallel task runs.StringgetTaskName()Gets the task name.StringgetTaskNameWithSubtasks()Returns the name of the task, appended with the subtask indicator, such as "MyTask (3/6)#1", where 3 would be (getIndexOfThisSubtask()+ 1), and 6 would begetNumberOfParallelSubtasks(), and 1 would begetAttemptNumber().
-
-
-
Method Detail
-
getTaskName
String getTaskName()
Gets the task name.- Returns:
- The task name.
-
getMaxNumberOfParallelSubtasks
int getMaxNumberOfParallelSubtasks()
Gets the max parallelism aka the max number of subtasks.- Returns:
- The max parallelism.
-
getIndexOfThisSubtask
int getIndexOfThisSubtask()
Gets the number of this parallel subtask. The numbering starts from 0 and goes up to parallelism-1 (parallelism as returned bygetNumberOfParallelSubtasks()).- Returns:
- The index of the parallel subtask.
-
getNumberOfParallelSubtasks
int getNumberOfParallelSubtasks()
Gets the parallelism with which the parallel task runs.- Returns:
- The parallelism with which the parallel task runs.
-
getAttemptNumber
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:
- The attempt number of the subtask.
-
getTaskNameWithSubtasks
String getTaskNameWithSubtasks()
Returns the name of the task, appended with the subtask indicator, such as "MyTask (3/6)#1", where 3 would be (getIndexOfThisSubtask()+ 1), and 6 would begetNumberOfParallelSubtasks(), and 1 would begetAttemptNumber().- Returns:
- The name of the task, with subtask indicator.
-
getAllocationIDAsString
String getAllocationIDAsString()
Returns the allocation id for where this task is executed.- Returns:
- The allocation id for where this task is executed.
-
-