Package org.apache.flink.api.common.io
Class FirstAttemptInitializationContext
- java.lang.Object
-
- org.apache.flink.api.common.io.FirstAttemptInitializationContext
-
- All Implemented Interfaces:
OutputFormat.InitializationContext
@PublicEvolving public class FirstAttemptInitializationContext extends Object implements OutputFormat.InitializationContext
SpecialOutputFormat.InitializationContext, whose attempt number always zero.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetAttemptNumber()Gets the attempt number of this parallel subtask.intgetNumTasks()Gets the parallelism with which the parallel task runs.intgetTaskNumber()Gets the number of this parallel subtask.static FirstAttemptInitializationContextof(int taskNumber, int numTasks)
-
-
-
Method Detail
-
of
public static FirstAttemptInitializationContext of(int taskNumber, int numTasks)
-
getNumTasks
public int getNumTasks()
Description copied from interface:OutputFormat.InitializationContextGets the parallelism with which the parallel task runs.- Specified by:
getNumTasksin interfaceOutputFormat.InitializationContext- Returns:
- The parallelism with which the parallel task runs.
-
getTaskNumber
public int getTaskNumber()
Description copied from interface:OutputFormat.InitializationContextGets the number of this parallel subtask. The numbering starts from 0 and goes up to parallelism-1 (parallelism as returned byOutputFormat.InitializationContext.getNumTasks()).- Specified by:
getTaskNumberin interfaceOutputFormat.InitializationContext- Returns:
- The index of the parallel subtask.
-
getAttemptNumber
public int getAttemptNumber()
Description copied from interface:OutputFormat.InitializationContextGets the attempt number of this parallel subtask. First attempt is numbered 0.- Specified by:
getAttemptNumberin interfaceOutputFormat.InitializationContext- Returns:
- Attempt number of the subtask.
-
-