public void run() { JobInProgress job; while (true) { job = null; try { synchronized (jobInitQueue) { while (jobInitQueue.isEmpty()) { jobInitQueue.wait(); } job = jobInitQueue.remove(0); } job.initTasks(); } catch (InterruptedException t) { break; } catch (Throwable t) { LOG.error("Job initialization failed:\n" + StringUtils.stringifyException(t)); if (job != null) { job.fail(); } } } } }
FileSystem.get(conf), getSystemDirectoryForJob(jobId).toUri().getPath())); job.fail(); if (userFileForJob != null) { userFileForJob.delete(); LOG.warn("Access denied for user " + job.getJobConf().getUser() + ". Ignoring job " + jobId, ioe); job.fail(); if (userFileForJob != null) { userFileForJob.delete();
/** * Fail a job and inform the listeners. Other components in the framework * should use this to fail a job. */ public synchronized void failJob(JobInProgress job) { if (null == job) { LOG.info("Fail on null job is not valid"); return; } JobStatus prevStatus = (JobStatus)job.getStatus().clone(); LOG.info("Failing job " + job.getJobID()); job.fail(); // Inform the listeners if the job state has changed JobStatus newStatus = (JobStatus)job.getStatus().clone(); if (prevStatus.getRunState() != newStatus.getRunState()) { JobStatusChangeEvent event = new JobStatusChangeEvent(job, EventType.RUN_STATE_CHANGED, prevStatus, newStatus); updateJobInProgressListeners(event); } }
/** * Fail a job and inform the listeners. Other components in the framework * should use this to fail a job. */ public synchronized void failJob(JobInProgress job) { if (null == job) { LOG.info("Fail on null job is not valid"); return; } JobStatus prevStatus = (JobStatus)job.getStatus().clone(); LOG.info("Failing job " + job.getJobID()); job.fail(); // Inform the listeners if the job state has changed JobStatus newStatus = (JobStatus)job.getStatus().clone(); if (prevStatus.getRunState() != newStatus.getRunState()) { JobStatusChangeEvent event = new JobStatusChangeEvent(job, EventType.RUN_STATE_CHANGED, prevStatus, newStatus); updateJobInProgressListeners(event); } }
public synchronized void failJob(JobInProgress job) { JobStatus prevStatus = (JobStatus)job.getStatus().clone(); job.fail(); JobStatus newStatus = (JobStatus)job.getStatus().clone(); if (prevStatus.getRunState() != newStatus.getRunState()) { JobStatusChangeEvent event = new JobStatusChangeEvent(job, EventType.RUN_STATE_CHANGED, prevStatus, newStatus); for (JobInProgressListener listener : listeners) { listener.jobUpdated(event); } } }