code: @Override
  	public CompletableFuture<Acknowledge> deregisterApplication(
  			final ApplicationStatus finalStatus,
  			@Nullable final String diagnostics) {
  		log.info("Shut down cluster because application is in {}, diagnostics {}.", finalStatus, diagnostics);
  
  		try {
  			internalDeregisterApplication(finalStatus, diagnostics);
  		} catch (ResourceManagerException e) {
  			log.warn("Could not properly shutdown the application.", e);
  		}
  
  		return CompletableFuture.completedFuture(Acknowledge.get());
  	}
docs: Cleanup application and shut down cluster.
  
  @param finalStatus of the Flink application
  @param diagnostics diagnostics message for the Flink application or {@code null}