public abstract class ExternalSorter
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ExternalSorter.Options
ExternalSorter.Options contains configuration of the sorter. |
Modifier and Type | Field and Description |
---|---|
protected ExternalSorter.Options |
options |
Modifier and Type | Method and Description |
---|---|
void |
add(KV<byte[],byte[]> record)
Adds a given record to the sorter.
|
static ExternalSorter |
create(ExternalSorter.Options options)
Returns a
Sorter configured with the given ExternalSorter.Options . |
java.lang.Iterable<KV<byte[],byte[]>> |
sort()
Sorts the added elements and returns an
Iterable over the sorted elements. |
protected final ExternalSorter.Options options
public static ExternalSorter create(ExternalSorter.Options options)
Sorter
configured with the given ExternalSorter.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