public class ArtificalOperatorStateMapper<IN,OUT> extends RichMapFunction<IN,OUT> implements CheckpointedFunction
RichMapFunctionused to verify checkpointing and restore semantics for various kinds of operator state.
For verifying broadcast state, the each subtask stores as broadcast state a map of (Integer, String) entries, key being the subtask index, and value being a String that corresponds to the subtask index. The total number of subtasks is also stored as broadcast state. On restore, each subtask should be restored with exactly the same broadcast state, with one entry for each subtask in the previous run.
For verifying union state, each subtask of this operator stores its own subtask index as a subset of the whole union state. On restore, each subtask's restored union state should have one entry for each subtask in the previous run.
All input elements to the operator arre simply passed through a user-provided map function and emitted.
|Constructor and Description|
|Modifier and Type||Method and Description|
This method is called when the parallel function instance is created during distributed execution.
The mapping method.
This method is called when a snapshot for a checkpoint is requested.
close, getIterationRuntimeContext, getRuntimeContext, open, setRuntimeContext
value- The input value.
Exception- This method may throw exceptions. Throwing an exception will cause the operation to fail and may trigger recovery.
public void initializeState(FunctionInitializationContext context) throws Exception
public void snapshotState(FunctionSnapshotContext context) throws Exception
FunctionInitializationContextwhen the Function was initialized, or offered now by
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.