spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcelo Vanzin <van...@cloudera.com>
Subject Re: Correct SparkLauncher usage
Date Thu, 10 Nov 2016 22:49:09 GMT
On Thu, Nov 10, 2016 at 2:43 PM, Mohammad Tariq <dontariq@gmail.com> wrote:
>   @Override
>   public void stateChanged(SparkAppHandle handle) {
>     System.out.println("Spark App Id [" + handle.getAppId() + "]. State [" + handle.getState()
+ "]");
>     while(!handle.getState().isFinal()) {

You shouldn't loop in an event handler. That's not really how
listeners work. Instead, use the event handler to update some local
state, or signal some thread that's waiting for the state change.

Also be aware that handles currently only work in local and yarn
modes; the state updates haven't been hooked up to standalone mode
(maybe for client mode, but definitely not cluster) nor mesos.

-- 
Marcelo

---------------------------------------------------------------------
To unsubscribe e-mail: user-unsubscribe@spark.apache.org


Mime
View raw message