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(org.apache.lucene.util.BytesRef utf8)
Adds a single suggestion entry (possibly compound with its bucket).
|
void |
close()
Removes any written temporary files.
|
java.util.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 java.io.IOException
java.io.IOException
public void add(org.apache.lucene.util.BytesRef utf8) throws java.io.IOException
BytesRefSorter
add
in interface BytesRefSorter
java.io.IOException
- If an I/O exception occurs.public org.apache.lucene.util.BytesRefIterator iterator() throws java.io.IOException
BytesRefSorter
BytesRefSorter.add(BytesRef)
and returns
an iterator over all sorted entries.iterator
in interface BytesRefSorter
java.io.IOException
- If an I/O exception occurs.public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
public java.util.Comparator<org.apache.lucene.util.BytesRef> getComparator()
getComparator
in interface BytesRefSorter
Copyright © 2000-2023 Apache Software Foundation. All Rights Reserved.