I'm using Spark 2.1 and trying to stop a Streaming query gracefully.
Is StreamingQuery.stop() a graceful stop because I haven't seen any detailed information on this method in the documentation:
void stop()Stops the execution of this query if it is running. This method blocks until the threads performing execution has stopped. Since: 2.0.0
Whereas in the past Streaming world (DStreams) there is an option to stop the execution of the streams, with option of ensuring all received data has been processed:
def stop(stopSparkContext: Boolean, stopGracefully: Boolean): UnitStop the execution of the streams, with option of ensuring all received data has been processed.
stopSparkContextif true, stops the associated SparkContext. The underlying SparkContext will be stopped regardless of whether this StreamingContext has been started.
stopGracefullyif true, stops gracefully by waiting for the processing of all received data to be completed
So the question is how to stop a Structured Streaming Query gracefully?