flink-instrumentation/workspace/flink-1.4.1-instrumented/flink-1.4.1/flink-yarn/src/main/java/org/apache/flink/yarn/YarnClusterClient.java
/**
	 * Disconnect from the Yarn cluster.
	 */
Disconnect from the Yarn cluster.
Disconnect from the Yarn cluster .
public void disconnect() {
		if (hasBeenShutDown.getAndSet(true)) {
			return;
		}
		if (!isConnected) {
			throw new IllegalStateException("Can not disconnect from an unconnected cluster.");
		}
		LOG.info("Disconnecting YarnClusterClient from ApplicationMaster");
		try {
			Runtime.getRuntime().removeShutdownHook(clientShutdownHook);
		} catch (IllegalStateException e) {
		}
		try {
			pollingRunner.stopRunner();
			pollingRunner.join(1000);
		} catch (InterruptedException e) {
			LOG.warn("Shutdown of the polling runner was interrupted", e);
			Thread.currentThread().interrupt();
		}
		isConnected = false;
	}
public void disconnect ( ) { if ( hasBeenShutDown . getAndSet ( true ) ) { return ; } if ( ! isConnected ) { throw new IllegalStateException ( "Can not disconnect from an unconnected cluster." ) ; } LOG . info ( "Disconnecting YarnClusterClient from ApplicationMaster" ) ; try { Runtime . getRuntime ( ) . removeShutdownHook ( clientShutdownHook ) ; } catch ( IllegalStateException e ) { } try { pollingRunner . stopRunner ( ) ; pollingRunner . join ( 1000 ) ; } catch ( InterruptedException e ) { LOG . warn ( "Shutdown of the polling runner was interrupted" , e ) ; Thread . currentThread ( ) . interrupt ( ) ; } isConnected = false ; }
Disconnect from the Yarn cluster.
Disconnect from the Yarn cluster .
// we are already in the shutdown hook