| java.lang.Object org.apache.derby.impl.store.access.btree.ControlRow org.apache.derby.impl.store.access.btree.LeafControlRow
Method Summary | |
final protected void | ControlRowInit() Perform page specific initialization. | public int | checkConsistency(OpenBTree btree, ControlRow parent, boolean check_other_pages) Perform consistency checks on a leaf page. | protected ControlRow | getLeftChild(OpenBTree btree) Return the left child pointer for the page. | final protected int | getNumberOfControlRowColumns() Get the number of columns in the control row. | protected ControlRow | getRightChild(OpenBTree btree) Return the right child pointer for the page. | public int | getTypeFormatId() Return my format identifier. | public static void | initEmptyBtree(OpenBTree open_btree) Initialize conglomerate with one page, to be a 1 page btree.
Given a conglomerate which already has one page allocated to it,
initialize the page to be a leaf-root page with no entries. | public boolean | isLeftmostLeaf() | public boolean | isRightmostLeaf() | public void | printTree(OpenBTree btree) Recursively print the tree starting at current node in tree. | public ControlRow | search(SearchParameters sp) Perform a search of this leaf page, 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 boolean | shrinkFor(OpenBTree btree, DataValueDescriptor[] 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_page, 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. |
LeafControlRow | public LeafControlRow()(Code) | | No arg constructor.
Public no arg constructor is for the monitor to call for format
id implemenation, it should not be called for any other reason.
|
LeafControlRow | LeafControlRow(OpenBTree btree, Page page, ControlRow parent, boolean isRoot) throws StandardException(Code) | | Constructs a leaf-page control row, for a newly allocated leaf page.
Parameters: btree - The open btree to allocate this page from. Parameters: page - The newly allocated page where the control row willbe inserted. Parameters: parent - The parent of the leaf page. Set to null for root.RESOLVE (mikem) - set to null otherwise? Parameters: isRoot - Is this page the root of the tree? exception: StandardException - Standard exception policy. |
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 on a leaf page.
Check consistency of the page and its children,
returning the number of pages seen, and throwing
errors if inconsistencies are found.
The checks specific to a leaf page are:
This method also performs the consistency checks that
are common to both leaf and branch pages.
See Also: ControlRow.checkGeneric exception: StandardException - Standard exception policy. |
getLeftChild | protected ControlRow getLeftChild(OpenBTree 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: btree - The open btree to associate latches/locks with. exception: StandardException - Standard exception policy. |
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 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: btree - The open btree to associate latches/locks with. exception: StandardException - Standard exception policy. |
initEmptyBtree | public static void initEmptyBtree(OpenBTree open_btree) throws StandardException(Code) | | Initialize conglomerate with one page, to be a 1 page btree.
Given a conglomerate which already has one page allocated to it,
initialize the page to be a leaf-root page with no entries. Allocate
the control row and store it on the page.
Parameters: open_btree - The open btree to initialize (container is open). 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 search of this leaf page, 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 btree, DataValueDescriptor[] 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 unlatched.
exception: StandardException - Standard exception policy. |
splitFor | protected long splitFor(OpenBTree open_btree, DataValueDescriptor[] template, BranchControlRow parent_page, 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.
On entry, the parent is either null or latched, and the
current page is latched. On exit, all pages will have been
unlatched. If the parent is null, then this page is a root
leaf page.
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_page - 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. |
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)
|
|
|