[英]How to Stop Spark Streaming
I am working on twitter connector. 我正在使用twitter连接器。 I want to stop streaming after one minute.
我想在一分钟后停止播放。 Can anyone give idea ho to do this?
任何人都可以提出想法吗? I tried ssc.awaitTermination(60000).
我试过ssc.awaitTermination(60000)。 but it didn't work.
但它不起作用。
Note that awaitTermination
with a timeout is deprecated: 请注意,不推荐使用带有超时的
awaitTermination
:
https://github.com/apache/spark/blob/master/streaming/src/main/scala/org/apache/spark/streaming/StreamingContext.scala#L633 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. 但是,无论是
awaitTermination
还是awaitTerminationOrTimeout
都应该使用ssc.stop
跟随它,以便在达到超时后停止上下文。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.