public class Sorter<T> extends IteratingSorter<T>
SortingState.Phase_cancelForException, _cancelRequest, _comparator, _config, _currentSortRound, _phase, _presortFileCount, _readerFactory, _sortRoundCount, _writerFactory| Constructor and Description |
|---|
Sorter() |
Sorter(SortConfig config) |
Sorter(SortConfig config,
DataReaderFactory<T> readerFactory,
DataWriterFactory<T> writerFactory,
Comparator<T> comparator) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
sort(DataReader<T> inputReader,
DataWriter<T> resultWriter)
Method that will perform full sort on input data read using given
DataReader, and written out using specified DataWriter. |
void |
sort(InputStream source,
OutputStream destination)
Method that will perform full sort on specified input, writing results
into specified destination.
|
protected Sorter<T> |
withComparator(Comparator<T> cmp) |
protected Sorter<T> |
withReaderFactory(DataReaderFactory<T> f) |
protected Sorter<T> |
withWriterFactory(DataWriterFactory<T> f) |
close, sort_calculateRoundCount, _checkForCancel, _checkForCancel, _createMergeReader, _merge, _merge, _presort, _rawComparator, _readMax, _writeAll, _writePresorted, cancel, cancel, cancel, getNumberOfPreSortFiles, getNumberOfSortRounds, getPhase, getSortRound, isCompleted, isPreSorting, isSorting, merge, mergepublic Sorter(SortConfig config, DataReaderFactory<T> readerFactory, DataWriterFactory<T> writerFactory, Comparator<T> comparator)
config - Configuration for the sorterreaderFactory - Factory used for creating readers for pre-sorted data;
as well as for input if an InputStream is passed as sourcewriterFactory - Factory used for creating writers for storing pre-sorted data;
as well as for results if an OutputStream is passed as destination.public Sorter()
public Sorter(SortConfig config)
protected Sorter<T> withReaderFactory(DataReaderFactory<T> f)
protected Sorter<T> withWriterFactory(DataWriterFactory<T> f)
protected Sorter<T> withComparator(Comparator<T> cmp)
public void sort(InputStream source, OutputStream destination) throws IOException
DataReaderFactory and DataWriterFactory configured
for this sorter.IOExceptionpublic boolean sort(DataReader<T> inputReader, DataWriter<T> resultWriter) throws IOException
DataReader, and written out using specified DataWriter.
Conversions to and from intermediate sort files is done
using DataReaderFactory and DataWriterFactory configured
for this sorter.IOExceptionCopyright © 2012-2014 FasterXML. All Rights Reserved.