|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.mapred.BackupStore<K,V>
@InterfaceAudience.Private @InterfaceStability.Unstable public class BackupStore<K,V>
BackupStore
is an utility class that is used to support
the mark-reset functionality of values iterator
It has two caches - a memory cache and a file cache where values are stored as they are iterated, after a mark. On reset, values are retrieved from these caches. Framework moves from the memory cache to the file cache when the memory cache becomes full.
Constructor Summary | |
---|---|
BackupStore(org.apache.hadoop.conf.Configuration conf,
TaskAttemptID taskid)
|
Method Summary | |
---|---|
void |
clearMark()
|
void |
exitResetMode()
This function is called the ValuesIterator when a mark is called outside of a reset zone. |
DataOutputStream |
getOutputStream(int length)
For writing the first key and value bytes directly from the value iterators, pass the current underlying output stream |
boolean |
hasNext()
|
void |
mark()
|
void |
next()
|
org.apache.hadoop.io.DataInputBuffer |
nextKey()
|
org.apache.hadoop.io.DataInputBuffer |
nextValue()
|
void |
reinitialize()
|
void |
reset()
|
void |
updateCounters(int length)
This method is called by the valueIterators after writing the first key and value bytes to the BackupStore |
void |
write(org.apache.hadoop.io.DataInputBuffer key,
org.apache.hadoop.io.DataInputBuffer value)
Write the given K,V to the cache. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BackupStore(org.apache.hadoop.conf.Configuration conf, TaskAttemptID taskid) throws IOException
IOException
Method Detail |
---|
public void write(org.apache.hadoop.io.DataInputBuffer key, org.apache.hadoop.io.DataInputBuffer value) throws IOException
key
- value
-
IOException
public void mark() throws IOException
IOException
public void reset() throws IOException
IOException
public boolean hasNext() throws IOException
IOException
public void next() throws IOException
IOException
public org.apache.hadoop.io.DataInputBuffer nextValue()
public org.apache.hadoop.io.DataInputBuffer nextKey()
public void reinitialize() throws IOException
IOException
public void exitResetMode() throws IOException
IOException
public DataOutputStream getOutputStream(int length) throws IOException
length
- The length of the impending write
IOException
public void updateCounters(int length)
length
- public void clearMark() throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |