/** * A tracker wants to know if any job needs cleanup because the job completed. */ private List<TaskTrackerAction> getJobsForCleanup(String taskTracker) { Set<JobID> jobs = null; synchronized (trackerToJobsToCleanup) { jobs = trackerToJobsToCleanup.remove(taskTracker); } if (jobs != null) { // prepare the actions list List<TaskTrackerAction> killList = new ArrayList<TaskTrackerAction>(); for (JobID killJobId : jobs) { killList.add(new KillJobAction(killJobId)); LOG.debug(taskTracker + " -> KillJobAction: " + killJobId); } return killList; } return null; }
/** * A tracker wants to know if any job needs cleanup because the job completed. */ private List<TaskTrackerAction> getJobsForCleanup(String taskTracker) { Set<JobID> jobs = null; synchronized (trackerToJobsToCleanup) { jobs = trackerToJobsToCleanup.remove(taskTracker); } if (jobs != null) { // prepare the actions list List<TaskTrackerAction> killList = new ArrayList<TaskTrackerAction>(); for (JobID killJobId : jobs) { killList.add(new KillJobAction(killJobId)); if (LOG.isDebugEnabled()) { LOG.debug(taskTracker + " -> KillJobAction: " + killJobId); } } return killList; } return null; }
/** * Test userlogs cleanup. * * @throws IOException */ private void verifyUserLogsRemoval() throws IOException { // verify user logs cleanup File jobUserLogDir = TaskLog.getJobDir(jobId); // Logs should be there before cleanup. assertTrue("Userlogs dir " + jobUserLogDir + " is not present as expected!!", jobUserLogDir.exists()); tracker.purgeJob(new KillJobAction(jobId)); tracker.getTaskLogCleanupThread().processCompletedJobs(); // Logs should be gone after cleanup. assertFalse("Userlogs dir " + jobUserLogDir + " is not deleted as expected!!", jobUserLogDir.exists()); }
killList.add(new KillJobAction(killJobId)); LOG.debug(taskTracker + " -> KillJobAction: " + killJobId);
case KILL_JOB: action = new KillJobAction();
case KILL_JOB: action = new KillJobAction();
case KILL_JOB: action = new KillJobAction();