public synchronized void retireJob(ReplicationJob job){
  ReplicationJob removedJob=idToReplicationJob.remove(job.getId());
  if (removedJob == null) {
    throw new RuntimeException("Couldn't find id: " + job.getId() + " in the registry!");
  }
  if (removedJob != job) {
    throw new RuntimeException("Replication jobs with the same ID " + "are not equal: %s and %s");
  }
  if (retiredJobs.size() + 1 > MAX_RETIRED_JOBS) {
    retiredJobs.remove(0);
  }
  retiredJobs.add(removedJob);
}

public synchronized void retireJob ( ReplicationJob job ) { ReplicationJob removedJob = idToReplicationJob . remove ( job . getId ( ) ) ; if ( removedJob == null ) { throw new RuntimeException ( "Couldn't find id: " + job . getId ( ) + " in the registry!" ) ; } if ( removedJob != job ) { throw new RuntimeException ( "Replication jobs with the same ID " + "are not equal: %s and %s" ) ; } if ( retiredJobs . size ( ) + 1 > MAX_RETIRED_JOBS ) { retiredJobs . remove ( 0 ) ; } retiredJobs . add ( removedJob ) ; }
remove this job from the main internal data structures to another retired job datastructure .
