Enabling Checkpointing - Amazon Kinesis Data Analytics
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Enabling Checkpointing

You enable checkpointing by using environment settings. For information about checkpointing, see Fault Tolerance in the Kinesis Data Analytics Developer Guide.

Setting the checkpointing interval

The following Scala code example sets your application's checkpoint interval to one minute:

// start a checkpoint every 1 minute stenv.enableCheckpointing(60000)

The following Python code example sets your application's checkpoint interval to one minute:

st_env.get_config().get_configuration().set_string( "execution.checkpointing.interval", "1min" )

Setting the checkpointing type

The following Scala code example sets your application's checkpoint mode to EXACTLY_ONCE (the default):

// set mode to exactly-once (this is the default) stenv.getCheckpointConfig.setCheckpointingMode(CheckpointingMode.EXACTLY_ONCE)

The following Python code example sets your application's checkpoint mode to EXACTLY_ONCE (the default):

st_env.get_config().get_configuration().set_string( "execution.checkpointing.mode", "EXACTLY_ONCE" )