public class FSKeyedSortedMerger extends java.lang.Object implements Shuffle
Constructor and Description |
---|
FSKeyedSortedMerger(int maxBytesInMemory,
int maxRecsInMemory,
java.lang.String dir,
java.lang.String opName,
MessageType kType,
MessageType dType,
java.util.Comparator<java.lang.Object> kComparator,
int tar)
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 |
clean()
Cleanup the directories
|
java.util.Iterator<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 FSKeyedSortedMerger(int maxBytesInMemory, int maxRecsInMemory, java.lang.String dir, java.lang.String opName, MessageType kType, MessageType dType, java.util.Comparator<java.lang.Object> kComparator, int tar)
public void add(java.lang.Object key, byte[] data, int length)
public void switchToReading()
Shuffle
switchToReading
in interface Shuffle
public void run()
public java.util.Iterator<java.lang.Object> readIterator()
readIterator
in interface Shuffle