title: How to config checkpoint to redeploy spark streaming application?
body: <p>I'm using Spark streaming to count unique users. I use <code>updateStateByKey</code>, so I need config a checkpoint directory. I also load the data from checkpoint while start the application, as <a href="https://spark.apache.org/docs/latest/streaming-programming-guide.html#checkpointing">the example in the doc</a>:</p>
  
  <pre><code>// Function to create and setup a new StreamingContext
  def functionToCreateContext(): StreamingContext = {
      val ssc = new StreamingContext(...)   // new context
      val lines = ssc.socketTextStream(...) // create DStreams
      ...
      ssc.checkpoint(checkpointDirectory)   // set checkpoint directory
      ssc
  }
  
  // Get StreamingContext from checkpoint data or create a new one
  val context = StreamingContext.getOrCreate(checkpointDirectory, functionToCreateContext _)
  </code></pre>
  
  <p>Here is the question, if my code is changed, then I re-deploy the code, will the checkpoint be loaded no matter how much the code is changed? Or I need to use my own logic to persistence my data and load them in the next run.</p>
  
  <p>If I use my own logic to save and load the DStream, then if the application restart on failure, won't the data loaded both from checkpoint directory and my own database?</p>