[ 
https://issues.apache.org/jira/browse/SPARK-52564?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

sohurdc updated SPARK-52564:
----------------------------
    Description: 
Once checkpointing is enabled in Spark Streaming, configuration changes require 
deleting the checkpoint, which results in loss of state.

 

{{// 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 _)

// Do additional setup on context that needs to be done,
// irrespective of whether it is being started or restarted
context. ...

// Start the context
context.start()
context.awaitTermination()}}

  was:Once checkpointing is enabled in Spark Streaming, configuration changes 
require deleting the checkpoint, which results in loss of state.


> configuration changes require deleting the checkpoint
> -----------------------------------------------------
>
>                 Key: SPARK-52564
>                 URL: https://issues.apache.org/jira/browse/SPARK-52564
>             Project: Spark
>          Issue Type: Improvement
>          Components: Spark Core
>    Affects Versions: 3.2.4, 3.3.4, 3.4.4, 3.5.6, 4.0.0
>            Reporter: sohurdc
>            Priority: Major
>
> Once checkpointing is enabled in Spark Streaming, configuration changes 
> require deleting the checkpoint, which results in loss of state.
>  
> {{// 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 _)
> // Do additional setup on context that needs to be done,
> // irrespective of whether it is being started or restarted
> context. ...
> // Start the context
> context.start()
> context.awaitTermination()}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to