private synchronized void moveToDone() throws IOException { if (LogGlobal.isDebugEnabled()) { /* LOG.debug("moveToDone: "+historyFile) */ LOG.movetodone(historyFile.toString()).debug(); } if (!isMovePending()) { // It was either deleted or is already in done. Either way do nothing if (LogGlobal.isDebugEnabled()) { /* LOG.debug("Move no longer pending") */ LOG.move_longer_pending().debug(); } return; } try { long completeTime = jobIndexInfo.getFinishTime(); if (completeTime == 0) { completeTime = System.currentTimeMillis(); } JobId jobId = jobIndexInfo.getJobId(); List<Path> paths = new ArrayList<Path>(2); if (historyFile == null) { /* LOG.info("No file for job-history with "+jobId+" found in cache!") */ LOG.file_for_job_history_with_found(jobId.toString()).info(); } else { paths.add(historyFile); } if (confFile == null) { /* LOG.info("No file for jobConf with "+jobId+" found in cache!") */ LOG.file_for_jobconf_with_found_cache(jobId.toString()).info(); } else { paths.add(confFile); } if (summaryFile == null) { /* LOG.info("No summary file for job: "+jobId) */ LOG.summary_file_for_job(jobId.toString()).info(); } else { String jobSummaryString = getJobSummary(intermediateDoneDirFc, summaryFile); LOG.summary_file_for_job(jobSummaryString); /* LOG.info("Deleting JobSummary file: ["+summaryFile+"]") */ LOG.deleting_jobsummary_file(summaryFile.toString()).info(); intermediateDoneDirFc.delete(summaryFile, false); summaryFile = null; } Path targetDir = canonicalHistoryLogPath(jobId, completeTime); addDirectoryToSerialNumberIndex(targetDir); makeDoneSubdir(targetDir); if (historyFile != null) { Path toPath = doneDirFc.makeQualified(new Path(targetDir, historyFile.getName())); if (!toPath.equals(historyFile)) { moveToDoneNow(historyFile, toPath); historyFile = toPath; } } if (confFile != null) { Path toPath = doneDirFc.makeQualified(new Path(targetDir, confFile.getName())); if (!toPath.equals(confFile)) { moveToDoneNow(confFile, toPath); confFile = toPath; } } state = HistoryInfoState.IN_DONE; } catch (Throwable t) { /* LOG.error("Error while trying to move a job to done",t) */ LOG.error_while_trying_move_job_done(t.toString()).error(); this.state = HistoryInfoState.MOVE_FAILED; } }