MemoryMappedMetric

Trait MemoryMappedMetric 

Source
pub trait MemoryMappedMetric<T> {
    type State;

    // Required methods
    fn init_state(&self) -> Self::State;
    fn process_chunk(
        &self,
        state: &mut Self::State,
        chunkidx: usize,
        chunk: &[T],
    ) -> Result<()>;
    fn finalize(&self, state: &Self::State) -> Result<f64>;
}
Expand description

Trait for memory-mapped metrics computation

This trait allows metrics to be computed on very large datasets that don’t fit in memory by processing them in a streaming fashion.

Required Associated Types§

Source

type State

Type for intermediate state

Required Methods§

Source

fn init_state(&self) -> Self::State

Initialize the state

Source

fn process_chunk( &self, state: &mut Self::State, chunkidx: usize, chunk: &[T], ) -> Result<()>

Process a chunk of data

Source

fn finalize(&self, state: &Self::State) -> Result<f64>

Finalize the computation

Implementors§