Hadoop 源码详解之FileOutputFormat 类
1. 类释义
A base class for OutputFormats that read from FileSystems.
一个类从FileSystems读取 用于OutputFormats【实在翻译不好 _ 】
2. 类源码
3. 方法详解
3.1 setOutputPath()
Set the Path of the output directory for the map-reduce job.
为map-reducejob设置输出目录。
public static void setOutputPath(Job job, Path outputDir) {
try {
outputDir = outputDir.getFileSystem(job.getConfiguration()).makeQualified(
outputDir);
} catch (IOException e) {
// Throw the IOException as a RuntimeException to be compatible with MR1
throw new RuntimeException(e);
}
job.getConfiguration().set(FileOutputFormat.OUTDIR, outputDir.toString());
}
可以看到的是,这里的 setOutputPath()并没有使用一个文件列表组为输出目录。而文件输入路径则可以是一个文件列表。详见 FileInputFormat类
最后
以上就是温暖河马最近收集整理的关于Hadoop源码详解之FileOutputFormat 类的全部内容,更多相关Hadoop源码详解之FileOutputFormat内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复