Skip to main content

InvertedIndexCreator

Trait InvertedIndexCreator 

Source
pub trait InvertedIndexCreator: Send {
    // Required methods
    fn push_with_name_n(
        &mut self,
        index_name: &str,
        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 finish<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        writer: &'life1 mut dyn InvertedIndexWriter,
        bitmap_type: BitmapType,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided method
    fn push_with_name(
        &mut self,
        index_name: &str,
        value: Option<BytesRef<'_>>,
    ) -> bool { ... }
}
Expand description

InvertedIndexCreator provides functionality to construct an inverted index

Required Methods§

Source

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

Buffers n identical values for the named index. None values represent absence of data (null).

Returns true when buffered data exceeds the memory limit; the caller must then call InvertedIndexCreator::spill before pushing more. Pushing is 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 buffers that asked for it to external storage.

Source

fn finish<'life0, 'life1, 'async_trait>( &'life0 mut self, writer: &'life1 mut dyn InvertedIndexWriter, bitmap_type: BitmapType, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Finalizes the index creation process, ensuring all data is properly indexed and stored in the provided writer

Provided Methods§

Source

fn push_with_name( &mut self, index_name: &str, value: Option<BytesRef<'_>>, ) -> bool

Adds a value to the named index. A None value represents an absence of data (null)

It should be equivalent to calling push_with_name_n with n = 1

Implementors§