RecordWriter是将Map/Reduce结果(Key-Value)输出到文件系统中。

/**
 * <code>RecordWriter</code> writes the output &lt;key, value&gt; pairs 
 * to an output file.
 
 * <p><code>RecordWriter</code> implementations write the job outputs to the
 * {@link FileSystem}.
 * 
 * @see OutputFormat
 */
@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract class RecordWriter<K, V> {
  /** 
   * Writes a key/value pair.
   * 将Map/Reduce结果的key/value写到文件系统中去。
   * @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;
}

 

相关文章:

  • 2022-12-23
  • 2021-10-16
  • 2021-12-04
  • 2021-10-06
  • 2021-12-16
  • 2021-08-07
  • 2022-01-25
猜你喜欢
  • 2021-05-29
  • 2022-12-23
  • 2021-12-02
  • 2021-12-02
  • 2021-11-05
  • 2022-01-28
  • 2022-12-23
相关资源
相似解决方案