org.apache.derby.impl.store.access.btree
Class LeafControlRow
- java.lang.Object
-
- org.apache.derby.impl.store.access.btree.ControlRow
-
- org.apache.derby.impl.store.access.btree.LeafControlRow
-
- All Implemented Interfaces:
- TypedFormat, AuxObject
public class LeafControlRow extends ControlRow
-
-
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 LeafControlRow()No arg constructor.
-
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 on a leaf page.intgetTypeFormatId()Return my format identifier.static voidinitEmptyBtree(OpenBTree open_btree)Initialize conglomerate with one page, to be a 1 page btree.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.ControlRowsearch(SearchParameters sp)Perform a search of this leaf page, ultimately returning the latched leaf page and row slot after which the given key belongs.-
Methods inherited from class org.apache.derby.impl.store.access.btree.ControlRow
auxObjectInvalidated, compareIndexRowFromPageToKey, compareIndexRowToKey, debugPage, get, get, getConglom, getLeftSibling, getleftSiblingPageNumber, getNoWait, getPage, getRowTemplate, release, toString
-
-
-
-
Constructor Detail
-
LeafControlRow
public LeafControlRow()
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.
-
-
Method Detail
-
initEmptyBtree
public static void initEmptyBtree(OpenBTree open_btree) throws StandardException
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).- Throws:
StandardException- Standard exception policy.
-
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.
-
search
public ControlRow search(SearchParameters sp) throws StandardException
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.- 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 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.- 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.- See Also:
ControlRow.checkGeneric(org.apache.derby.impl.store.access.btree.OpenBTree, org.apache.derby.impl.store.access.btree.ControlRow, boolean)
-
printTree
public void printTree(OpenBTree btree) throws StandardException
Recursively print the tree starting at current node in tree. This is a leaf so return.- Specified by:
printTreein classControlRow- 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()
-
-
DataMelt 3.0 © DataMelt by jWork.ORG