/// <exception cref="System.Exception"/> private void TestMapFileOutputCommitterInternal(int version) { JobConf conf = new JobConf(); FileOutputFormat.SetOutputPath(conf, outDir); conf.Set(JobContext.TaskAttemptId, attempt); conf.SetInt(FileOutputCommitter.FileoutputcommitterAlgorithmVersion, version); JobContext jContext = new JobContextImpl(conf, ((JobID)taskID.GetJobID())); TaskAttemptContext tContext = new TaskAttemptContextImpl(conf, taskID); FileOutputCommitter committer = new FileOutputCommitter(); // setup committer.SetupJob(jContext); committer.SetupTask(tContext); // write output MapFileOutputFormat theOutputFormat = new MapFileOutputFormat(); RecordWriter theRecordWriter = theOutputFormat.GetRecordWriter(null, conf, partFile , null); WriteMapFileOutput(theRecordWriter, tContext); // do commit if (committer.NeedsTaskCommit(tContext)) { committer.CommitTask(tContext); } committer.CommitJob(jContext); // validate output ValidateMapFileOutputContent(FileSystem.Get(conf), outDir); FileUtil.FullyDelete(new FilePath(outDir.ToString())); }
/// <summary>Open the output generated by this format.</summary> /// <exception cref="System.IO.IOException"/> public static MapFile.Reader[] GetReaders(FileSystem ignored, Path dir, Configuration conf) { return(MapFileOutputFormat.GetReaders(dir, conf)); }