zoukankan      html  css  js  c++  java
  • RecordWriter接口解析

    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;
    }
  • 相关阅读:
    宜未雨而绸缪,毋临渴而掘井。
    JDBC fetch size
    社会主义核心价值观
    JavaEE
    《夜泊牛渚怀古》
    JAVA "GMT+10" 和 "GMT+0010"
    乡村振兴1
    申论 题好文一半
    UCOS时钟与中断:
    任务的状态-挂起和恢复
  • 原文地址:https://www.cnblogs.com/rolly-yan/p/3704159.html
Copyright © 2011-2022 走看看