public class FSKeyedSortedMerger2 extends java.lang.Object implements Shuffle
Constructor and Description |
---|
FSKeyedSortedMerger2(long maxBytesInMemory,
long maxBytesToAFile,
java.lang.String dir,
java.lang.String opName,
MessageType kType,
MessageType dType,
java.util.Comparator kComparator,
int tar,
boolean groupByKey,
int parallelIOAllowance)
Create a key based sorted merger
|
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.Object key,
byte[] data,
int length)
Add the data to the file
|
void |
add(Tuple tuple)
Add the data to the file
|
void |
clean()
Cleanup the directories
|
RestorableIterator<java.lang.Object> |
readIterator()
This method gives the values
|
void |
run()
This method saves the data to file system
|
void |
switchToReading()
Switch to reading, we cannot add after this
|
public FSKeyedSortedMerger2(long maxBytesInMemory, long maxBytesToAFile, java.lang.String dir, java.lang.String opName, MessageType kType, MessageType dType, java.util.Comparator kComparator, int tar, boolean groupByKey, int parallelIOAllowance)
public void add(Tuple tuple)
public void add(java.lang.Object key, byte[] data, int length)
public void switchToReading()
Shuffle
switchToReading
in interface Shuffle
public void run()
public RestorableIterator<java.lang.Object> readIterator()
readIterator
in interface Shuffle