public class SortingLongCollection extends Object
Modifier and Type | Field | Description |
---|---|---|
static int |
MAX_ITEMS_IN_RAM |
|
static int |
SIZEOF |
Constructor | Description |
---|---|
SortingLongCollection(int maxValuesInRam,
File... tmpDir) |
Prepare to accumulate values to be sorted
|
SortingLongCollection(int maxValuesInRam,
Path... tmpDir) |
Prepare to accumulate values to be sorted
|
Modifier and Type | Method | Description |
---|---|---|
void |
add(long value) |
Add a value to the collection.
|
void |
cleanup() |
Delete any temporary files.
|
void |
doneAddingStartIteration() |
This method must be called after done adding, and before calling hasNext() or next().
|
boolean |
hasNext() |
Call only after doneAddingStartIteration() has been called.
|
long |
next() |
Call only if hasNext() == true.
|
public static final int SIZEOF
public static final int MAX_ITEMS_IN_RAM
public SortingLongCollection(int maxValuesInRam, File... tmpDir)
maxValuesInRam
- how many values to accumulate before spilling to disktmpDir
- Where to write files of values that will not fit in RAMpublic SortingLongCollection(int maxValuesInRam, Path... tmpDir)
maxValuesInRam
- how many values to accumulate before spilling to disktmpDir
- Where to write files of values that will not fit in RAMpublic void add(long value)
value
- public void doneAddingStartIteration()
public void cleanup()
public boolean hasNext()
public long next()