@ Override public void onNext ( final ResourceStatusEvent resourceStatusEvent ) { final String id = resourceStatusEvent . getIdentifier ( ) ; final Optional < EvaluatorManager > evaluatorManager = this . evaluators . get ( id ) ; LOG . log ( Level . FINEST , "Evaluator {0} status: {1}" , new Object [ ] { evaluatorManager , resourceStatusEvent . getState ( ) } ) ; if ( evaluatorManager . isPresent ( ) ) { final EvaluatorManager evaluatorManagerImpl = evaluatorManager . get ( ) ; evaluatorManagerImpl . onResourceStatusMessage ( resourceStatusEvent ) ; if ( evaluatorManagerImpl . isClosed ( ) ) { this . evaluators . removeClosedEvaluator ( evaluatorManagerImpl ) ; } } else { if ( this . evaluators . wasClosed ( id ) ) { LOG . log ( Level . WARNING , "Unexpected resource status from closed evaluator {0} with state {1}" , new Object [ ] { id , resourceStatusEvent . getState ( ) } ) ; } if ( driverRestartManager . get ( ) . getEvaluatorRestartState ( id ) . isFailedOrExpired ( ) ) { final EvaluatorManager previousEvaluatorManager = this . evaluatorManagerFactory . getNewEvaluatorManagerForEvaluatorFailedDuringDriverRestart ( resourceStatusEvent ) ; previousEvaluatorManager . onResourceStatusMessage ( resourceStatusEvent ) ; } else { throw new RuntimeException ( "Unknown resource status from evaluator " + id + " with state " + resourceStatusEvent . getState ( ) ) ; } } }
This resource status message comes from the ResourceManager layer telling me what it thinks about the state of the resource executing an Evaluator . This method simply passes the message off to the referenced EvaluatorManager