如何使用检查点更改 Spark Streaming 应用程序?

How to change Spark Streaming application with checkpointing?

请考虑以下场景:

处理这种情况的最佳做法是什么?我们如何在启用检查点的情况下无缝升级流应用程序?流式应用程序版本控制的最佳做法是什么?

tl;dr 检查点用于恢复情况而不是升级。

来自official documentation about Checkpointing

A streaming application must operate 24/7 and hence must be resilient to failures unrelated to the application logic (e.g., system failures, JVM crashes, etc.). For this to be possible, Spark Streaming needs to checkpoint enough information to a fault- tolerant storage system such that it can recover from failures.

因此,要回答有关使用检查点(用于容错)和更改应用程序代码的问题,您不应期望它会起作用,因为它违反了设计。