Struct BufferPool

Source
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

Source

pub fn global() -> &'static mut Self

Source

pub fn clear(&mut self)

Source

pub fn get_internal_page( &mut self, key: &BTreePageID, ) -> Result<Rc<RefCell<BTreeInternalPage>>>

Source

pub fn get_leaf_page( &mut self, key: &BTreePageID, ) -> Result<Rc<RefCell<BTreeLeafPage>>>

Source

pub fn get_root_pointer_page( &mut self, key: &BTreePageID, ) -> Result<Rc<RefCell<BTreeRootPointerPage>>>

Source

pub fn set_page_size(page_size: usize)

Source

pub fn rows_per_page(scheme: &TupleScheme) -> usize

Source

pub fn children_per_page() -> usize

Source

pub fn get_page_size() -> usize

Source

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.