Package org.apache.flink.api.common
Class TaskInfoImpl
- java.lang.Object
-
- org.apache.flink.api.common.TaskInfoImpl
-
-
Constructor Summary
Constructors Constructor Description TaskInfoImpl(String taskName, int maxNumberOfParallelSubtasks, int indexOfSubtask, int numberOfParallelSubtasks, int attemptNumber)TaskInfoImpl(String taskName, int maxNumberOfParallelSubtasks, int indexOfSubtask, int numberOfParallelSubtasks, int attemptNumber, String allocationIDAsString)
-
Method Summary
All Methods Instance Methods Concrete 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 (TaskInfo.getIndexOfThisSubtask()+ 1), and 6 would beTaskInfo.getNumberOfParallelSubtasks(), and 1 would beTaskInfo.getAttemptNumber().
-
-
-
Constructor Detail
-
TaskInfoImpl
public TaskInfoImpl(String taskName, int maxNumberOfParallelSubtasks, int indexOfSubtask, int numberOfParallelSubtasks, int attemptNumber)
-
-
Method Detail
-
getTaskName
public String getTaskName()
Description copied from interface:TaskInfoGets the task name.- Specified by:
getTaskNamein interfaceTaskInfo- Returns:
- The task name.
-
getMaxNumberOfParallelSubtasks
public int getMaxNumberOfParallelSubtasks()
Description copied from interface:TaskInfoGets the max parallelism aka the max number of subtasks.- Specified by:
getMaxNumberOfParallelSubtasksin interfaceTaskInfo- Returns:
- The max parallelism.
-
getIndexOfThisSubtask
public int getIndexOfThisSubtask()
Description copied from interface:TaskInfoGets the number of this parallel subtask. The numbering starts from 0 and goes up to parallelism-1 (parallelism as returned byTaskInfo.getNumberOfParallelSubtasks()).- Specified by:
getIndexOfThisSubtaskin interfaceTaskInfo- Returns:
- The index of the parallel subtask.
-
getNumberOfParallelSubtasks
public int getNumberOfParallelSubtasks()
Description copied from interface:TaskInfoGets the parallelism with which the parallel task runs.- Specified by:
getNumberOfParallelSubtasksin interfaceTaskInfo- Returns:
- The parallelism with which the parallel task runs.
-
getAttemptNumber
public int getAttemptNumber()
Description copied from interface:TaskInfoGets 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.- Specified by:
getAttemptNumberin interfaceTaskInfo- Returns:
- The attempt number of the subtask.
-
getTaskNameWithSubtasks
public String getTaskNameWithSubtasks()
Description copied from interface:TaskInfoReturns the name of the task, appended with the subtask indicator, such as "MyTask (3/6)#1", where 3 would be (TaskInfo.getIndexOfThisSubtask()+ 1), and 6 would beTaskInfo.getNumberOfParallelSubtasks(), and 1 would beTaskInfo.getAttemptNumber().- Specified by:
getTaskNameWithSubtasksin interfaceTaskInfo- Returns:
- The name of the task, with subtask indicator.
-
getAllocationIDAsString
public String getAllocationIDAsString()
Description copied from interface:TaskInfoReturns the allocation id for where this task is executed.- Specified by:
getAllocationIDAsStringin interfaceTaskInfo- Returns:
- The allocation id for where this task is executed.
-
-