public boolean checkComplete ( ) throws IOException { JobID jobID = runningJob . getID ( ) ; if ( runningJob . isComplete ( ) ) { // delete job directory final String jobdir = jobconf . get ( JOB_DIR_LABEL ) ; if ( jobdir != null ) { final Path jobpath = new Path ( jobdir ) ; jobpath . getFileSystem ( jobconf ) . delete ( jobpath , true ) ; } if ( runningJob . isSuccessful ( ) ) { LOG . info ( "Job Complete(Succeeded): " + jobID ) ; } else { LOG . info ( "Job Complete(Failed): " + jobID ) ; } raidPolicyPathPairList . clear ( ) ; Counters ctrs = runningJob . getCounters ( ) ; if ( ctrs != null ) { RaidNodeMetrics metrics = RaidNodeMetrics . getInstance ( RaidNodeMetrics . DEFAULT_NAMESPACE_ID ) ; if ( ctrs . findCounter ( Counter . FILES_FAILED ) != null ) { long filesFailed = ctrs . findCounter ( Counter . FILES_FAILED ) . getValue ( ) ; metrics . raidFailures . inc ( filesFailed ) ; } long slotSeconds = ctrs . findCounter ( JobInProgress . Counter . SLOTS_MILLIS_MAPS ) . getValue ( ) / 1000 ; metrics . raidSlotSeconds . inc ( slotSeconds ) ; } return true ; } else { String report = ( " job " + jobID + " map " + StringUtils . formatPercent ( runningJob . mapProgress ( ) , 0 ) + " reduce " + StringUtils . formatPercent ( runningJob . reduceProgress ( ) , 0 ) ) ; if ( ! report . equals ( lastReport ) ) { LOG . info ( report ) ; lastReport = report ; } TaskCompletionEvent [ ] events = runningJob . getTaskCompletionEvents ( jobEventCounter ) ; jobEventCounter += events . length ; for ( TaskCompletionEvent event : events ) { if ( event . getTaskStatus ( ) == TaskCompletionEvent . Status . FAILED ) { LOG . info ( " Job " + jobID + " " + event . toString ( ) ) ; } } return false ; } }
Checks if the map - reduce job has completed .