synchronized TaskReport generateSingleReport ( ) { ArrayList < String > diagnostics = new ArrayList < String > ( ) ; for ( List < String > l : taskDiagnosticData . values ( ) ) { diagnostics . addAll ( l ) ; } TIPStatus currentStatus = null ; if ( isRunning ( ) && ! isComplete ( ) ) { currentStatus = TIPStatus . RUNNING ; } else if ( isComplete ( ) ) { currentStatus = TIPStatus . COMPLETE ; } else if ( wasKilled ( ) ) { currentStatus = TIPStatus . KILLED ; } else if ( isFailed ( ) ) { currentStatus = TIPStatus . FAILED ; } else if ( ! ( isComplete ( ) || isRunning ( ) || wasKilled ( ) ) ) { currentStatus = TIPStatus . PENDING ; } TaskReport report = new TaskReport ( getTIPId ( ) , ( float ) progress , state , diagnostics . toArray ( new String [ diagnostics . size ( ) ] ) , currentStatus , execStartTime , execFinishTime , counters ) ; if ( currentStatus == TIPStatus . RUNNING ) { report . setRunningTaskAttempts ( activeTasks . keySet ( ) ) ; } else if ( currentStatus == TIPStatus . COMPLETE ) { report . setSuccessfulAttempt ( getSuccessfulTaskid ( ) ) ; } return report ; }
Creates a status report for this task . Includes the task ID and overall status plus reports for all the component task - threads that have ever been started .