org.apache.hadoop.mapred
Class MapTask.MapOutputBuffer<K,V>

java.lang.Object
  extended by 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 java.lang.Object
implements MapOutputCollector<K,V>, org.apache.hadoop.util.IndexedSortable


Nested Class Summary
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
MapTask.MapOutputBuffer()
           
 
Method Summary
 void close()
           
 void collect(K key, V value, int partition)
           
 int compare(int i, int j)
          Compare logical range, st i, j MOD offset capacity.
 void flush()
           
 void init(MapOutputCollector.Context context)
           
 void swap(int i, int j)
          Swap logical indices st i, j MOD offset capacity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapTask.MapOutputBuffer

public MapTask.MapOutputBuffer()
Method Detail

init

public void init(MapOutputCollector.Context context)
          throws java.io.IOException,
                 java.lang.ClassNotFoundException
Specified by:
init in interface MapOutputCollector<K,V>
Throws:
java.io.IOException
java.lang.ClassNotFoundException

collect

public void collect(K key,
                    V value,
                    int partition)
             throws java.io.IOException
Specified by:
collect in interface MapOutputCollector<K,V>
Throws:
java.io.IOException

compare

public int compare(int i,
                   int j)
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 i,
                 int j)
Swap logical indices st i, j MOD offset capacity.

Specified by:
swap in interface org.apache.hadoop.util.IndexedSortable
See Also:
IndexedSortable.swap(int, int)

flush

public void flush()
           throws java.io.IOException,
                  java.lang.ClassNotFoundException,
                  java.lang.InterruptedException
Specified by:
flush in interface MapOutputCollector<K,V>
Throws:
java.io.IOException
java.lang.ClassNotFoundException
java.lang.InterruptedException

close

public void close()
Specified by:
close in interface MapOutputCollector<K,V>


Copyright © 2009 The Apache Software Foundation