private boolean taskSuccessfulInPriorAttempt ( String taskId ) { if ( this . taskStateStoreOptional . isPresent ( ) ) { StateStore < TaskState > taskStateStore = this . taskStateStoreOptional . get ( ) ; // Delete the task state file for the task if it already exists. // This usually happens if the task is retried upon failure. try { if ( taskStateStore . exists ( jobId , taskId + TASK_STATE_STORE_SUCCESS_MARKER_SUFFIX ) ) { log . info ( "Skipping task {} that successfully executed in a prior attempt." , taskId ) ; // skip tasks that executed successfully in a previous attempt return true ; } } catch ( IOException e ) { // if an error while looking up the task state store then treat like it was not processed return false ; } } return false ; }
Determine if the task executed successfully in a prior attempt by checkitn the task state store for the success marker .