Class TestingTaskInfo
- java.lang.Object
-
- org.apache.flink.connector.testutils.source.TestingTaskInfo
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TestingTaskInfo.Builder
Builder forTestingTaskInfo
.
-
Constructor Summary
Constructors Constructor Description TestingTaskInfo(String taskName, int maxNumberOfParallelSubtasks, int indexOfThisSubtask, int numberOfParallelSubtasks, int attemptNumber, String taskNameWithSubtasks, String allocationIDAsString)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAllocationIDAsString()
Returns the allocation id for where this task is executed.int
getAttemptNumber()
Gets the attempt number of this parallel subtask.int
getIndexOfThisSubtask()
Gets the number of this parallel subtask.int
getMaxNumberOfParallelSubtasks()
Gets the max parallelism aka the max number of subtasks.int
getNumberOfParallelSubtasks()
Gets the parallelism with which the parallel task runs.String
getTaskName()
Gets the task name.String
getTaskNameWithSubtasks()
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()
.
-
-
-
Method Detail
-
getTaskName
public String getTaskName()
Description copied from interface:TaskInfo
Gets the task name.- Specified by:
getTaskName
in interfaceTaskInfo
- Returns:
- The task name.
-
getMaxNumberOfParallelSubtasks
public int getMaxNumberOfParallelSubtasks()
Description copied from interface:TaskInfo
Gets the max parallelism aka the max number of subtasks.- Specified by:
getMaxNumberOfParallelSubtasks
in interfaceTaskInfo
- Returns:
- The max parallelism.
-
getIndexOfThisSubtask
public int getIndexOfThisSubtask()
Description copied from interface:TaskInfo
Gets the number of this parallel subtask. The numbering starts from 0 and goes up to parallelism-1 (parallelism as returned byTaskInfo.getNumberOfParallelSubtasks()
).- Specified by:
getIndexOfThisSubtask
in interfaceTaskInfo
- Returns:
- The index of the parallel subtask.
-
getNumberOfParallelSubtasks
public int getNumberOfParallelSubtasks()
Description copied from interface:TaskInfo
Gets the parallelism with which the parallel task runs.- Specified by:
getNumberOfParallelSubtasks
in interfaceTaskInfo
- Returns:
- The parallelism with which the parallel task runs.
-
getAttemptNumber
public int getAttemptNumber()
Description copied from interface:TaskInfo
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.- Specified by:
getAttemptNumber
in interfaceTaskInfo
- Returns:
- The attempt number of the subtask.
-
getTaskNameWithSubtasks
public String getTaskNameWithSubtasks()
Description copied from interface:TaskInfo
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()
.- Specified by:
getTaskNameWithSubtasks
in interfaceTaskInfo
- Returns:
- The name of the task, with subtask indicator.
-
getAllocationIDAsString
public String getAllocationIDAsString()
Description copied from interface:TaskInfo
Returns the allocation id for where this task is executed.- Specified by:
getAllocationIDAsString
in interfaceTaskInfo
- Returns:
- The allocation id for where this task is executed.
-
-