code: @Override
    synchronized void finalizeJob(JobInProgress job) {
  
      // Let the SimulatorEngine know that the job is done
      JobStatus cloneStatus = (JobStatus)job.getStatus().clone();
      engine.markCompletedJob(cloneStatus, 
                              SimulatorJobTracker.getClock().getTime());
  
      JobID jobId = job.getStatus().getJobID();
      LOG.info("Finished job " + jobId + " endtime = " +
                getClock().getTime() + " with status: " +
                JobStatus.getJobRunState(job.getStatus().getRunState()));
      
      // for updating the metrics and JobHistory, invoke the original 
      // finalizeJob.
      super.finalizeJob(job);
      
      // now placing this job in queue for future nuking
      cleanupJob(job);
    }
docs: Safely clean-up all data structures at the end of the
  job (success/failure/killed). In addition to performing the tasks that the
  original finalizeJob does, we also inform the SimulatorEngine about the
  completion of this job.
  
  @param job completed job.