org.apache.derby.impl.store.access.btree
Class BranchControlRow
- java.lang.Object
-
- org.apache.derby.impl.store.access.btree.ControlRow
-
- org.apache.derby.impl.store.access.btree.BranchControlRow
-
- All Implemented Interfaces:
- TypedFormat, AuxObject
public class BranchControlRow extends ControlRow
A branch row contains key fields and the pointer to the child page.
-
-
Field Summary
-
Fields inherited from class org.apache.derby.impl.store.access.btree.ControlRow
SPLIT_FLAG_FIRST_IN_TABLE, SPLIT_FLAG_FIRST_ON_PAGE, SPLIT_FLAG_LAST_IN_TABLE, SPLIT_FLAG_LAST_ON_PAGE
-
-
Constructor Summary
Constructors Constructor and Description BranchControlRow()No arg constructor.BranchControlRow(OpenBTree open_btree, Page page, int level, ControlRow parent, boolean isRoot, long left_child)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description intcheckConsistency(OpenBTree btree, ControlRow parent, boolean check_other_pages)Perform consistency checks for a branch page.ControlRowgetLeftChild(OpenBTree open_btree)Return the left child pointer for the page.DataValueDescriptor[]getRowTemplate(OpenBTree open_btree)Return a new template for reading a data row from the current page.intgetTypeFormatId()Return my format identifier.booleanisLeftmostLeaf()Is the current page the leftmost leaf of tree?booleanisRightmostLeaf()Is the current page the rightmost leaf of tree?voidprintTree(OpenBTree btree)Recursively print the tree starting at current node in tree.static longrestartSplitFor(OpenBTree open_btree, DataValueDescriptor[] template, BranchControlRow parent, ControlRow child, DataValueDescriptor[] newbranchrow, DataValueDescriptor[] splitrow, int flag)ControlRowsearch(SearchParameters sp)Perform a recursive search, ultimately returning the latched leaf page and row slot after which the given key belongs.java.lang.StringtoString()The standard toString.-
Methods inherited from class org.apache.derby.impl.store.access.btree.ControlRow
auxObjectInvalidated, compareIndexRowFromPageToKey, compareIndexRowToKey, debugPage, get, get, getConglom, getLeftSibling, getleftSiblingPageNumber, getNoWait, getPage, release
-
-
-
-
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.
-
BranchControlRow
public BranchControlRow(OpenBTree open_btree, Page page, int level, ControlRow parent, boolean isRoot, long left_child) throws StandardException
- Throws:
StandardException
-
-
Method Detail
-
isLeftmostLeaf
public boolean isLeftmostLeaf() throws StandardExceptionIs the current page the leftmost leaf of tree?- Specified by:
isLeftmostLeafin classControlRow- 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 StandardExceptionIs the current page the rightmost leaf of tree?- Specified by:
isRightmostLeafin classControlRow- Returns:
- true if the current page is the rightmost leaf of the tree, else return false.
- Throws:
StandardException- Standard exception policy.
-
restartSplitFor
public static long restartSplitFor(OpenBTree open_btree, DataValueDescriptor[] template, BranchControlRow parent, ControlRow child, DataValueDescriptor[] newbranchrow, DataValueDescriptor[] splitrow, int flag) throws StandardException
- Throws:
StandardException
-
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:
searchin classControlRow- 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: 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.
-
printTree
public void printTree(OpenBTree btree) throws StandardException
Recursively print the tree starting at current node in tree.- Specified by:
printTreein classControlRow- Parameters:
btree- the open btree to print.- 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:
getRowTemplatein classControlRow- Returns:
- Newly allocated template.
- Throws:
StandardException- Standard exception policy.
-
toString
public java.lang.String toString()
The standard toString.- Overrides:
toStringin classControlRow
-
-
DataMelt 3.0 © DataMelt by jWork.ORG