public class ExternalRefSorter extends Object implements BytesRefSorter, 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(org.apache.lucene.util.BytesRef utf8)
Adds a single suggestion entry (possibly compound with its bucket).
|
void |
close()
Removes any written temporary files.
|
Comparator<org.apache.lucene.util.BytesRef> |
getComparator() |
org.apache.lucene.util.BytesRefIterator |
iterator()
Sorts the entries added in
BytesRefSorter.add(BytesRef) and returns
an iterator over all sorted entries. |
public ExternalRefSorter(Sort sort) throws IOException
IOExceptionpublic void add(org.apache.lucene.util.BytesRef utf8)
throws IOException
BytesRefSorteradd in interface BytesRefSorterIOException - If an I/O exception occurs.public org.apache.lucene.util.BytesRefIterator iterator()
throws IOException
BytesRefSorterBytesRefSorter.add(BytesRef) and returns
an iterator over all sorted entries.iterator in interface BytesRefSorterIOException - If an I/O exception occurs.public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic Comparator<org.apache.lucene.util.BytesRef> getComparator()
getComparator in interface BytesRefSorterCopyright © 2000-2015 Apache Software Foundation. All Rights Reserved.