Struct rsdb::PageCache
[−]
[src]
pub struct PageCache<PM, L, P, R> { /* fields omitted */ }
A lock-free pagecache.
Methods
impl<PM, P, R> PageCache<PM, LockFreeLog, P, R> where
PM: Materializer<PartialPage = P, Recovery = R>,
PM: Send + Sync,
P: Debug + PartialEq + Clone + Serialize + DeserializeOwned + Send,
R: Debug + PartialEq + Clone + Serialize + DeserializeOwned,
PM::MaterializedPage: Debug,
[src]
PM: Materializer<PartialPage = P, Recovery = R>,
PM: Send + Sync,
P: Debug + PartialEq + Clone + Serialize + DeserializeOwned + Send,
R: Debug + PartialEq + Clone + Serialize + DeserializeOwned,
PM::MaterializedPage: Debug,
fn new(pm: PM, config: Config) -> PageCache<PM, LockFreeLog, P, R>
Instantiate a new PageCache
.
fn config(&self) -> &Config
Return the configuration used by the underlying system.
fn recover(&mut self) -> Option<R>
Read updates from the log, apply them to our pagecache.
fn allocate(&self) -> (usize, CasKey<P>)
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<(PM::MaterializedPage, CasKey<P>)>
Try to retrieve a page by its logical ID.
fn replace(
&self,
pid: usize,
old: CasKey<P>,
new: Vec<P>
) -> Result<CasKey<P>, CasKey<P>>
&self,
pid: usize,
old: CasKey<P>,
new: Vec<P>
) -> Result<CasKey<P>, CasKey<P>>
Replace an existing page with a different set of PartialPage
s.
fn prepend(
&self,
pid: usize,
old: CasKey<P>,
new: P
) -> Result<CasKey<P>, CasKey<P>>
&self,
pid: usize,
old: CasKey<P>,
new: P
) -> Result<CasKey<P>, CasKey<P>>
Try to atomically prepend a Materializer::PartialPage
to the page.
Trait Implementations
impl<PM, L, P, R> Drop for PageCache<PM, L, P, R>
[src]
impl<PM, L, P, R> Send for PageCache<PM, L, P, R> where
PM: Send,
L: Send,
R: Send,
[src]
PM: Send,
L: Send,
R: Send,
impl<PM, L, P, R> Sync for PageCache<PM, L, P, R> where
PM: Sync,
L: Sync,
[src]
PM: Sync,
L: Sync,