pyflink.datastream.stream_execution_environment.StreamExecutionEnvironment.enable_checkpointing#
- StreamExecutionEnvironment.enable_checkpointing(interval: int, mode: Optional[pyflink.datastream.checkpointing_mode.CheckpointingMode] = None) pyflink.datastream.stream_execution_environment.StreamExecutionEnvironment [source]#
Enables checkpointing for the streaming job. The distributed state of the streaming dataflow will be periodically snapshotted. In case of a failure, the streaming dataflow will be restarted from the latest completed checkpoint.
The job draws checkpoints periodically, in the given interval. The system uses the given
CheckpointingMode
for the checkpointing (“exactly once” vs “at least once”). The state will be stored in the configured state backend.Note
Checkpointing iterative streaming dataflows in not properly supported at the moment. For that reason, iterative jobs will not be started if used with enabled checkpointing.
Example:
>>> env.enable_checkpointing(300000, CheckpointingMode.AT_LEAST_ONCE)
- Parameters
interval – Time interval between state checkpoints in milliseconds.
mode – The checkpointing mode, selecting between “exactly once” and “at least once” guaranteed.
- Returns
This object.