OutputFormat 源码详解
源码 详解
2023-09-14 09:13:17 时间
OutputFormat
源码详解
1. 源码
package org.apache.hadoop.mapreduce;
import java.io.IOException;
import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability;
import org.apache.hadoop.fs.FileSystem;
/**
* <code>OutputFormat</code> describes the output-specification for a
* Map-Reduce job.
OutputFormat 描述了指定的输出对于一个Map-Reduce job。
*
* <p>The Map-Reduce framework relies on the <code>OutputFormat</code> of the
* job to:<p>
* <ol>
* <li>
* Validate the output-specification of the job. For e.g. check that the
* output directory doesn't already exist.
* <li>
* Provide the {@link RecordWriter} implementation to be used to write out
* the output files of the job. Output files are stored in a
* {@link FileSystem}.
* </li>
* </ol>
*
* @see RecordWriter
*/
@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract class OutputFormat<K, V> {
/**
* Get the {@link RecordWriter} for the given task.
*
* @param context the information about the current task.
* @return a {@link RecordWriter} to write the output for the job.
* @throws IOException
*/
public abstract RecordWriter<K, V>
getRecordWriter(TaskAttemptContext context
) throws IOException, InterruptedException;
/**
* Check for validity of the output-specification for the job.
*
* <p>This is to validate the output specification for the job when it is
* a job is submitted. Typically checks that it does not already exist,
* throwing an exception when it already exists, so that output is not
* overwritten.</p>
*
* @param context information about the job
* @throws IOException when output should not be attempted
*/
public abstract void checkOutputSpecs(JobContext context
) throws IOException,
InterruptedException;
/**
* Get the output committer for this output format. This is responsible
* for ensuring the output is committed correctly.
* @param context the task context
* @return an output committer
* @throws IOException
* @throws InterruptedException
*/
public abstract
OutputCommitter getOutputCommitter(TaskAttemptContext context
) throws IOException, InterruptedException;
}
相关文章
- Android源码解析--AlertDialog及AlertDialog.Builder
- 用python提取xml里面的链接源码
- Redis+Spring缓存实例(windows环境,附实例源码及详解)
- Android8.0 Settings源码 Preference详解
- LiteOS内核源码分析:位操作模块
- HTTP流量神器Goreplay核心源码详解
- 计算机毕设 SSM Vue的药品管理系统(含源码+论文)
- 【Android 逆向】整体加固脱壳 ( 脱壳起点 : 整体加固脱壳 | Dalvik 脱壳机制 : 利用 DexClassLoader 加载过程进行脱壳 | 相关源码分析 )
- SDL源码阅读笔记(2) video dirver的初始化及选择
- 面试官问我:看过sharding-jdbc的源码吗?我吧啦吧啦说了一通!!
- linux内核radeon gpu源码解析6 —— radeon_driver_load_kms函数详解1
- lnux下源码安装MySQL 5.6
- 姿态估计0-09:DenseFusion(6D姿态估计)-源码解析(5)-PoseRefineNet网络与loss详解(重点篇)
- detectron2(目标检测框架)无死角玩转-07:源码详解(3)-模型构建-RetinaNet为例
- detectron2(目标检测框架)无死角玩转-05:源码详解(1)-总体架构分析
- Hadoop 源码详解之InputFormat类
- 00 可综合风格的模块实例(附源码)
- 05 占空比可调的整数奇偶分频器设计与功能验证(附源码)