org.apache.hadoop.mapred
Class MapTask.MapOutputBuffer.BlockingBuffer
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
java.io.DataOutputStream
org.apache.hadoop.mapred.MapTask.MapOutputBuffer.BlockingBuffer
- All Implemented Interfaces:
- Closeable, DataOutput, Flushable
- Enclosing class:
- MapTask.MapOutputBuffer<K,V>
protected class MapTask.MapOutputBuffer.BlockingBuffer
- extends DataOutputStream
Inner class managing the spill of serialized records to disk.
Method Summary |
int |
markRecord()
Mark end of record. |
protected void |
shiftBufferedKey()
Set position from last mark to end of writable buffer, then rewrite
the data between last mark and kvindex. |
Methods inherited from class java.io.DataOutputStream |
flush, size, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MapTask.MapOutputBuffer.BlockingBuffer
public MapTask.MapOutputBuffer.BlockingBuffer()
markRecord
public int markRecord()
- Mark end of record. Note that this is required if the buffer is to
cut the spill in the proper place.
shiftBufferedKey
protected void shiftBufferedKey()
throws IOException
- Set position from last mark to end of writable buffer, then rewrite
the data between last mark and kvindex.
This handles a special case where the key wraps around the buffer.
If the key is to be passed to a RawComparator, then it must be
contiguous in the buffer. This recopies the data in the buffer back
into itself, but starting at the beginning of the buffer. Note that
this method should only be called immediately after detecting
this condition. To call it at any other time is undefined and would
likely result in data loss or corruption.
- Throws:
IOException
- See Also:
markRecord()
Copyright © 2014 Apache Software Foundation. All Rights Reserved.