Struct ext_sort::sort::ExternalSorter [−][src]
pub struct ExternalSorter<T, E, B = LimitedBufferBuilder, C = RmpExternalChunk<T>> where
T: Ord + Send,
E: Error,
B: ChunkBufferBuilder<T>,
C: ExternalChunk<T>, { /* fields omitted */ }Expand description
External sorter.
Implementations
impl<T, E, B, C> ExternalSorter<T, E, B, C> where
T: Ord + Send,
E: Error,
B: ChunkBufferBuilder<T>,
C: ExternalChunk<T>,
impl<T, E, B, C> ExternalSorter<T, E, B, C> where
T: Ord + Send,
E: Error,
B: ChunkBufferBuilder<T>,
C: ExternalChunk<T>,
Creates a new external sorter instance.
Arguments
threads_number- Number of threads to be used to sort data in parallel. If the parameter isNonethreads number will be selected based on available CPU core number.tmp_path- Directory to be used to store temporary data. If paramater isNonedefault OS temporary directory will be used.buffer_builder- An instance of a buffer builder that will be used for chunk buffer creation.rw_buf_size- Chunks file read/write buffer size.
pub fn sort<I>(
&self,
input: I
) -> Result<BinaryHeapMerger<T, C::DeserializationError, C>, SortError<C::SerializationError, C::DeserializationError, E>> where
I: IntoIterator<Item = Result<T, E>>,
pub fn sort<I>(
&self,
input: I
) -> Result<BinaryHeapMerger<T, C::DeserializationError, C>, SortError<C::SerializationError, C::DeserializationError, E>> where
I: IntoIterator<Item = Result<T, E>>,
Sorts data from input using external sort algorithm. Returns an iterator that can be used to get sorted data stream.
