Struct simple_db_rust::btree::file::BTreeTable[][src]

pub struct BTreeTable {
    pub key_field: usize,
    pub tuple_scheme: TupleScheme,
    // some fields omitted
}

Fields

key_field: usizetuple_scheme: TupleScheme

Implementations

Insert a tuple into this BTreeFile, keeping the tuples in sorted order. May cause pages to split if the page where tuple belongs is full.

Split a leaf page to make room for new tuples and recursively split the parent node as needed to accommodate a new entry. The new entry should have a key matching the key field of the first tuple in the right-hand page (the key is “copied up”), and child pointers pointing to the two leaf pages resulting from the split. Update sibling pointers and parent pointers as needed.

Return the leaf page into which a new tuple with key field “field” should be inserted.

UPDATE: split leaf page based on the split strategy.

Arguments

  • field: the key field of the tuple to be inserted after the split is complete. Necessary to know which of the two pages to return.

Recursive function which finds and locks the leaf page in the B+ tree corresponding to the left-most page possibly containing the key field f. It locks all internal nodes along the path to the leaf node with READ_ONLY permission, and locks the leaf node with permission perm.

If f is null, it finds the left-most leaf page – used for the iterator

Arguments

  • tid - the transaction id
  • pid - the current page being searched
  • perm - the permissions with which to lock the leaf page
  • f - the field to search for

Return

  • the left-most leaf page possibly containing the key field f

Get the root page pid.

The count of pages in this BTreeFile

(BTreeRootPointerPage is not included)

used for debug

pub fn draw_entry(&self, id: usize, entry: &Entry, level: usize)

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.