You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spark.apache.org by Jacek Laskowski <ja...@japila.pl> on 2016/05/25 19:59:35 UTC

LiveListenerBus with started and stopped flags? Why both?

Hi,

I'm wondering why LiveListenerBus has two AtomicBoolean flags [1]?
Could it not have just one, say started? Why does Spark have to check
the stopped state?

[1] https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/scheduler/LiveListenerBus.scala#L49-L51

Pozdrawiam,
Jacek Laskowski
----
https://medium.com/@jaceklaskowski/
Mastering Apache Spark http://bit.ly/mastering-apache-spark
Follow me at https://twitter.com/jaceklaskowski

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@spark.apache.org
For additional commands, e-mail: dev-help@spark.apache.org


Re: LiveListenerBus with started and stopped flags? Why both?

Posted by "Shixiong(Ryan) Zhu" <sh...@databricks.com>.
Just to prevent from restarting LiveListenerBus. The internal Thread cannot
be restarted.

On Wed, May 25, 2016 at 12:59 PM, Jacek Laskowski <ja...@japila.pl> wrote:

> Hi,
>
> I'm wondering why LiveListenerBus has two AtomicBoolean flags [1]?
> Could it not have just one, say started? Why does Spark have to check
> the stopped state?
>
> [1]
> https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/scheduler/LiveListenerBus.scala#L49-L51
>
> Pozdrawiam,
> Jacek Laskowski
> ----
> https://medium.com/@jaceklaskowski/
> Mastering Apache Spark http://bit.ly/mastering-apache-spark
> Follow me at https://twitter.com/jaceklaskowski
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@spark.apache.org
> For additional commands, e-mail: dev-help@spark.apache.org
>
>