public class ExternalRefSorter extends Object implements BytesRefSorter, Closeable
Constructor and Description |
---|
ExternalRefSorter(OfflineSorter sorter)
Will buffer all sequences to a temporary file and then sort (all on-disk).
|
Modifier and Type | Method and Description |
---|---|
void |
add(BytesRef utf8)
Adds a single suggestion entry (possibly compound with its bucket).
|
void |
close()
Removes any written temporary files.
|
Comparator<BytesRef> |
getComparator()
Comparator used to determine the sort order of entries.
|
BytesRefIterator |
iterator()
Sorts the entries added in
BytesRefSorter.add(BytesRef) and returns
an iterator over all sorted entries. |
public ExternalRefSorter(OfflineSorter sorter) throws IOException
IOException
public void add(BytesRef utf8) throws IOException
BytesRefSorter
add
in interface BytesRefSorter
IOException
- If an I/O exception occurs.public BytesRefIterator iterator() throws IOException
BytesRefSorter
BytesRefSorter.add(BytesRef)
and returns
an iterator over all sorted entries.iterator
in interface BytesRefSorter
IOException
- If an I/O exception occurs.public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public Comparator<BytesRef> getComparator()
BytesRefSorter
getComparator
in interface BytesRefSorter
Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.