Skip to main content

Sorter

Trait Sorter 

Source
pub trait Sorter: Send {
    // Required methods
    fn push_n(&mut self, value: Option<BytesRef<'_>>, n: usize) -> bool;
    fn spill<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn output<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<SortOutput>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Handles data sorting, supporting incremental input and retrieval of sorted output

Required Methods§

Source

fn push_n(&mut self, value: Option<BytesRef<'_>>, n: usize) -> bool

Buffers n identical non-null or null values in memory.

Returns true when the buffer should be spilled with Sorter::spill before more values are pushed. Kept synchronous so the per-row path does not allocate a future.

Source

fn spill<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Moves the in-memory buffer to external storage.

Source

fn output<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<SortOutput>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Completes the sorting process and returns the sorted data

Implementors§