@InterfaceAudience.Private @InterfaceStability.Unstable public class BackupStore<K,V> extends Object
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 and Description |
---|
BackupStore(org.apache.hadoop.conf.Configuration conf,
TaskAttemptID taskid) |
Modifier and Type | Method and Description |
---|---|
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.
|
public BackupStore(org.apache.hadoop.conf.Configuration conf, TaskAttemptID taskid) throws IOException
IOException
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 writeIOException
public void updateCounters(int length)
length
- public void clearMark() throws IOException
IOException
Copyright © 2018 Apache Software Foundation. All Rights Reserved.