public synchronized void onRestart ( final StartTime startTime , final List < EventHandler < DriverRestarted > > orderedHandlers ) { if ( this . state == DriverRestartState . BEGAN ) { restartEvaluators = driverRuntimeRestartManager . getPreviousEvaluators ( ) ; final DriverRestarted restartedInfo = new DriverRestartedImpl ( resubmissionAttempts , startTime , restartEvaluators ) ; for ( final EventHandler < DriverRestarted > handler : orderedHandlers ) { handler . onNext ( restartedInfo ) ; } this . state = DriverRestartState . IN_PROGRESS ; } else { final String errMsg = "Should not be setting the set of expected alive evaluators more than once." ; LOG . log ( Level . SEVERE , errMsg ) ; throw new DriverFatalRuntimeException ( errMsg ) ; } driverRuntimeRestartManager . informAboutEvaluatorFailures ( getFailedEvaluators ( ) ) ; if ( driverRestartEvaluatorRecoverySeconds != Integer . MAX_VALUE ) { // Don't use Clock here because if there is an event scheduled, the driver will not be idle, even if // driver restart has already completed, and we cannot cancel the event. restartCompletedTimer . schedule ( new TimerTask ( ) { @ Override public void run ( ) { onDriverRestartCompleted ( true ) ; } } , driverRestartEvaluatorRecoverySeconds * 1000L ) ; } }
Recovers the list of alive and failed evaluators and inform the driver restart handlers and inform the evaluator failure handlers based on the specific runtime . Also sets the expected amount of evaluators to report back as alive to the job driver .