public class BufferedExternalSorter
extends java.lang.Object
Sorter
that will use in memory sorting until the values can't fit into memory and will
then fall back to external sorting.Modifier and Type | Class and Description |
---|---|
static class |
BufferedExternalSorter.Options
Contains configuration for the sorter.
|
Modifier and Type | Method and Description |
---|---|
void |
add(KV<byte[],byte[]> record)
Adds a given record to the sorter.
|
static BufferedExternalSorter |
create(BufferedExternalSorter.Options options) |
static BufferedExternalSorter.Options |
options() |
java.lang.Iterable<KV<byte[],byte[]>> |
sort()
Sorts the added elements and returns an
Iterable over the sorted elements. |
public static BufferedExternalSorter.Options options()
public static BufferedExternalSorter create(BufferedExternalSorter.Options options)
public void add(KV<byte[],byte[]> record) throws java.io.IOException
Records can only be added before calling sort()
.
java.io.IOException
public java.lang.Iterable<KV<byte[],byte[]>> sort() throws java.io.IOException
Iterable
over the sorted elements.
Can be called at most once.
java.io.IOException