pub struct BufferPool {
pub internal_buffer: HashMap<BTreePageID, Rc<RefCell<BTreeInternalPage>>>,
pub leaf_buffer: HashMap<BTreePageID, Rc<RefCell<BTreeLeafPage>>>,
/* private fields */
}
Fields§
§internal_buffer: HashMap<BTreePageID, Rc<RefCell<BTreeInternalPage>>>
§leaf_buffer: HashMap<BTreePageID, Rc<RefCell<BTreeLeafPage>>>
Implementations§
Source§impl BufferPool
impl BufferPool
pub fn global() -> &'static mut Self
pub fn clear(&mut self)
pub fn get_internal_page( &mut self, key: &BTreePageID, ) -> Result<Rc<RefCell<BTreeInternalPage>>>
pub fn get_leaf_page( &mut self, key: &BTreePageID, ) -> Result<Rc<RefCell<BTreeLeafPage>>>
pub fn get_root_pointer_page( &mut self, key: &BTreePageID, ) -> Result<Rc<RefCell<BTreeRootPointerPage>>>
pub fn set_page_size(page_size: usize)
pub fn rows_per_page(scheme: &TupleScheme) -> usize
pub fn children_per_page() -> usize
pub fn get_page_size() -> usize
Sourcepub fn insert_tuple(&mut self, table_id: i32, t: Tuple)
pub fn insert_tuple(&mut self, table_id: i32, t: Tuple)
Add a tuple to the specified table on behalf of transaction tid. Will acquire a write lock on the page the tuple is added to and any other pages that are updated (Lock acquisition is not needed for lab2). May block if the lock(s) cannot be acquired.
Marks any pages that were dirtied by the operation as dirty by calling their markDirty bit, and adds versions of any pages that have been dirtied to the cache (replacing any existing versions of those pages) so that future requests see up-to-date pages.
Auto Trait Implementations§
impl Freeze for BufferPool
impl !RefUnwindSafe for BufferPool
impl !Send for BufferPool
impl !Sync for BufferPool
impl Unpin 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