JobSubmissionEventImpl . Builder getJobSubmissionBuilder ( final Configuration driverConfiguration ) throws InjectionException , IOException { final Injector injector = Tang . Factory . getTang ( ) . newInjector ( driverConfiguration ) ; final boolean preserveEvaluators = injector . getNamedInstance ( ResourceManagerPreserveEvaluators . class ) ; final int maxAppSubmissions = injector . getNamedInstance ( MaxApplicationSubmissions . class ) ; final JobSubmissionEventImpl . Builder jbuilder = JobSubmissionEventImpl . newBuilder ( ) . setIdentifier ( returnOrGenerateDriverId ( injector . getNamedInstance ( DriverIdentifier . class ) ) ) . setDriverMemory ( injector . getNamedInstance ( DriverMemory . class ) ) . setDriverCpuCores ( injector . getNamedInstance ( DriverCPUCores . class ) ) . setUserName ( System . getProperty ( "user.name" ) ) . setPreserveEvaluators ( preserveEvaluators ) . setMaxApplicationSubmissions ( maxAppSubmissions ) . setConfiguration ( driverConfiguration ) ; for ( final String globalFileName : injector . getNamedInstance ( JobGlobalFiles . class ) ) { LOG . log ( Level . FINEST , "Adding global file: {0}" , globalFileName ) ; jbuilder . addGlobalFile ( getFileResourceProto ( globalFileName , FileType . PLAIN ) ) ; } for ( final String globalLibraryName : injector . getNamedInstance ( JobGlobalLibraries . class ) ) { LOG . log ( Level . FINEST , "Adding global library: {0}" , globalLibraryName ) ; jbuilder . addGlobalFile ( getFileResourceProto ( globalLibraryName , FileType . LIB ) ) ; } for ( final String localFileName : injector . getNamedInstance ( DriverLocalFiles . class ) ) { LOG . log ( Level . FINEST , "Adding local file: {0}" , localFileName ) ; jbuilder . addLocalFile ( getFileResourceProto ( localFileName , FileType . PLAIN ) ) ; } for ( final String localLibraryName : injector . getNamedInstance ( DriverLocalLibraries . class ) ) { LOG . log ( Level . FINEST , "Adding local library: {0}" , localLibraryName ) ; jbuilder . addLocalFile ( getFileResourceProto ( localLibraryName , FileType . LIB ) ) ; } return jbuilder ; }
Fils out a JobSubmissionProto based on the driver configuration given .