private TaskAttemptCompletionEvent createTaskAttemptCompletionEvent(
                                       SimulatorTaskInProgress tip, long now) {
    // We need to clone() status as we modify and it goes into an Event
    TaskStatus status = (TaskStatus)tip.getTaskStatus().clone();
    long delta = tip.getUserSpaceRunTime();
    assert delta >= 0 : "TaskAttempt " + tip.getTaskStatus().getTaskID()
        + " has negative UserSpaceRunTime = " + delta;
    long finishTime = now + delta;
    status.setFinishTime(finishTime);
    status.setProgress(1.0f);
    status.setRunState(tip.getFinalRunState());
    TaskAttemptCompletionEvent event = 
        new TaskAttemptCompletionEvent(this, status);
    if (LOG.isDebugEnabled()) {
      LOG.debug("Created task attempt completion event " + event);
    }
    return event;
  }
private TaskAttemptCompletionEvent createTaskAttemptCompletionEvent ( SimulatorTaskInProgress tip , long now ) { TaskStatus status = ( TaskStatus ) tip . getTaskStatus ( ) . clone ( ) ; long delta = tip . getUserSpaceRunTime ( ) ; assert delta >= 0 : "TaskAttempt " + tip . getTaskStatus ( ) . getTaskID ( ) + " has negative UserSpaceRunTime = " + delta ; long finishTime = now + delta ; status . setFinishTime ( finishTime ) ; status . setProgress ( 1.0f ) ; status . setRunState ( tip . getFinalRunState ( ) ) ; TaskAttemptCompletionEvent event = new TaskAttemptCompletionEvent ( this , status ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Created task attempt completion event " + event ) ; } return event ; }
Creates a signal for itself marking the completion of a task attempt.
It assumes that the task attempt hasn't made any progress in the user
space code so far, i.e. it is called right at launch for map tasks and
immediately after all maps completed for reduce tasks.

@param tip the simulator task in progress
@param now the current simulation time
@return the TaskAttemptCompletionEvent we are sending to ourselves