List of usage examples for org.apache.spark.launcher SparkAppHandle stop
void stop();
From source file:org.apache.hive.spark.client.SparkLauncherSparkClient.java
License:Apache License
@VisibleForTesting static Future<Void> createSparkLauncherFuture(CountDownLatch shutdownLatch, SparkAppHandle sparkAppHandle, RpcServer rpcServer, String clientId) { // Monitor the countdown latch Callable<Void> runnable = () -> { try {//from ww w. ja v a 2 s . com shutdownLatch.await(); } catch (InterruptedException e) { rpcServer.cancelClient(clientId, "Spark app launcher interrupted"); sparkAppHandle.stop(); } return null; }; FutureTask<Void> futureTask = new FutureTask<>(runnable); Thread driverThread = new Thread(futureTask); driverThread.setDaemon(true); driverThread.setName("SparkLauncherMonitor"); driverThread.start(); return futureTask; }