Trait rsdb::Materializer
[−]
[src]
pub trait Materializer { type MaterializedPage; type PartialPage; type Recovery; fn materialize(&self, _: &[Self::PartialPage]) -> Self::MaterializedPage; fn consolidate(&self, _: &[Self::PartialPage]) -> Vec<Self::PartialPage>; fn recover(&self, _: &Self::PartialPage) -> Option<Self::Recovery>; }
A tenant of a PageCache
needs to provide a Materializer
which
handles the processing of pages.
Associated Types
type MaterializedPage
The "complete" page, returned to clients who want to retrieve the logical page state.
type PartialPage
The "partial" page, written to log storage sequentially, and read in parallel from multiple locations on disk when serving a request to read the page.
type Recovery
The state returned by a call to PageCache::recover
, as
described by Materializer::recover
Required Methods
fn materialize(&self, _: &[Self::PartialPage]) -> Self::MaterializedPage
Used to generate the result of get
requests on the PageCache
fn consolidate(&self, _: &[Self::PartialPage]) -> Vec<Self::PartialPage>
Used to compress long chains of partial pages into a condensed form during compaction.
fn recover(&self, _: &Self::PartialPage) -> 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.