Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Stop Spark Streaming

I am working on twitter connector. I want to stop streaming after one minute. Can anyone give idea ho to do this? I tried ssc.awaitTermination(60000). but it didn't work.

like image 468
Sadaf Avatar asked Sep 28 '22 04:09

Sadaf


1 Answers

Note that awaitTermination with a timeout is deprecated:

https://github.com/apache/spark/blob/master/streaming/src/main/scala/org/apache/spark/streaming/StreamingContext.scala#L633

However with either awaitTermination or awaitTerminationOrTimeout you should follow it with ssc.stop to stop the context once the timeout is reached.

like image 162
mattinbits Avatar answered Oct 03 '22 21:10

mattinbits