protected synchronized void submit ( ) { try { if ( theJobConf . getBoolean ( "create.empty.dir.if.nonexist" , false ) ) { FileSystem fs = FileSystem . get ( theJobConf ) ; Path inputPaths [ ] = FileInputFormat . getInputPaths ( theJobConf ) ; for ( int i = 0 ; i < inputPaths . length ; i ++ ) { if ( ! fs . exists ( inputPaths [ i ] ) ) { try { fs . mkdirs ( inputPaths [ i ] ) ; } catch ( IOException e ) { } } } } RunningJob running = jc . submitJob ( theJobConf ) ; this . mapredJobID = running . getID ( ) ; this . state = Job . RUNNING ; } catch ( IOException ioe ) { this . state = Job . FAILED ; this . message = StringUtils . stringifyException ( ioe ) ; } }
Submit this job to mapred . The state becomes RUNNING if submission is successful FAILED otherwise .