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
Method Summary |
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 |
MapTask.MapOutputBuffer
public MapTask.MapOutputBuffer()
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 © 2014 Apache Software Foundation. All Rights Reserved.