public static void main ( final String [ ] args ) throws InjectionException , IOException { final JavaConfigurationBuilder driverConfigBuilder = TANG . newConfigurationBuilder ( STATIC_DRIVER_CONFIG ) ; new CommandLine ( driverConfigBuilder ) . registerShortNameOfClass ( Command . class ) . registerShortNameOfClass ( NumEvaluators . class ) . registerShortNameOfClass ( RuntimeName . class ) . processCommandLine ( args ) ; final Configuration driverConfig = driverConfigBuilder . build ( ) ; final Injector injector = TANG . newInjector ( driverConfig ) ; final int numEvaluators = injector . getNamedInstance ( NumEvaluators . class ) ; final String runtimeName = injector . getNamedInstance ( RuntimeName . class ) ; final String command = injector . getNamedInstance ( Command . class ) ; LOG . log ( Level . INFO , "REEF distributed shell: {0} evaluators on {1} runtime :: {2}" , new Object [ ] { numEvaluators , runtimeName , command } ) ; final Configuration runtimeConfig ; switch ( runtimeName ) { case "local" : runtimeConfig = LocalRuntimeConfiguration . CONF . set ( LocalRuntimeConfiguration . MAX_NUMBER_OF_EVALUATORS , numEvaluators ) . build ( ) ; break ; case "yarn" : runtimeConfig = YarnClientConfiguration . CONF . build ( ) ; break ; default : LOG . log ( Level . SEVERE , "Unknown runtime: {0}" , runtimeName ) ; throw new IllegalArgumentException ( "Unknown runtime: " + runtimeName ) ; } final LauncherStatus status = DriverLauncher . getLauncher ( runtimeConfig ) . run ( driverConfig , JOB_TIMEOUT ) ; LOG . log ( Level . INFO , "REEF job completed: {0}" , status ) ; }
Start the distributed shell job .