/** {@inheritDoc} */ public void onError(Throwable t) { nmClient.stop(); }
@Override protected void shutdownApplication(ApplicationStatus finalStatus, String optionalDiagnostics) { // first, de-register from YARN FinalApplicationStatus yarnStatus = getYarnStatus(finalStatus); LOG.info("Unregistering application from the YARN Resource Manager"); try { resourceManagerClient.unregisterApplicationMaster(yarnStatus, optionalDiagnostics, ""); } catch (Throwable t) { LOG.error("Could not unregister the application master.", t); } // now shut down all our components try { resourceManagerClient.stop(); } catch (Throwable t) { LOG.error("Could not cleanly shut down the Asynchronous Resource Manager Client", t); } try { nodeManagerClient.stop(); } catch (Throwable t) { LOG.error("Could not cleanly shut down the Node Manager Client", t); } // stop the actor after finishing processing the stop message getContext().system().stop(getSelf()); }
@Override public CompletableFuture<Void> postStop() { // shut down all components Throwable firstException = null; if (resourceManagerClient != null) { try { resourceManagerClient.stop(); } catch (Throwable t) { firstException = t; } } if (nodeManagerClient != null) { try { nodeManagerClient.stop(); } catch (Throwable t) { firstException = ExceptionUtils.firstOrSuppressed(t, firstException); } } final CompletableFuture<Void> terminationFuture = super.postStop(); if (firstException != null) { return FutureUtils.completedExceptionally(new FlinkException("Error while shutting down YARN resource manager", firstException)); } else { return terminationFuture; } }
@Override protected void shutDown() throws Exception { nmClient.stop(); }
@Override protected void shutDown() throws Exception { nmClient.stop(); }
client.stop();
@Override protected void shutdownApplication(ApplicationStatus finalStatus, String optionalDiagnostics) { // first, de-register from YARN FinalApplicationStatus yarnStatus = getYarnStatus(finalStatus); LOG.info("Unregistering application from the YARN Resource Manager"); try { resourceManagerClient.unregisterApplicationMaster(yarnStatus, optionalDiagnostics, ""); } catch (Throwable t) { LOG.error("Could not unregister the application master.", t); } // now shut down all our components try { resourceManagerClient.stop(); } catch (Throwable t) { LOG.error("Could not cleanly shut down the Asynchronous Resource Manager Client", t); } try { nodeManagerClient.stop(); } catch (Throwable t) { LOG.error("Could not cleanly shut down the Node Manager Client", t); } // stop the actor after finishing processing the stop message getContext().system().stop(getSelf()); }
@Override protected void shutdownApplication(ApplicationStatus finalStatus, String optionalDiagnostics) { // first, de-register from YARN FinalApplicationStatus yarnStatus = getYarnStatus(finalStatus); LOG.info("Unregistering application from the YARN Resource Manager"); try { resourceManagerClient.unregisterApplicationMaster(yarnStatus, optionalDiagnostics, ""); } catch (Throwable t) { LOG.error("Could not unregister the application master.", t); } // now shut down all our components try { resourceManagerClient.stop(); } catch (Throwable t) { LOG.error("Could not cleanly shut down the Asynchronous Resource Manager Client", t); } try { nodeManagerClient.stop(); } catch (Throwable t) { LOG.error("Could not cleanly shut down the Node Manager Client", t); } // stop the actor after finishing processing the stop message getContext().system().stop(getSelf()); }
@Override public CompletableFuture<Void> postStop() { // shut down all components Throwable firstException = null; if (resourceManagerClient != null) { try { resourceManagerClient.stop(); } catch (Throwable t) { firstException = t; } } if (nodeManagerClient != null) { try { nodeManagerClient.stop(); } catch (Throwable t) { firstException = ExceptionUtils.firstOrSuppressed(t, firstException); } } final CompletableFuture<Void> terminationFuture = super.postStop(); if (firstException != null) { return FutureUtils.completedExceptionally(new FlinkException("Error while shutting down YARN resource manager", firstException)); } else { return terminationFuture; } }
@Override public CompletableFuture<Void> postStop() { // shut down all components Throwable firstException = null; if (resourceManagerClient != null) { try { resourceManagerClient.stop(); } catch (Throwable t) { firstException = t; } } if (nodeManagerClient != null) { try { nodeManagerClient.stop(); } catch (Throwable t) { firstException = ExceptionUtils.firstOrSuppressed(t, firstException); } } final CompletableFuture<Void> terminationFuture = super.postStop(); if (firstException != null) { return FutureUtils.completedExceptionally(new FlinkException("Error while shutting down YARN resource manager", firstException)); } else { return terminationFuture; } }