pub struct ExternalSort { /* private fields */ }Expand description
External merge sort for out-of-core sorting.
Manages sorted runs on disk and provides k-way merge.
Implementations§
Source§impl ExternalSort
impl ExternalSort
Sourcepub fn new(
manager: Arc<SpillManager>,
num_columns: usize,
sort_keys: Vec<SortKey>,
) -> Self
pub fn new( manager: Arc<SpillManager>, num_columns: usize, sort_keys: Vec<SortKey>, ) -> Self
Creates a new external sort.
Sourcepub fn total_rows(&self) -> usize
pub fn total_rows(&self) -> usize
Returns the total number of rows across all runs.
Sourcepub fn spill_sorted_run(&mut self, rows: Vec<Vec<Value>>) -> Result<()>
pub fn spill_sorted_run(&mut self, rows: Vec<Vec<Value>>) -> Result<()>
Spills an already-sorted buffer as a run to disk.
The buffer must already be sorted according to the sort keys.
§Errors
Returns an error if writing to disk fails.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ExternalSort
impl !RefUnwindSafe for ExternalSort
impl Send for ExternalSort
impl Sync for ExternalSort
impl Unpin for ExternalSort
impl !UnwindSafe for ExternalSort
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more