| Modifier and Type | Field and Description |
|---|---|
| pack-priv transient SQLLongint | child_pageno_buf
Only allocate one child_pageno_buf to read the page pointer field into, then cache to "empty" object for reuse by the page itself. |
| private static final int | |
| private static final int | |
| protected static final FormatableBitSet | CR_LEFTCHILD_BITMAP
bit sets used to fetch single columns at a time. |
| private static final int | |
| protected SQLLongint |
| Access | Constructor and Description |
|---|---|
| public | |
| public | BranchControlRow(OpenBTree open_btree, Page page, int level, ControlRow parent, boolean isRoot, long left_child)
|
| Modifier and Type | Method and Description |
|---|---|
| private static BranchControlRow | allocate(OpenBTree open_btree, ControlRow leftchild, int level, ControlRow parent)
Allocate a new leaf page to the conglomerate. |
| private void | |
| private int | |
| public int | checkConsistency(OpenBTree
The open btree to associate latches/locks with. btree, ControlRow The parent page of this page, "null" if this page is
root or if not maintaining parent links. parent, boolean Should the consistency check go to other pages (this
option breaks the latch protocol). check_other_pages)Implements abstract org. Perform consistency checks for a branch page.</menu> |
| protected final void | controlRowInit()
Implements abstract org. Perform page specific initialization. |
| private void | fixChildrensParents(OpenBTree btree, ControlRow leftchild)
A branch page that has just been allocated as part of a split has index rows and a left child pointer that were copied from another page. |
| protected ControlRow | |
| private long | |
| public ControlRow | Returns: The page which is the leftmost child of this page.The open btree to associate latches/locks with. open_btree)Implements abstract org. Return the left child pointer for the page. |
| pack-priv long | |
| protected final int | Returns: The total number of columns in the control row.Implements abstract org. Get the number of columns in the control row. |
| protected ControlRow | Returns: The page which is the rightmost child of this page.The open btree to associate latches/locks with. open_btree)Implements abstract org. Return the right child pointer for the page. |
| public DataValueDescriptor[] | Returns: Newly allocated template.Overrides org. Return a new template for reading a data row from the current page. |
| public int | getTypeFormatId()
Implements org. Return my format identifier. |
| private static void | growRoot(OpenBTree open_btree, DataValueDescriptor[] template, BranchControlRow root)
Add a level to the tree by moving the current branch-root page up one level and adding a new page as it's left child. |
| public boolean | Returns: true if the current page is the leftmost leaf of the tree, else return false.Implements abstract org. Is the current page the leftmost leaf of tree? |
| public boolean | Returns: true if the current page is the rightmost leaf of the tree, else return false.Implements abstract org. Is the current page the rightmost leaf of tree? |
| public void | printTree(OpenBTree
the open btree to print. btree)Implements abstract org. Recursively print the tree starting at current node in tree. |
| public static long | restartSplitFor(OpenBTree open_btree, DataValueDescriptor[] template, BranchControlRow parent, ControlRow child, DataValueDescriptor[] newbranchrow, DataValueDescriptor[] splitrow, int flag)
|
| public ControlRow | search(SearchParameters sp)
Implements abstract org. Perform a recursive search, ultimately returning the latched leaf page and row slot after which the given key belongs. |
| protected ControlRow | Returns: The leftmost leaf page.The open btree to associate latches/locks with. btree)Implements abstract org. Search and return the left most leaf page. |
| protected ControlRow | Returns: The rightmost leaf page.The open btree to associate latches/locks with. btree)Implements abstract org. Search and return the right most leaf page. |
| protected void | |
| protected void | |
| protected boolean | shrinkFor(OpenBTree open_btree, DataValueDescriptor[] shrink_key)
Implements abstract org. Perform a recursive shrink operation for the key. |
| protected long | Returns: page number of the newly allocated leaf page created by split.The open btree to associate latches with. open_btree, DataValueDescriptor[] A scratch area to use while searching for split pass. template, BranchControlRow The parent page of the current page in the split pass.
starts at null for root. parent, DataValueDescriptor[] The key to make room for during the split pass. splitrow, int A flag used to direct where point of split should be
chosen. flag)Implements abstract org. Perform a top down split pass making room for the the key in "row". |
| public String | toString()
Overrides org. The standard toString. |
| child_pageno_buf | back to summary |
|---|---|
| pack-priv transient SQLLongint child_pageno_buf Only allocate one child_pageno_buf to read the page pointer field into, then cache to "empty" object for reuse by the page itself. | |
| CR_COLID_LAST | back to summary |
|---|---|
| private static final int CR_COLID_LAST Hides org. | |
| CR_LEFTCHILD | back to summary |
|---|---|
| private static final int CR_LEFTCHILD | |
| CR_LEFTCHILD_BITMAP | back to summary |
|---|---|
| protected static final FormatableBitSet CR_LEFTCHILD_BITMAP bit sets used to fetch single columns at a time. | |
| CR_NCOLUMNS | back to summary |
|---|---|
| private static final int CR_NCOLUMNS Hides org. | |
| left_child_page | back to summary |
|---|---|
| protected SQLLongint left_child_page | |
| BranchControlRow | back to summary |
|---|---|
| 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. | |
| BranchControlRow | back to summary |
|---|---|
| public BranchControlRow(OpenBTree open_btree, Page page, int level, ControlRow parent, boolean isRoot, long left_child) throws StandardException | |
| allocate | back to summary |
|---|---|
| private static BranchControlRow allocate(OpenBTree open_btree, ControlRow leftchild, int level, ControlRow parent) throws StandardException Allocate a new leaf page to the conglomerate.
| |
| checkChildOrderAgainstRowOrder | back to summary |
|---|---|
| private void checkChildOrderAgainstRowOrder(OpenBTree btree) throws StandardException | |
| checkChildren | back to summary |
|---|---|
| private int checkChildren(OpenBTree btree) throws StandardException | |
| checkConsistency | back to summary |
|---|---|
| public int checkConsistency(OpenBTree btree, ControlRow parent, boolean check_other_pages) throws StandardException Implements abstract org. Perform consistency checks for a branch page. The checks specific to a branch page are: This method also performs the consistency checks that are common to both leaf and branch pages (see ControlRow.checkGeneric).
| |
| controlRowInit | back to summary |
|---|---|
| protected final void controlRowInit() Implements abstract org. Perform page specific initialization.
| |
| fixChildrensParents | back to summary |
|---|---|
| private void fixChildrensParents(OpenBTree btree, ControlRow leftchild) throws StandardException A branch page that has just been allocated as part of a split has index rows and a left child pointer that were copied from another page. The parent link on the corresponding pages will still point to the original page. This method fixes their parent pointers so that they point to the curren page like they're supposed to. Note that maintaining the parent link is kind of a pain, and will slow down applications. It's only needed for consistency checks, so we may want to have implementations that don't bother to maintain it. This | |
| getChildPageAtSlot | back to summary |
|---|---|
| protected ControlRow getChildPageAtSlot(OpenBTree open_btree, int slot) throws StandardException | |
| getChildPageIdAtSlot | back to summary |
|---|---|
| private long getChildPageIdAtSlot(OpenBTree btree, int slot) throws StandardException | |
| getLeftChild | back to summary |
|---|---|
| public ControlRow getLeftChild(OpenBTree open_btree) throws StandardException Implements abstract org. Return the left child pointer for the page. Leaf pages don't have children, so they override this and return null.
| |
| getLeftChildPageno | back to summary |
|---|---|
| pack-priv long getLeftChildPageno() throws StandardException Return the left child page number for the page. Leaf pages don't have left children, so they override this and return null. | |
| getNumberOfControlRowColumns | back to summary |
|---|---|
| protected final int getNumberOfControlRowColumns() Implements abstract org. Get the number of columns in the control row. Control rows all share the first columns as defined by this class and then add columns to the end of the control row. For instance a branch control row add a child page pointer field.
| |
| getRightChild | back to summary |
|---|---|
| protected ControlRow getRightChild(OpenBTree open_btree) throws StandardException Implements abstract org. Return the right child pointer for the page. Leaf pages don't have children, so they override this and return null.
| |
| getRowTemplate | back to summary |
|---|---|
| public DataValueDescriptor[] getRowTemplate(OpenBTree open_btree) throws StandardException Overrides org. 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).
| |
| getTypeFormatId | back to summary |
|---|---|
| public int getTypeFormatId() Implements org. Return my format identifier.
| |
| growRoot | back to summary |
|---|---|
| private static void growRoot(OpenBTree open_btree, DataValueDescriptor[] template, BranchControlRow root) throws StandardException Add a level to the tree by moving the current branch-root page up one level and adding a new page as it's left child. On exit the current root page remains the root of the tree. On entry, the current branch root page is expected to be latched. On exit, all latches will have been released. Latch order: o ROOT: on entry current root is latched. No other latches should be held. o ROOT_OLDCHILD: Get and Latch root's left child page. o ROOT_NEWCHILD: Allocate a new branch page with latch. o Conditionally fix up the parent links on the pages pointed at by the newly allocated page. Loop through slots on ROOT_NEWCHILD, from left to right getting and releasing latches. Note that fixChildrensParents() must not latch the leftchild as ROOT_OLDCHILD is already latched. Resolve (mikem) does order of release matter. o ROOT : released. o ROOT_NEWCHILD: released. o ROOT_OLDCHILD: released. | |
| isLeftmostLeaf | back to summary |
|---|---|
| public boolean isLeftmostLeaf() throws StandardException Implements abstract org. Is the current page the leftmost leaf of tree?
| |
| isRightmostLeaf | back to summary |
|---|---|
| public boolean isRightmostLeaf() throws StandardException Implements abstract org. Is the current page the rightmost leaf of tree?
| |
| printTree | back to summary |
|---|---|
| public void printTree(OpenBTree btree) throws StandardException Implements abstract org. Recursively print the tree starting at current node in tree.
| |
| restartSplitFor | back to summary |
|---|---|
| public static long restartSplitFor(OpenBTree open_btree, DataValueDescriptor[] template, BranchControlRow parent, ControlRow child, DataValueDescriptor[] newbranchrow, DataValueDescriptor[] splitrow, int flag) throws StandardException | |
| search | back to summary |
|---|---|
| public ControlRow search(SearchParameters sp) throws StandardException Implements abstract org. 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.
| |
| searchLeft | back to summary |
|---|---|
| protected ControlRow searchLeft(OpenBTree btree) throws StandardException Implements abstract org. Search and return the left most leaf page. Perform a recursive search, ultimately returning the leftmost leaf page which is the first leaf page in the leaf sibling chain. (This method might better be called getFirstLeafPage()).
| |
| searchRight | back to summary |
|---|---|
| protected ControlRow searchRight(OpenBTree btree) throws StandardException Implements abstract org. Search and return the right most leaf page. Perform a recursive search, ultimately returning the rightmost leaf page which is the last leaf page in the leaf sibling chain. (This method might better be called getLastLeafPage()).
| |
| setLeftChild | back to summary |
|---|---|
| protected void setLeftChild(ControlRow leftchild) throws StandardException | |
| setLeftChildPageno | back to summary |
|---|---|
| protected void setLeftChildPageno(long leftchild_pageno) throws StandardException | |
| shrinkFor | back to summary |
|---|---|
| protected boolean shrinkFor(OpenBTree open_btree, DataValueDescriptor[] shrink_key) throws StandardException Implements abstract org. Perform a recursive shrink operation for the key. If this method returns true, the caller should remove the corresponding entry for the page. This routine is not guaranteed to successfully shrink anything. The page lead to by the key might turn out not to be empty by the time shrink gets there, and shrinks will give up if there is a deadlock. The receiver page must be latched on entry and is returned latched.
| |
| splitFor | back to summary |
|---|---|
| protected long splitFor(OpenBTree open_btree, DataValueDescriptor[] template, BranchControlRow parent, DataValueDescriptor[] splitrow, int flag) throws StandardException Implements abstract org. Perform a top down split pass making room for the the key in "row". Perform a split such that a subsequent call to insert given the argument index row will likely find room for it. Since latches are released the client must code for the case where another user has grabbed the space made available by the split pass and be ready to do another split. Latches: o PARENT : is latched on entry (unless the split is the root then there is no parent. o THISBRANCH: the current page is latched on entry. o CHILD : latch the child page which will be pointed at by the left child pointer of the new page. RESOLVE (mikem) -see comments below o NEWPAGE : Allocate and latch new page. o CHILD : release. (RESOLVE) o fixparents: latch pages and reset their parent pointers. Conditionally fix up the parent links on the pages pointed at by the newly allocated page. First get latch and release on the left child page and then loop through slots on NEWPAGE, from left to right getting and releasing latches.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides org. The standard toString.
| |