LayoutReader

Trait LayoutReader 

Source
pub trait LayoutReader: Debug + Send {
    // Required methods
    fn add_splits(
        &self,
        row_offset: usize,
        splits: &mut BTreeSet<usize>,
    ) -> VortexResult<()>;
    fn read_selection(
        &mut self,
        selector: &RowMask,
    ) -> VortexResult<Option<BatchRead>>;
}
Expand description

A reader for a layout, a serialized sequence of Vortex arrays.

Some layouts are horizontally divisble: they can read a sub-sequence of rows independently of other sub-sequences. A layout advertises its sub-divisions in its add_splits method. Any layout which is or contains a chunked layout is horizontally divisble.

The read_selection method accepts and applies a RowMask, reading only the sub-divisions which contain the selected (i.e. masked) rows.

Required Methods§

Source

fn add_splits( &self, row_offset: usize, splits: &mut BTreeSet<usize>, ) -> VortexResult<()>

Register all horizontal row boundaries of this layout.

Layout should register all indivisible absolute row boundaries of the data stored in itself and its children. row_offset gives the relative row position of this layout to the beginning of the file.

Source

fn read_selection( &mut self, selector: &RowMask, ) -> VortexResult<Option<BatchRead>>

Reads the data from the underlying layout within given selection

Layout is required to return all data for given selection in one batch. Layout can either return a batch of data (i.e., an Array) or ask for more layout messages to be read. When requesting messages to be read the caller should populate the message cache used when creating the invoked instance of this trait and then call back into this function.

The layout is finished producing data for selection when it returns None

Implementors§