0
点赞
收藏
分享

微信扫一扫

RecordWriter 类详解

爱写作的小土豆 2022-01-26 阅读 65


​RecordWriter​​ 类详解【updating…】

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>RecordWriter</code> writes the output <key, value> pairs
* to an output file.
RecordWrite 写输出<k,v> 到一个输出文件中。

* RecordWriter implementations write the job outputs to the {@link FileSystem}.
RecordWrite 实现 job输出到FileSystem过程

*
* @see OutputFormat
*/
@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract class RecordWriter<K, V> {
/**
* Writes a key/value pair.
*
* @param key the key to write.
* @param value the value to write.
* @throws IOException
*/
public abstract void write(K key, V value ) throws IOException, InterruptedException;

/**
* Close this <code>RecordWriter</code> to future operations.
*
* @param context the context of the task
* @throws IOException
*/
public abstract void close(TaskAttemptContext context ) throws IOException, InterruptedException;
}



举报

相关推荐

0 条评论