public class ExternalRefSorter extends java.lang.Object implements BytesRefSorter, java.io.Closeable
| Constructor and Description |
|---|
ExternalRefSorter(Sort sort)
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.
|
java.util.Comparator<BytesRef> |
getComparator() |
BytesRefIterator |
iterator()
Sorts the entries added in
BytesRefSorter.add(BytesRef) and returns
an iterator over all sorted entries. |
public ExternalRefSorter(Sort sort) throws java.io.IOException
java.io.IOExceptionpublic void add(BytesRef utf8) throws java.io.IOException
BytesRefSorteradd in interface BytesRefSorterjava.io.IOException - If an I/O exception occurs.public BytesRefIterator iterator() throws java.io.IOException
BytesRefSorterBytesRefSorter.add(BytesRef) and returns
an iterator over all sorted entries.iterator in interface BytesRefSorterjava.io.IOException - If an I/O exception occurs.public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOExceptionpublic java.util.Comparator<BytesRef> getComparator()
getComparator in interface BytesRefSorterCopyright © 2000-2022 Apache Software Foundation. All Rights Reserved.