void onStart ( ) { LOG . log ( Level . FINEST , "YARN registration: begin" ) ; this . nodeManager . init ( this . yarnConf ) ; this . nodeManager . start ( ) ; try { this . yarnProxyUser . doAs ( new PrivilegedExceptionAction < Object > ( ) { @ Override public Object run ( ) throws Exception { resourceManager . init ( yarnConf ) ; resourceManager . start ( ) ; return null ; } } ) ; LOG . log ( Level . FINE , "YARN registration: register AM at \"{0}:{1}\" tracking URL \"{2}\"" , new Object [ ] { amRegistrationHost , AM_REGISTRATION_PORT , this . trackingUrl } ) ; this . registration . setRegistration ( this . resourceManager . registerApplicationMaster ( amRegistrationHost , AM_REGISTRATION_PORT , this . trackingUrl ) ) ; LOG . log ( Level . FINE , "YARN registration: AM registered: {0}" , this . registration ) ; final FileSystem fs = FileSystem . get ( this . yarnConf ) ; final Path outputFileName = new Path ( this . jobSubmissionDirectory , this . reefFileNames . getDriverHttpEndpoint ( ) ) ; try ( final FSDataOutputStream out = fs . create ( outputFileName ) ) { out . writeBytes ( this . trackingUrl + ' ' ) ; } } catch ( final Exception e ) { LOG . log ( Level . WARNING , "Unable to register application master." , e ) ; onRuntimeError ( e ) ; } LOG . log ( Level . FINEST , "YARN registration: done: {0}" , this . registration ) ; }
Start the YARN container manager . This method is called from DriverRuntimeStartHandler via YARNRuntimeStartHandler .