pub struct BufferPool { /* private fields */ }Expand description
Thread-safe buffer pool with CLOCK eviction.
Implementations§
Source§impl BufferPool
impl BufferPool
Sourcepub fn fetch_page(
&self,
page_id: PageId,
pm: &mut PageManager,
) -> MenteResult<Box<Page>>
pub fn fetch_page( &self, page_id: PageId, pm: &mut PageManager, ) -> MenteResult<Box<Page>>
Fetch a page into the pool (loading from disk if necessary).
The page is automatically pinned (pin_count incremented).
Caller must call unpin_page when done.
Sourcepub fn pin_page(&self, page_id: PageId) -> MenteResult<()>
pub fn pin_page(&self, page_id: PageId) -> MenteResult<()>
Increment the pin count of a page already in the pool.
Sourcepub fn unpin_page(&self, page_id: PageId, dirty: bool) -> MenteResult<()>
pub fn unpin_page(&self, page_id: PageId, dirty: bool) -> MenteResult<()>
Decrement pin count and optionally mark the page dirty.
Sourcepub fn update_page(&self, page_id: PageId, page: &Page) -> MenteResult<()>
pub fn update_page(&self, page_id: PageId, page: &Page) -> MenteResult<()>
Replace the cached copy of a page and mark it dirty.
Sourcepub fn flush_page(
&self,
page_id: PageId,
pm: &mut PageManager,
) -> MenteResult<()>
pub fn flush_page( &self, page_id: PageId, pm: &mut PageManager, ) -> MenteResult<()>
Flush a single dirty page to disk.
Sourcepub fn flush_all(&self, pm: &mut PageManager) -> MenteResult<()>
pub fn flush_all(&self, pm: &mut PageManager) -> MenteResult<()>
Flush all dirty pages to disk.
Auto Trait Implementations§
impl !Freeze for BufferPool
impl !RefUnwindSafe for BufferPool
impl Send for BufferPool
impl Sync for BufferPool
impl Unpin for BufferPool
impl UnsafeUnpin for BufferPool
impl UnwindSafe for BufferPool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more