org.apache.hadoop.mapred

## Class MapTask.MapOutputBuffer<K,V>

- java.lang.Object
- - org.apache.hadoop.mapred.MapTask.MapOutputBuffer<K,V>

- All Implemented Interfaces:
    MapOutputCollector<K,V>, org.apache.hadoop.util.IndexedSortable
  Enclosing class:
    MapTask

      @InterfaceAudience.LimitedPrivate(value="MapReduce")
       @InterfaceStability.Unstable
      public static class MapTask.MapOutputBuffer<K,V>
      extends Object
      implements MapOutputCollector<K,V>, org.apache.hadoop.util.IndexedSortable

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected class` | `MapTask.MapOutputBuffer.BlockingBuffer` Inner class managing the spill of serialized records to disk.
    `class` | `MapTask.MapOutputBuffer.Buffer`
    `protected class` | `MapTask.MapOutputBuffer.InMemValBytes` Inner class wrapping valuebytes, used for appendRaw.
    `protected class` | `MapTask.MapOutputBuffer.MRResultIterator`
    `protected class` | `MapTask.MapOutputBuffer.SpillThread`

    - ### Nested classes/interfaces inherited from interface org.apache.hadoop.mapred.MapOutputCollector

      `MapOutputCollector.Context`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MapOutputBuffer()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `void` | `collect(K key, V value, int partition)` Serialize the key, value to intermediate storage.
    `int` | `compare(int mi, int mj)` Compare logical range, st i, j MOD offset capacity.
    `void` | `flush()`
    `void` | `init(MapOutputCollector.Context context)`
    `void` | `swap(int mi, int mj)` Swap metadata for items i, j

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MapOutputBuffer

          public MapOutputBuffer()

  - ### Method Detail

    - #### init

          public void init(MapOutputCollector.Context context)
                    throws IOException,
                           ClassNotFoundException

      Specified by:
        `init` in interface `MapOutputCollector<K,V>`
      Throws:
        `IOException`
        `ClassNotFoundException`

    - #### collect

          public void collect(K key,
                              V value,
                              int partition)
                       throws IOException

      Serialize the key, value to intermediate storage. When this method returns, kvindex must refer to sufficient unused storage to store one METADATA.
      Specified by:
        `collect` in interface `MapOutputCollector<K,V>`
      Throws:
        `IOException`

    - #### compare

          public int compare(int mi,
                             int mj)

      Compare logical range, st i, j MOD offset capacity. Compare by partition, then by key.
      Specified by:
        `compare` in interface `org.apache.hadoop.util.IndexedSortable`
      See Also:
        `IndexedSortable.compare(int, int)`

    - #### swap

          public void swap(int mi,
                           int mj)

      Swap metadata for items i, j
      Specified by:
        `swap` in interface `org.apache.hadoop.util.IndexedSortable`
      See Also:
        `IndexedSortable.swap(int, int)`

    - #### flush

          public void flush()
                     throws IOException,
                            ClassNotFoundException,
                            InterruptedException

      Specified by:
        `flush` in interface `MapOutputCollector<K,V>`
      Throws:
        `IOException`
        `ClassNotFoundException`
        `InterruptedException`

    - #### close

          public void close()

      Specified by:
        `close` in interface `MapOutputCollector<K,V>`

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.