Thanks Marcelo.
I changed the code using CountDownLatch, and it works as expected.
...final CountDownLatch countDownLatch = new CountDownLatch(1);
SparkAppListener sparkAppListener = new SparkAppListener(countDownLatch);
SparkAppHandle appHandle =
sparkLauncher.startApplication(sparkAppListener);
On Sat, Nov 5, 2016 at 2:54 AM, Elkhan Dadashov wrote:
> while (appHandle.getState() == null || !appHandle.getState().isFinal()) {
> if (appHandle.getState() != null) {
> log.info("while: Spark job state is : " + appHandle.getState());
> if (appHandle.getAppId() != null) {
>