Trait Materializer

Source
pub trait Materializer {
    type PageFrag;
    type Recovery;

    // Required methods
    fn merge(&self, _: &[&Self::PageFrag]) -> Self::PageFrag;
    fn recover(&self, _: &Self::PageFrag) -> Option<Self::Recovery>;
}
Expand description

lock-free pagecache A user of a PageCache needs to provide a Materializer which handles the merging of page fragments.

Required Associated Types§

Source

type PageFrag

The possibly fragmented page, written to log storage sequentially, and read in parallel from multiple locations on disk when serving a request to read the page. These will be merged to a single version at read time, and possibly cached.

Source

type Recovery

The state returned by a call to PageCache::recover, as described by Materializer::recover

Required Methods§

Source

fn merge(&self, _: &[&Self::PageFrag]) -> Self::PageFrag

Used to compress long chains of partial pages into a condensed form during compaction.

Source

fn recover(&self, _: &Self::PageFrag) -> Option<Self::Recovery>

Used to feed custom recovery information back to a higher-level abstraction during startup. For example, a B-Link tree must know what the current root node is before it can start serving requests.

Implementors§