Skip to main content

FragmentedSource

Trait FragmentedSource 

Source
pub trait FragmentedSource: Send + Sync {
    type Key: Clone + Send + Sync + 'static;

    // Required methods
    fn fragments(&self) -> LadduDataResult<Vec<DataFragment<Self::Key>>>;
    fn read_fragment_range(
        &self,
        key: &Self::Key,
        local_start: usize,
        local_len: usize,
        chunk_size: Option<usize>,
    ) -> LadduDataResult<EventBatchIter>;
}
Expand description

Event source composed of independently addressable fragments.

Required Associated Types§

Source

type Key: Clone + Send + Sync + 'static

Source-specific fragment key.

Required Methods§

Source

fn fragments(&self) -> LadduDataResult<Vec<DataFragment<Self::Key>>>

Lists all fragments in global row order.

§Errors

Returns LadduDataError when fragment metadata cannot be read.

Source

fn read_fragment_range( &self, key: &Self::Key, local_start: usize, local_len: usize, chunk_size: Option<usize>, ) -> LadduDataResult<EventBatchIter>

Reads a contiguous range within one fragment.

§Errors

Returns LadduDataError when the key, range, or chunk size is invalid or fragment data cannot be read.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§