Class ExternalRefSorter

    • Constructor Detail

      • ExternalRefSorter

        public ExternalRefSorter​(OfflineSorter sorter)
                          throws java.io.IOException
        Will buffer all sequences to a temporary file and then sort (all on-disk).
        Throws:
        java.io.IOException
    • Method Detail

      • add

        public void add​(BytesRef utf8)
                 throws java.io.IOException
        Description copied from interface: BytesRefSorter
        Adds a single suggestion entry (possibly compound with its bucket).
        Specified by:
        add in interface BytesRefSorter
        Throws:
        java.io.IOException - If an I/O exception occurs.
      • closeWriter

        private void closeWriter()
                          throws java.io.IOException
        Close the writer but leave any sorted output for iteration.
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Close the writer and remove any temporary files.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException
      • getComparator

        public java.util.Comparator<BytesRef> getComparator()
        Description copied from interface: BytesRefSorter
        Comparator used to determine the sort order of entries.
        Specified by:
        getComparator in interface BytesRefSorter
        Returns:
        Return the Comparator of the OfflineSorter used to sort byte sequences.