简体   繁体   English

如何停止Spark Streaming

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM