pub struct BTreeInternalPage { /* private fields */ }Expand description
The internal page is used to store the keys and the page id of the children.
§Binary Layout
- 4 bytes: page category
- 4 bytes: parent page index
- 4 bytes: children category (leaf/internal)
- n bytes: header bytes, indicate whether every slot of the page is used or not.
- n bytes: keys
- n bytes: children
§Stable Criteria
count(used_slots) >= floor_dev(slot_count, 2)
Implementations§
Source§impl BTreeInternalPage
impl BTreeInternalPage
pub fn get_coresponding_entry( &self, left_pid: Option<&BTreePageID>, right_pid: Option<&BTreePageID>, ) -> Option<Entry>
pub fn stable(&self) -> bool
pub fn get_entry(&self, index: usize) -> Option<Entry>
pub fn delete_key_and_right_child(&mut self, record_id: usize)
pub fn delete_key_and_left_child(&mut self, record_id: usize)
pub fn update_entry(&mut self, entry: &Entry)
Sourcepub fn is_slot_used(&self, slot_index: usize) -> bool
pub fn is_slot_used(&self, slot_index: usize) -> bool
Returns true if associated slot on this page is filled.
pub fn get_child_pid(&self, _index: usize) -> Option<BTreePageID>
pub fn get_first_child_pid(&self) -> BTreePageID
pub fn get_last_child_pid(&self) -> BTreePageID
pub fn get_left_sibling_pid(&self, tx: &Transaction) -> Option<BTreePageID>
pub fn get_right_sibling_pid(&self, tx: &Transaction) -> Option<BTreePageID>
pub fn get_entry_by_children( &self, left_pid: &BTreePageID, right_pid: &BTreePageID, ) -> Option<Entry>
pub fn check_integrity( &self, parent_pid: &BTreePageID, lower_bound: Option<IntField>, upper_bound: Option<IntField>, check_occupancy: bool, depth: usize, )
Source§impl BTreeInternalPage
impl BTreeInternalPage
pub fn insert_entry(&mut self, e: &Entry) -> SmallResult
Source§impl BTreeInternalPage
impl BTreeInternalPage
Sourcepub fn empty_slots_count(&self) -> usize
pub fn empty_slots_count(&self) -> usize
Empty slots (entries/children) count.
pub fn children_count(&self) -> usize
pub fn entries_count(&self) -> usize
Source§impl BTreeInternalPage
impl BTreeInternalPage
pub fn get_children_capacity(&self) -> usize
Sourcepub fn get_stable_threshold(key_size: usize) -> usize
pub fn get_stable_threshold(key_size: usize) -> usize
Retrive the minimum number of children needed to keep this page stable.
Sourcepub fn get_children_cap(key_size: usize) -> usize
pub fn get_children_cap(key_size: usize) -> usize
Retrieve the maximum number of children this page can hold.
Trait Implementations§
Source§impl BTreePage for BTreeInternalPage
impl BTreePage for BTreeInternalPage
fn new( pid: &BTreePageID, bytes: &[u8], tuple_scheme: &Schema, key_field: usize, ) -> Self
fn get_pid(&self) -> BTreePageID
fn get_parent_pid(&self) -> BTreePageID
fn set_parent_pid(&mut self, pid: &BTreePageID)
Source§fn get_page_data(&self) -> Vec<u8> ⓘ
fn get_page_data(&self) -> Vec<u8> ⓘ
Generates a byte array representing the contents of this page.
Used to serialize this page to disk. Read more
fn set_before_image(&mut self)
Source§fn get_before_image(&self) -> Vec<u8> ⓘ
fn get_before_image(&self) -> Vec<u8> ⓘ
Provide a representation of this page before any modifications
were made to it. Used by recovery.
fn peek(&self)
Auto Trait Implementations§
impl Freeze for BTreeInternalPage
impl RefUnwindSafe for BTreeInternalPage
impl Send for BTreeInternalPage
impl Sync for BTreeInternalPage
impl Unpin for BTreeInternalPage
impl UnwindSafe for BTreeInternalPage
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