Struct rsdb::PageCache
[−]
[src]
pub struct PageCache<L: Log, M> where
M: Materializer + Sized,
L: Log + Sized, { /* fields omitted */ }
A lock-free pagecache.
Methods
impl<M> PageCache<LockFreeLog, M> where
M: Materializer,
M::PartialPage: Clone,
[src]
M: Materializer,
M::PartialPage: Clone,
fn new(pm: M, config: Config) -> PageCache<LockFreeLog, M>
Instantiate a new PageCache
.
fn config(&self) -> Config
Return the configuration used by the underlying system.
fn recover(&mut self, from: u64) -> Option<M::Recovery>
Read updates from the log, apply them to our pagecache.
fn allocate(&self) -> (usize, *const Node<*const M::PartialPage>)
Create a new page, trying to reuse old freed pages if possible
to maximize underlying Radix
pointer density.
fn free(&self, pid: usize)
Free a particular page.
fn get(
&self,
pid: usize
) -> Option<(M::MaterializedPage, *const Node<*const M::PartialPage>)>
&self,
pid: usize
) -> Option<(M::MaterializedPage, *const Node<*const M::PartialPage>)>
Try to retrieve a page by its logical ID.
fn append(
&self,
pid: usize,
old: *const Node<*const M::PartialPage>,
new: M::PartialPage
) -> Result<*const Node<*const M::PartialPage>, *const Node<*const M::PartialPage>>
&self,
pid: usize,
old: *const Node<*const M::PartialPage>,
new: M::PartialPage
) -> Result<*const Node<*const M::PartialPage>, *const Node<*const M::PartialPage>>
Try to atomically append a Materializer::PartialPage
to the page.