public class FailureMapper<T> extends RichMapFunction<T,T> implements CheckpointListener
The total times to simulate a failure across multiple execution attempts of the operator can also be configured. Note that this also takes into account failures that were not triggered by this mapper, e.g. TaskManager failures.
Constructor and Description |
---|
FailureMapper(long numProcessedRecordsFailureThreshold,
long numCompleteCheckpointsFailureThreshold,
int maxNumFailures) |
Modifier and Type | Method and Description |
---|---|
T |
map(T value)
The mapping method.
|
void |
notifyCheckpointAborted(long checkpointId)
This method is called as a notification once a distributed checkpoint has been aborted.
|
void |
notifyCheckpointComplete(long checkpointId)
This method is called as a notification once a distributed checkpoint has been completed.
|
close, getIterationRuntimeContext, getRuntimeContext, open, setRuntimeContext
public FailureMapper(long numProcessedRecordsFailureThreshold, long numCompleteCheckpointsFailureThreshold, int maxNumFailures)
public T map(T value) throws Exception
MapFunction
map
in interface MapFunction<T,T>
map
in class RichMapFunction<T,T>
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 notifyCheckpointComplete(long checkpointId) throws Exception
CheckpointListener
Note that any exception during this method will not cause the checkpoint to fail any more.
notifyCheckpointComplete
in interface CheckpointListener
checkpointId
- The ID of the checkpoint that has been completed.Exception
- This method can propagate exceptions, which leads to a failure/recovery for
the task. Not that this will NOT lead to the checkpoint being revoked.public void notifyCheckpointAborted(long checkpointId)
CheckpointListener
notifyCheckpointAborted
in interface CheckpointListener
checkpointId
- The ID of the checkpoint that has been aborted.Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.