assertFalse("task temp dir still exists", expectedFile.exists()); committer.abortJob(jContext, JobStatus.State.FAILED); expectedFile = new File(new Path(outDir, FileOutputCommitter.PENDING_DIR_NAME) .toString());
@Override public void abortJob(JobContext context, State state) throws IOException { // in this case the job is being killed, no need to check for empty dirs checkForEmptyDir = false; super.abortJob(context, state); }
committer.abortJob(jContext, JobStatus.State.FAILED); } catch (IOException ie) { th = ie;
/** @inheritDoc */ @Override public void abortJob(JobContext jobContext, JobStatus.State state) throws IOException { try { super.abortJob(jobContext, state); } finally { cleanup(jobContext.getConfiguration()); } }
/** @inheritDoc */ @Override public void abortJob(JobContext jobContext, JobStatus.State state) throws IOException { try { super.abortJob(jobContext, state); } finally { cleanup(jobContext.getConfiguration()); } }
/** {@inheritDoc} */ @Override public void abortJob(JobContext jobContext, JobStatus.State state) throws IOException { try { super.abortJob(jobContext, state); } finally { cleanupTempFiles(jobContext); cleanup(jobContext.getConfiguration()); } }
/** {@inheritDoc} */ @Override public void abortJob(JobContext jobContext, JobStatus.State state) throws IOException { try { super.abortJob(jobContext, state); } finally { cleanupTempFiles(jobContext); cleanup(jobContext.getConfiguration()); } }
@SuppressWarnings("unchecked") public void testAbort() throws IOException, InterruptedException { Job job = Job.getInstance(); FileOutputFormat.setOutputPath(job, outDir); Configuration conf = job.getConfiguration(); conf.set(MRJobConfig.TASK_ATTEMPT_ID, attempt); JobContext jContext = new JobContextImpl(conf, taskID.getJobID()); TaskAttemptContext tContext = new TaskAttemptContextImpl(conf, taskID); FileOutputCommitter committer = new FileOutputCommitter(outDir, tContext); // do setup committer.setupJob(jContext); committer.setupTask(tContext); // write output TextOutputFormat theOutputFormat = new TextOutputFormat(); RecordWriter theRecordWriter = theOutputFormat.getRecordWriter(tContext); writeOutput(theRecordWriter, tContext); // do abort committer.abortTask(tContext); File expectedFile = new File(new Path(committer.getWorkPath(), partFile) .toString()); assertFalse("task temp dir still exists", expectedFile.exists()); committer.abortJob(jContext, JobStatus.State.FAILED); expectedFile = new File(new Path(outDir, FileOutputCommitter.TEMP_DIR_NAME) .toString()); assertFalse("job temp dir still exists", expectedFile.exists()); assertEquals("Output directory not empty", 0, new File(outDir.toString()) .listFiles().length); FileUtil.fullyDelete(new File(outDir.toString())); }
super.abortJob(context, state);
super.abortJob(context, state);
committer.abortJob(jContext, JobStatus.State.FAILED); } catch (IOException ie) { th = ie;
@Override public void abortJob(JobContext context, int runState) throws IOException { JobStatus.State state; if(runState == JobStatus.State.RUNNING.getValue()) { state = JobStatus.State.RUNNING; } else if(runState == JobStatus.State.SUCCEEDED.getValue()) { state = JobStatus.State.SUCCEEDED; } else if(runState == JobStatus.State.FAILED.getValue()) { state = JobStatus.State.FAILED; } else if(runState == JobStatus.State.PREP.getValue()) { state = JobStatus.State.PREP; } else if(runState == JobStatus.State.KILLED.getValue()) { state = JobStatus.State.KILLED; } else { throw new IllegalArgumentException(runState+" is not a valid runState."); } getWrapped(context).abortJob(context, state); }
@Override public void abortJob(JobContext context, int runState) throws IOException { JobStatus.State state; if(runState == JobStatus.State.RUNNING.getValue()) { state = JobStatus.State.RUNNING; } else if(runState == JobStatus.State.SUCCEEDED.getValue()) { state = JobStatus.State.SUCCEEDED; } else if(runState == JobStatus.State.FAILED.getValue()) { state = JobStatus.State.FAILED; } else if(runState == JobStatus.State.PREP.getValue()) { state = JobStatus.State.PREP; } else if(runState == JobStatus.State.KILLED.getValue()) { state = JobStatus.State.KILLED; } else { throw new IllegalArgumentException(runState+" is not a valid runState."); } getWrapped(context).abortJob(context, state); }
@Override public void abortJob(JobContext context, int runState) throws IOException { JobStatus.State state; if(runState == JobStatus.State.RUNNING.getValue()) { state = JobStatus.State.RUNNING; } else if(runState == JobStatus.State.SUCCEEDED.getValue()) { state = JobStatus.State.SUCCEEDED; } else if(runState == JobStatus.State.FAILED.getValue()) { state = JobStatus.State.FAILED; } else if(runState == JobStatus.State.PREP.getValue()) { state = JobStatus.State.PREP; } else if(runState == JobStatus.State.KILLED.getValue()) { state = JobStatus.State.KILLED; } else { throw new IllegalArgumentException(runState+" is not a valid runState."); } getWrapped(context).abortJob(context, state); }
@Override public void abortJob(JobContext context, int runState) throws IOException { JobStatus.State state; if(runState == JobStatus.State.RUNNING.getValue()) { state = JobStatus.State.RUNNING; } else if(runState == JobStatus.State.SUCCEEDED.getValue()) { state = JobStatus.State.SUCCEEDED; } else if(runState == JobStatus.State.FAILED.getValue()) { state = JobStatus.State.FAILED; } else if(runState == JobStatus.State.PREP.getValue()) { state = JobStatus.State.PREP; } else if(runState == JobStatus.State.KILLED.getValue()) { state = JobStatus.State.KILLED; } else { throw new IllegalArgumentException(runState+" is not a valid runState."); } getWrapped(context).abortJob(context, state); }
assertFalse("task temp dir still exists", expectedFile.exists()); committer.abortJob(jContext, JobStatus.State.FAILED); expectedFile = new File(new Path(outDir, FileOutputCommitter.PENDING_DIR_NAME).toString()); assertFalse("job temp dir still exists", expectedFile.exists());
@SuppressWarnings("unchecked") public void testAbort() throws IOException, InterruptedException { Job job = Job.getInstance(); FileOutputFormat.setOutputPath(job, outDir); Configuration conf = job.getConfiguration(); conf.set(MRJobConfig.TASK_ATTEMPT_ID, attempt); JobContext jContext = new JobContextImpl(conf, taskID.getJobID()); TaskAttemptContext tContext = new TaskAttemptContextImpl(conf, taskID); FileOutputCommitter committer = new FileOutputCommitter(outDir, tContext); // do setup committer.setupJob(jContext); committer.setupTask(tContext); // write output TextOutputFormat theOutputFormat = new TextOutputFormat(); RecordWriter theRecordWriter = theOutputFormat.getRecordWriter(tContext); writeOutput(theRecordWriter, tContext); // do abort committer.abortTask(tContext); File expectedFile = new File(new Path(committer.getWorkPath(), partFile) .toString()); assertFalse("task temp dir still exists", expectedFile.exists()); committer.abortJob(jContext, JobStatus.State.FAILED); expectedFile = new File(new Path(outDir, FileOutputCommitter.PENDING_DIR_NAME) .toString()); assertFalse("job temp dir still exists", expectedFile.exists()); assertEquals("Output directory not empty", 0, new File(outDir.toString()) .listFiles().length); FileUtil.fullyDelete(new File(outDir.toString())); }
committer.abortJob(jContext, JobStatus.State.FAILED); } catch (IOException ie) { th = ie;
committer.abortJob(jContext, JobStatus.State.FAILED); } catch (IOException ie) { th = ie;
super.abortJob(context, state); CarbonLoadModel loadModel = CarbonTableOutputFormat.getLoadModel(context.getConfiguration()); CarbonLoaderUtil.updateTableStatusForFailure(loadModel);