pub struct ExternalSort { /* private fields */ }Expand description
External sort operator
Implements memory-bounded sorting with disk spilling.
Implementations§
Source§impl ExternalSort
impl ExternalSort
Sourcepub fn new(controller: &Arc<MemoryController>) -> Self
pub fn new(controller: &Arc<MemoryController>) -> Self
Create a new external sort operator
Sourcepub fn with_config(
controller: &Arc<MemoryController>,
config: ExternalSortConfig,
) -> Self
pub fn with_config( controller: &Arc<MemoryController>, config: ExternalSortConfig, ) -> Self
Create with custom configuration
Sourcepub fn add_row(&mut self, row: Row, sort_keys: SortKey) -> Result<()>
pub fn add_row(&mut self, row: Row, sort_keys: SortKey) -> Result<()>
Add a row with its sort keys to the sort operator
May trigger a spill if memory is exhausted.
Sourcepub fn finish(self) -> Result<SortedIterator>
pub fn finish(self) -> Result<SortedIterator>
Finalize sorting and return an iterator over sorted results
This completes the sort phase and prepares for the merge phase.
Sourcepub fn total_rows(&self) -> usize
pub fn total_rows(&self) -> usize
Get total rows added
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