| java.lang.Object org.apache.derby.impl.store.access.btree.ControlRow org.apache.derby.impl.store.access.btree.BranchControlRow
BranchControlRow | public class BranchControlRow extends ControlRow (Code) | | A branch row contains key fields and the pointer to the child page.
|
Method Summary | |
final protected void | ControlRowInit() Perform page specific initialization. | public int | checkConsistency(OpenBTree btree, ControlRow parent, boolean check_other_pages) Perform consistency checks for a branch page. | protected ControlRow | getChildPageAtSlot(OpenBTree open_btree, int slot) | public ControlRow | getLeftChild(OpenBTree open_btree) Return the left child pointer for the page. | long | getLeftChildPageno() Return the left child page number for the page. | final protected int | getNumberOfControlRowColumns() Get the number of columns in the control row. | protected ControlRow | getRightChild(OpenBTree open_btree) Return the right child pointer for the page. | public DataValueDescriptor[] | getRowTemplate(OpenBTree open_btree) Return a new template for reading a data row from the current page. | public int | getTypeFormatId() Return my format identifier. | public boolean | isLeftmostLeaf() | public boolean | isRightmostLeaf() | public void | printTree(OpenBTree btree) 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) 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. | protected ControlRow | searchLeft(OpenBTree btree) 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. | protected ControlRow | searchRight(OpenBTree btree) 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. | protected void | setLeftChild(ControlRow leftchild) | protected void | setLeftChildPageno(long leftchild_pageno) | protected boolean | shrinkFor(OpenBTree open_btree, DataValueDescriptor[] shrink_key) 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. | protected long | splitFor(OpenBTree open_btree, DataValueDescriptor[] template, BranchControlRow parent, DataValueDescriptor[] splitrow, int flag) 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. | public String | toString() The standard toString. |
CR_LEFTCHILD_BITMAP | final protected static FormatableBitSet CR_LEFTCHILD_BITMAP(Code) | | bit sets used to fetch single columns at a time.
|
child_pageno_buf | transient SQLLongint child_pageno_buf(Code) | | Only allocate one child_pageno_buf to read the page pointer field into,
then cache to "empty" object for reuse by the page itself.
|
BranchControlRow | public BranchControlRow()(Code) | | 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.
|
ControlRowInit | final protected void ControlRowInit()(Code) | | Perform page specific initialization.
|
checkConsistency | public int checkConsistency(OpenBTree btree, ControlRow parent, boolean check_other_pages) throws StandardException(Code) | | 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).
exception: StandardException - Standard exception policy. |
getLeftChild | public ControlRow getLeftChild(OpenBTree open_btree) throws StandardException(Code) | | Return the left child pointer for the page.
Leaf pages don't have children, so they override this and return null.
The page which is the leftmost child of this page. Parameters: open_btree - The open btree to associate latches/locks with. exception: StandardException - Standard exception policy. |
getLeftChildPageno | long getLeftChildPageno() throws StandardException(Code) | | Return the left child page number for the page. Leaf pages
don't have left children, so they override this and return
null.
|
getNumberOfControlRowColumns | final protected int getNumberOfControlRowColumns()(Code) | | 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.
The total number of columns in the control row. |
getRightChild | protected ControlRow getRightChild(OpenBTree open_btree) throws StandardException(Code) | | Return the right child pointer for the page.
Leaf pages don't have children, so they override this and return null.
The page which is the rightmost child of this page. Parameters: open_btree - The open btree to associate latches/locks with. exception: StandardException - Standard exception policy. |
getRowTemplate | public DataValueDescriptor[] getRowTemplate(OpenBTree open_btree) throws StandardException(Code) | | 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).
Newly allocated template. exception: StandardException - Standard exception policy. |
isLeftmostLeaf | public boolean isLeftmostLeaf() throws StandardException(Code) | | Is the current page the leftmost leaf of tree?
true if the current page is the leftmost leaf of the tree,else return false. exception: StandardException - Standard exception policy. |
isRightmostLeaf | public boolean isRightmostLeaf() throws StandardException(Code) | | Is the current page the rightmost leaf of tree?
true if the current page is the rightmost leaf of the tree,else return false. exception: StandardException - Standard exception policy. |
search | public ControlRow search(SearchParameters sp) throws StandardException(Code) | | 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.
exception: StandardException - Standard exception policy. |
searchLeft | protected ControlRow searchLeft(OpenBTree btree) throws StandardException(Code) | | 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()).
The leftmost leaf page. Parameters: btree - The open btree to associate latches/locks with. exception: StandardException - Standard exception policy. |
searchRight | protected ControlRow searchRight(OpenBTree btree) throws StandardException(Code) | | 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()).
The rightmost leaf page. Parameters: btree - The open btree to associate latches/locks with. exception: StandardException - Standard exception policy. |
shrinkFor | protected boolean shrinkFor(OpenBTree open_btree, DataValueDescriptor[] shrink_key) throws StandardException(Code) | | 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.
exception: StandardException - Standard exception policy. |
splitFor | protected long splitFor(OpenBTree open_btree, DataValueDescriptor[] template, BranchControlRow parent, DataValueDescriptor[] splitrow, int flag) throws StandardException(Code) | | 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.
page number of the newly allocated leaf page created by split. Parameters: open_btree - The open btree to associate latches with. Parameters: template - A scratch area to use while searching for split pass. Parameters: parent - The parent page of the current page in the split pass.starts at null for root. Parameters: splitrow - The key to make room for during the split pass. Parameters: flag - A flag used to direct where point of split should bechosen. exception: StandardException - Standard exception policy. |
toString | public String toString()(Code) | | The standard toString.
|
Methods inherited from org.apache.derby.impl.store.access.btree.ControlRow | public static int CompareIndexRowFromPageToKey(ControlRow indexpage, int slot, DataValueDescriptor[] indexrow, DataValueDescriptor[] key, int nCompareCols, int partialKeyOrder, boolean[] ascOrDesc) throws StandardException(Code)(Java Doc) public static int CompareIndexRowToKey(DataValueDescriptor[] indexrow, DataValueDescriptor[] key, int nCompareCols, int partialKeyOrder, boolean[] ascOrDesc) throws StandardException(Code)(Java Doc) abstract protected void ControlRowInit()(Code)(Java Doc) public static ControlRow Get(OpenBTree open_btree, long pageNumber) throws StandardException(Code)(Java Doc) public static ControlRow Get(ContainerHandle container, long pageNumber) throws StandardException(Code)(Java Doc) protected static ControlRow GetControlRowForPage(ContainerHandle container, Page page) throws StandardException(Code)(Java Doc) public static ControlRow GetNoWait(OpenBTree open_btree, long pageNumber) throws StandardException(Code)(Java Doc) public void auxObjectInvalidated()(Code)(Java Doc) abstract protected int checkConsistency(OpenBTree btree, ControlRow parent, boolean check_other_pages) throws StandardException(Code)(Java Doc) protected void checkGeneric(OpenBTree btree, ControlRow parent, boolean check_other_pages) throws StandardException(Code)(Java Doc) protected boolean checkRowOrder(OpenBTree btree, ControlRow parent) throws StandardException(Code)(Java Doc) protected void checkSiblings(OpenBTree btree) throws StandardException(Code)(Java Doc) protected boolean compareRowsOnSiblings(OpenBTree btree, ControlRow left_sib, ControlRow right_sib) throws StandardException(Code)(Java Doc) public String debugPage(OpenBTree open_btree) throws StandardException(Code)(Java Doc) public BTree getConglom(int format_id) throws StandardException(Code)(Java Doc) protected boolean getIsRoot() throws StandardException(Code)(Java Doc) abstract protected ControlRow getLeftChild(OpenBTree btree) throws StandardException(Code)(Java Doc) public ControlRow getLeftSibling(OpenBTree btree) throws StandardException, WaitError(Code)(Java Doc) protected int getLevel() throws StandardException(Code)(Java Doc) abstract protected int getNumberOfControlRowColumns()(Code)(Java Doc) public Page getPage()(Code)(Java Doc) protected long getParentPageNumber() throws StandardException(Code)(Java Doc) abstract protected ControlRow getRightChild(OpenBTree btree) throws StandardException(Code)(Java Doc) protected ControlRow getRightSibling(OpenBTree open_btree) throws StandardException(Code)(Java Doc) final protected DataValueDescriptor[] getRow()(Code)(Java Doc) public DataValueDescriptor[] getRowTemplate(OpenBTree open_btree) throws StandardException(Code)(Java Doc) protected int getVersion() throws StandardException(Code)(Java Doc) public long getleftSiblingPageNumber() throws StandardException(Code)(Java Doc) protected long getrightSiblingPageNumber() throws StandardException(Code)(Java Doc) abstract public boolean isLeftmostLeaf() throws StandardException(Code)(Java Doc) abstract public boolean isRightmostLeaf() throws StandardException(Code)(Java Doc) void linkRight(OpenBTree btree, ControlRow target) throws StandardException(Code)(Java Doc) abstract public void printTree(OpenBTree btree) throws StandardException(Code)(Java Doc) public void release()(Code)(Java Doc) abstract public ControlRow search(SearchParameters search_params) throws StandardException(Code)(Java Doc) protected void searchForEntry(SearchParameters params) throws StandardException(Code)(Java Doc) protected void searchForEntryBackward(SearchParameters params) throws StandardException(Code)(Java Doc) abstract protected ControlRow searchLeft(OpenBTree btree) throws StandardException(Code)(Java Doc) abstract protected ControlRow searchRight(OpenBTree btree) throws StandardException(Code)(Java Doc) protected void setIsRoot(boolean isRoot) throws StandardException(Code)(Java Doc) protected void setLeftSibling(ControlRow leftsib) throws StandardException(Code)(Java Doc) protected void setLevel(int newlevel) throws StandardException(Code)(Java Doc) void setParent(long parent) throws StandardException(Code)(Java Doc) protected void setRightSibling(ControlRow rightsib) throws StandardException(Code)(Java Doc) protected void setVersion(int version) throws StandardException(Code)(Java Doc) abstract protected boolean shrinkFor(OpenBTree btree, DataValueDescriptor[] key) throws StandardException(Code)(Java Doc) abstract protected long splitFor(OpenBTree open_btree, DataValueDescriptor[] template, BranchControlRow parentpage, DataValueDescriptor[] row, int flag) throws StandardException(Code)(Java Doc) public String toString()(Code)(Java Doc) boolean unlink(OpenBTree btree) throws StandardException(Code)(Java Doc)
|
|
|