InterviewSolution
| 1. |
How to configure checkpointing? |
|
Answer» Checkpointing can be enabled by setting a directory in a fault-tolerant, reliable file system like HDFS, S3, etc, to which the checkpoint information will be saved. This is done by using streamingContext.checkpoint(checkpointDirectory). This will allow you to use the aforementioned stateful transformations. Additionally, if you want to make the application RECOVER from driver failures, you should use checkpointing functionality in your streaming application to have the FOLLOWING behavior:
If the checkpointDirectory exists, then the context will be recreated from the checkpoint data. If the directory does not exist (i.e., RUNNING for the first time), then the function createStreamingContext will be called to create a new context and set up the DStreams. |
|