@Override public void shutDownCluster() { LOG.info("Sending shutdown request to the Application Master"); try { final Future<Object> response = Patterns.ask(applicationClient.get(), new YarnMessages.LocalStopYarnSession(ApplicationStatus.SUCCEEDED, "Flink YARN Client requested shutdown"), new Timeout(akkaDuration)); Await.ready(response, akkaDuration); } catch (final Exception e) { LOG.warn("Error while stopping YARN cluster.", e); } }
private void stopAfterJob(JobID jobID) { Preconditions.checkNotNull(jobID, "The job id must not be null"); try { Future<Object> replyFuture = getJobManagerGateway().ask( new ShutdownClusterAfterJob(jobID), akkaDuration); Await.ready(replyFuture, akkaDuration); } catch (Exception e) { throw new RuntimeException("Unable to tell application master to stop once the specified job has been finised", e); } }
@Override public void close() throws Exception { if (isLoaded()) { actorSystem.terminate(); Await.ready(actorSystem.whenTerminated(), Duration.Inf()); actorSystem = null; } }
@After public void shutDownActorSystem() { if (jobManagerSystem != null) { try { jobManagerSystem.terminate(); Await.ready(jobManagerSystem.whenTerminated(), Duration.Inf()); } catch (Exception e) { e.printStackTrace(); fail(e.getMessage()); } } }
Await.ready(actorSystem.whenTerminated(), Duration.Inf()); } catch (InterruptedException | TimeoutException e) { LOG.error("Error shutting down actor system", e);
Await.ready(taskManagerRegisteredFuture, deadline.timeLeft());
Future<Object> future = jm.ask(new WaitForAllVerticesToBeRunningOrFinished(graph.getJobID()), deadline.timeLeft()); Await.ready(future, deadline.timeLeft());
Await.ready(system.whenTerminated(), Duration.Inf());
private void stopAfterJob(ClusterClient client, JobID jobID) { Preconditions.checkNotNull(jobID, "The job id must not be null"); try { Future<Object> replyFuture = client.getJobManagerGateway().ask( new ShutdownClusterAfterJob(jobID), AKKA_TIMEOUT); Await.ready(replyFuture, AKKA_TIMEOUT); } catch (Exception e) { throw new RuntimeException("Unable to tell application master to stop" + " once the specified job has been finished", e); } } }
@Override public void run() { try { Await.ready(actorSystem.whenTerminated(), terminationTimeout); } catch (Exception e) { if (e instanceof TimeoutException) { log.error("Actor system shut down timed out.", e); } else { log.error("Failure during actor system shut down.", e); } } finally { log.info("Shutdown completed. Stopping JVM."); System.exit(0); } } }
@Override public void run() { try { Await.ready(actorSystem.whenTerminated(), terminationTimeout); } catch (Exception e) { if (e instanceof TimeoutException) { log.error("Actor system shut down timed out.", e); } else { log.error("Failure during actor system shut down.", e); } } finally { log.info("Shutdown completed. Stopping JVM."); System.exit(0); } } }
private void shutdownActorSystem(ActorSystem actorSystem) { // shut the actor system down actorSystem.terminate(); try { // give it some time to complete the shutdown Await.ready(actorSystem.whenTerminated(), timeout); } catch (InterruptedException | TimeoutException e) { log.error("Exception thrown when terminating the actor system", e); } finally { // now let's crash the JVM System.exit(exitCode); } } }
private void shutdownActorSystem(ActorSystem actorSystem) { // shut the actor system down actorSystem.terminate(); try { // give it some time to complete the shutdown Await.ready(actorSystem.whenTerminated(), timeout); } catch (InterruptedException | TimeoutException e) { log.error("Exception thrown when terminating the actor system", e); } finally { // now let's crash the JVM System.exit(exitCode); } } }
@Override public void shutDownCluster() { LOG.info("Sending shutdown request to the Application Master"); try { final Future<Object> response = Patterns.ask(applicationClient.get(), new YarnMessages.LocalStopYarnSession(ApplicationStatus.SUCCEEDED, "Flink YARN Client requested shutdown"), new Timeout(akkaDuration)); Await.ready(response, akkaDuration); } catch (final Exception e) { LOG.warn("Error while stopping YARN cluster.", e); } }
@Override public void shutDownCluster() { LOG.info("Sending shutdown request to the Application Master"); try { final Future<Object> response = Patterns.ask(applicationClient.get(), new YarnMessages.LocalStopYarnSession(ApplicationStatus.SUCCEEDED, "Flink YARN Client requested shutdown"), new Timeout(akkaDuration)); Await.ready(response, akkaDuration); } catch (final Exception e) { LOG.warn("Error while stopping YARN cluster.", e); } }
private void stopAfterJob(JobID jobID) { Preconditions.checkNotNull(jobID, "The job id must not be null"); try { Future<Object> replyFuture = getJobManagerGateway().ask( new ShutdownClusterAfterJob(jobID), akkaDuration); Await.ready(replyFuture, akkaDuration); } catch (Exception e) { throw new RuntimeException("Unable to tell application master to stop once the specified job has been finised", e); } }
public void stopAfterJob(JobID jobID) { Preconditions.checkNotNull(jobID, "The job id must not be null"); try { Future<Object> replyFuture = getJobManagerGateway().ask( new ShutdownClusterAfterJob(jobID), akkaDuration); Await.ready(replyFuture, akkaDuration); } catch (Exception e) { throw new RuntimeException( "Unable to tell application master to stop once the specified job has been finised", e); } }
private void stopAfterJob(JobID jobID) { Preconditions.checkNotNull(jobID, "The job id must not be null"); try { Future<Object> replyFuture = getJobManagerGateway().ask( new ShutdownClusterAfterJob(jobID), akkaDuration); Await.ready(replyFuture, akkaDuration); } catch (Exception e) { throw new RuntimeException("Unable to tell application master to stop once the specified job has been finised", e); } }
public void shutdown() { FiniteDuration duration = datastoreContext.getShardRaftConfig().getElectionTimeOutInterval().$times(3); try { Await.ready(Patterns.gracefulStop(shardManager, duration, Shutdown.INSTANCE), duration); } catch(Exception e) { LOG.warn("ShardManager for {} data store did not shutdown gracefully", getDataStoreName(), e); } }
@Override public void close() throws Exception { if (isLoaded()) { actorSystem.terminate(); Await.ready(actorSystem.whenTerminated(), Duration.Inf()); actorSystem = null; } }