code: void setPhase(Phase phase){
      TaskStatus.Phase oldPhase = getPhase();
      if (oldPhase != phase){
        // sort phase started
        if (phase == TaskStatus.Phase.SORT){
          setShuffleFinishTime(JobTracker.getClock().getTime());
        } else if (phase == TaskStatus.Phase.REDUCE){
          setSortFinishTime(JobTracker.getClock().getTime());
        }
      }
      this.phase = phase; 
    }
docs: Set current phase of this task.
  @param phase phase of this task