flink-instrumentation/workspace/flink-1.4.1-instrumented/flink-1.4.1/flink-yarn/src/main/java/org/apache/flink/yarn/YarnClusterClient.java
/**
	 * Blocks until all TaskManagers are connected to the JobManager.
	 */
Blocks until all TaskManagers are connected to the JobManager.
Blocks until all TaskManagers are connected to the JobManager .
@Override
	public void waitForClusterToBeReady() {
		logAndSysout("Waiting until all TaskManagers have connected");
		for (GetClusterStatusResponse currentStatus, lastStatus = null;; lastStatus = currentStatus) {
			currentStatus = getClusterStatus();
			if (currentStatus != null && !currentStatus.equals(lastStatus)) {
				logAndSysout("TaskManager status (" + currentStatus.numRegisteredTaskManagers() + "/"
					+ numberTaskManagers + ")");
				if (currentStatus.numRegisteredTaskManagers() >= numberTaskManagers) {
					logAndSysout("All TaskManagers are connected");
					break;
				}
			} else if (lastStatus == null) {
				logAndSysout("No status updates from the YARN cluster received so far. Waiting ...");
			}
			try {
				Thread.sleep(250);
			} catch (InterruptedException e) {
				throw new RuntimeException("Interrupted while waiting for TaskManagers", e);
			}
		}
	}
@ Override public void waitForClusterToBeReady ( ) { logAndSysout ( "Waiting until all TaskManagers have connected" ) ; for ( GetClusterStatusResponse currentStatus , lastStatus = null ; ; lastStatus = currentStatus ) { currentStatus = getClusterStatus ( ) ; if ( currentStatus != null && ! currentStatus . equals ( lastStatus ) ) { logAndSysout ( "TaskManager status (" + currentStatus . numRegisteredTaskManagers ( ) + "/" + numberTaskManagers + ")" ) ; if ( currentStatus . numRegisteredTaskManagers ( ) >= numberTaskManagers ) { logAndSysout ( "All TaskManagers are connected" ) ; break ; } } else if ( lastStatus == null ) { logAndSysout ( "No status updates from the YARN cluster received so far. Waiting ..." ) ; } try { Thread . sleep ( 250 ) ; } catch ( InterruptedException e ) { throw new RuntimeException ( "Interrupted while waiting for TaskManagers" , e ) ; } } }
Blocks until all TaskManagers are connected to the JobManager.
Blocks until all TaskManagers are connected to the JobManager .