Package org.apache.flink.sql.tests
Class StreamSQLTestProgram.KillMapper
- java.lang.Object
-
- org.apache.flink.sql.tests.StreamSQLTestProgram.KillMapper
-
- All Implemented Interfaces:
Serializable
,Function
,MapFunction<Row,Row>
,ResultTypeQueryable
,CheckpointedFunction
- Enclosing class:
- StreamSQLTestProgram
public static class StreamSQLTestProgram.KillMapper extends Object implements MapFunction<Row,Row>, CheckpointedFunction, ResultTypeQueryable
Kills the first execution attempt of an application when it receives the second record.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description KillMapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TypeInformation
getProducedType()
Gets the data type (as aTypeInformation
) produced by this function or input format.void
initializeState(FunctionInitializationContext context)
This method is called when the parallel function instance is created during distributed execution.Row
map(Row value)
The mapping method.void
snapshotState(FunctionSnapshotContext context)
This method is called when a snapshot for a checkpoint is requested.
-
-
-
Method Detail
-
map
public Row map(Row value)
Description copied from interface:MapFunction
The mapping method. Takes an element from the input data set and transforms it into exactly one element.- Specified by:
map
in interfaceMapFunction<Row,Row>
- Parameters:
value
- The input value.- Returns:
- The transformed value
-
getProducedType
public TypeInformation getProducedType()
Description copied from interface:ResultTypeQueryable
Gets the data type (as aTypeInformation
) produced by this function or input format.- Specified by:
getProducedType
in interfaceResultTypeQueryable
- Returns:
- The data type produced by this function or input format.
-
initializeState
public void initializeState(FunctionInitializationContext context) throws Exception
Description copied from interface:CheckpointedFunction
This method is called when the parallel function instance is created during distributed execution. Functions typically set up their state storing data structures in this method.- Specified by:
initializeState
in interfaceCheckpointedFunction
- Parameters:
context
- the context for initializing the operator- Throws:
Exception
- Thrown, if state could not be created ot restored.
-
snapshotState
public void snapshotState(FunctionSnapshotContext context) throws Exception
Description copied from interface:CheckpointedFunction
This method is called when a snapshot for a checkpoint is requested. This acts as a hook to the function to ensure that all state is exposed by means previously offered throughFunctionInitializationContext
when the Function was initialized, or offered now byFunctionSnapshotContext
itself.- Specified by:
snapshotState
in interfaceCheckpointedFunction
- Parameters:
context
- the context for drawing a snapshot of the operator- Throws:
Exception
- Thrown, if state could not be created ot restored.
-
-