Documentation of 'org.apache.derby.impl.store.access.btree.BranchControlRow' Java class
BranchControlRow
org.apache.derby.impl.store.access.btree

Class BranchControlRow

  • All Implemented Interfaces:
    TypedFormat, AuxObject


    public class BranchControlRow
    extends ControlRow
    A branch row contains key fields and the pointer to the child page.
    • Constructor Detail

      • BranchControlRow

        public BranchControlRow()
        No arg constructor.

        Public no arg constructor is for the monitor to call for format id implementation, it should not be called for any other reason.

    • Method Detail

      • isLeftmostLeaf

        public boolean isLeftmostLeaf()
                               throws StandardException
        Is the current page the leftmost leaf of tree?

        Specified by:
        isLeftmostLeaf in class ControlRow
        Returns:
        true if the current page is the leftmost leaf of the tree, else return false.
        Throws:
        StandardException - Standard exception policy.
      • isRightmostLeaf

        public boolean isRightmostLeaf()
                                throws StandardException
        Is the current page the rightmost leaf of tree?

        Specified by:
        isRightmostLeaf in class ControlRow
        Returns:
        true if the current page is the rightmost leaf of the tree, else return false.
        Throws:
        StandardException - Standard exception policy.
      • search

        public ControlRow search(SearchParameters sp)
                          throws StandardException
        Perform a recursive search, ultimately returning the latched leaf page and row slot after which the given key belongs. The slot is returned in the result structure. If the key exists on the page, the result.exact will be true. Otherwise, result.exact will be false, and the row slot returned will be the one immediately preceding the position at which the key belongs.
        Specified by:
        search in class ControlRow
        Throws:
        StandardException - Standard exception policy.
      • checkConsistency

        public int checkConsistency(OpenBTree btree,
                                    ControlRow parent,
                                    boolean check_other_pages)
                             throws StandardException
        Perform consistency checks for a branch page. The checks specific to a branch page are:
      • The rows on the page are indeed branch rows, and they all have the correct number of fields (which is the b-tree's key fields plus one for the child page number.
      • The child pages pointed to by the left child pointer and the index rows are linked together in the same order that they appear on the page.
      • The child pages themselves are all consistent.
      • This method also performs the consistency checks that are common to both leaf and branch pages (see ControlRow.checkGeneric).
        Parameters:
        btree - The open btree to associate latches/locks with.
        parent - The parent page of this page, "null" if this page is root or if not maintaining parent links.
        check_other_pages - Should the consistency check go to other pages (this option breaks the latch protocol).
        Returns:
        The identifier to be used to open the conglomerate later.
        Throws:
        StandardException - Standard exception policy.
      • getLeftChild

        public ControlRow getLeftChild(OpenBTree open_btree)
                                throws StandardException
        Return the left child pointer for the page.

        Leaf pages don't have children, so they override this and return null.

        Parameters:
        open_btree - The open btree to associate latches/locks with.
        Returns:
        The page which is the leftmost child of this page.
        Throws:
        StandardException - Standard exception policy.
      • getTypeFormatId

        public int getTypeFormatId()
        Return my format identifier.
        Returns:
        The identifier. (A UUID stuffed in an array of 16 bytes).
        See Also:
        TypedFormat.getTypeFormatId()
      • getRowTemplate

        public DataValueDescriptor[] getRowTemplate(OpenBTree open_btree)
                                             throws StandardException
        Return a new template for reading a data row from the current page.

        Default implementation for rows which are the same as the conglomerates template, sub-classes can alter if underlying template is different (for instance branch rows add an extra field at the end).

        Overrides:
        getRowTemplate in class ControlRow
        Returns:
        Newly allocated template.
        Throws:
        StandardException - Standard exception policy.
      • toString

        public java.lang.String toString()
        The standard toString.
        Overrides:
        toString in class ControlRow

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.