Spark streaming not remembering previous state

后端 未结 2 340
一个人的身影
一个人的身影 2021-01-23 09:45

I wrote spark streaming program with stateful transformation. It seems like my spark streaming application is doing computation correctly with check pointing. But if i terminate

2条回答
  •  一生所求
    2021-01-23 10:31

    As it is described in the checkpointing documentation you have to adjust your code to be able to restore state from the checkpoints.

    In particular you cannot create StreamingContext directly but have to use StreamingContext.getOrCreate method which takes:

    • checkpoint directory
    • function which can be used to set up the context (Unit => StreamingContext)

提交回复
热议问题