Top Description Fields Constructors Methods
org.apache.derby.impl.store.access.btree

public abstract Class ControlRow

extends Object
implements AuxObject, TypedFormat
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.services.io.TypedFormat, org.apache.derby.iapi.store.raw.AuxObject
Known Direct Subclasses
org.apache.derby.impl.store.access.btree.LeafControlRow, org.apache.derby.impl.store.access.btree.BranchControlRow
Imports
org.apache.derby.iapi.services.monitor.Monitor, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.services.io.TypedFormat, .FormatableBitSet, org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.store.access.Qualifier, .RowUtil, org.apache.derby.iapi.store.raw.AuxObject, .FetchDescriptor, .Page, .ContainerHandle, .RecordHandle, org.apache.derby.iapi.types.DataValueDescriptor, .SQLLongint, org.apache.derby.impl.store.access.StorableFormatId, org.apache.derby.impl.store.access.conglomerate.ConglomerateUtil

Base class for leaf and branch control rows.

Concurrency Notes

All access through control rows is serialized by an exclusive latch on the page the control row is for. The page is latched when the control row is "gotten" (ControlRow#Get), and unlatched when the control row is released (ControlRow#release).

To Do List

See Also
ControlRow#get, ControlRow#release

Field Summary

Modifier and TypeField and Description
private BTree
btree

A copy of the Conglomerate that describes the owning conglom.

protected static final int
CR_COLID_FIRST

Column number assignments for columns of the control row.

protected static final int
protected static final FormatableBitSet
protected static final int
protected static final FormatableBitSet
protected static final int
protected static final FormatableBitSet
protected static final int
protected static final FormatableBitSet
protected static final int
protected static final int
protected static final FormatableBitSet
protected static final int
protected static final FormatableBitSet
protected static final int
protected static final int
CR_SLOT

The slot at which all control rows reside.

protected static final FormatableBitSet
CR_VERSION_BITSET

bit sets used to fetch single columns at a time.

protected static final int
protected FetchDescriptor
fetchDesc

FetchDescriptor used to replace fetchFieldFromSlot() calls.

private SQLLongint
isRoot

Is this page the root of the btree?

protected transient int
last_search_result

In memory hint about where to begin the binary search to find a key on the the current control page.

private SQLLongint
leftSiblingPageNumber

Pointer to page which is "left" at the current level.

private SQLLongint
level

The level of the btree.

protected Page
page

The page that this control row describes.

private SQLLongint
parentPageNumber

The parent page of the current page.

private SQLLongint
rightSiblingPageNumber

Pointer to page which is "right" at the current level.

protected DataValueDescriptor[]
row

The page that this control row describes.

protected DataValueDescriptor[]
scratch_row

row used to replace fetchFieldFromSlot() calls.

public static final int
public static final int
public static final int
public static final int
SPLIT_FLAG_LAST_ON_PAGE

Values passed in the flag argument to splitFor.

protected transient boolean
use_last_search_result_hint

In memory hint about whether to use the last_search_result hint during search.

private StorableFormatId
version

Version indentifier of the control row within the page.

Constructor Summary

AccessConstructor and Description
protected
ControlRow()

No arg constructor.

protected
ControlRow(OpenBTree
Static information about the btree.
btree
,
Page
The page described by this control row.
page
,
int level, ControlRow
The parent page of this page, "null" if this page is root or if not maintaining parent links.
parent
,
boolean
Is this page the root of the tree?
isRoot
)

Constructor for making a new control row as part of allocating a new page.

protected
ControlRow(ContainerHandle
Open container
container
,
Page
The page described by this control row.
page
)

Constructor for making a control row for an existing page.

Method Summary

Modifier and TypeMethod and Description
public void
auxObjectInvalidated()

Implements org.apache.derby.iapi.store.raw.AuxObject.auxObjectInvalidated.

Called when the page is being evicted from cache or when a rollback happened on the page and may possibly have changed the control row's value

protected abstract int

Returns:

The identifier to be used to open the conglomerate later.
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
)

Check consistency of the page and its children, returning the number of pages seen, and throwing errors if inconsistencies are found.

protected void
checkGeneric(OpenBTree btree, ControlRow parent, boolean check_other_pages)

Perform consistency checks which are common to all pages that derive from ControlRow (both leaf and branch pages).</menu>

protected boolean
checkRowOrder(OpenBTree btree, ControlRow parent)

Check that all rows on the page are in order.

protected void
checkSiblings(OpenBTree btree)

Perform checks on the siblings of this page: make sure that they're at the same level as this page, that they're mutually linked together, and that the first/last keys on sibling pages are in order.

public static int
compareIndexRowFromPageToKey(ControlRow
Controlrow of page to get target row from.
indexpage
,
int
Slot to get control row from.
slot
,
DataValueDescriptor[]
template of the target row (the row in the index).
indexrow
,
DataValueDescriptor[]
the (possibly partial) search key.
key
,
int
the number of columns to compare.
nCompareCols
,
int
what to return on a partial key match.
partialKeyOrder
,
boolean[]
column sort order information
ascOrDesc
)

Compare two orderable rows, considering nCompareCols, and return -1, 0, or 1 depending on whether the first row (indexrow) is less than, equal to, or greater than the second (key).

public static int
compareIndexRowToKey(DataValueDescriptor[] indexrow, DataValueDescriptor[] key, int nCompareCols, int partialKeyOrder, boolean[] ascOrDesc)

protected boolean
protected abstract void
controlRowInit()

Perform page specific initialization.

public String

Returns:

string with all info.
debugPage
(OpenBTree open_btree)

Dump complete information about control row and rows on the page.

public static ControlRow
get(OpenBTree open_btree, long pageNumber)

Get the control row from the given page in the b-tree.

public static ControlRow
get(ContainerHandle container, long pageNumber)

public BTree

Returns:

format id of a row on the page.
getConglom
(int format_id)

Get format id information for row on page.

protected static ControlRow
protected boolean
protected abstract ControlRow

Returns:

The page which is the leftmost child of this page.
getLeftChild
(OpenBTree
The open btree to associate latches/locks with.
btree
)

Return the left child pointer for the page.

public ControlRow
getLeftSibling(OpenBTree btree)

Get the control row for this page's left sibling, or null if there is no left sibling (which probably means it's the leftmost page at its level).

public long
getleftSiblingPageNumber()

Get the page number of the left sibling.

protected int
public static ControlRow
getNoWait(OpenBTree open_btree, long pageNumber)

Get the control row for the given page if the latch on the page can be obtained without waiting, else return null.

protected abstract int

Returns:

The total number of columns in the control row.
getNumberOfControlRowColumns
()

Get the number of columns in the control row.

public Page
protected long
getParentPageNumber()

Get the page number of the parent, if it's being maintained.

protected abstract ControlRow

Returns:

The page which is the rightmost child of this page.
getRightChild
(OpenBTree
The open btree to associate latches/locks with.
btree
)

Return the right child pointer for the page.

protected ControlRow
getRightSibling(OpenBTree open_btree)

Return the control row for this page's right sibling.

protected long
getrightSiblingPageNumber()

Get the page number of the right sibling.

protected final DataValueDescriptor[]

Returns:

The row.
getRow
()

Get the row.

public DataValueDescriptor[]

Returns:

Newly allocated template.
getRowTemplate
(OpenBTree open_btree)

Return a new template for reading a data row from the current page.

protected int

Returns:

version of the control row.
getVersion
()

Get version of the control row.

public abstract boolean

Returns:

true if the current page is the leftmost leaf of the tree, else return false.
isLeftmostLeaf
()

Is the current page the leftmost leaf of tree?

public abstract boolean

Returns:

true if the current page is the rightmost leaf of the tree, else return false.
isRightmostLeaf
()

Is the current page the rightmost leaf of tree?

pack-priv void
linkRight(OpenBTree btree, ControlRow target)

Link this page to the right of the target page.

public abstract void
printTree(OpenBTree btree)

Recursively print the tree starting at current node in tree.

public void
release()

Release this control row's resources.

public abstract ControlRow
search(SearchParameters search_params)

Perform a recursive search, ultimately returning the latched leaf page and row slot after which the given key belongs.

protected void
searchForEntry(SearchParameters
the parameters of the search
params
)

Search this index page.

protected void
protected abstract ControlRow

Returns:

The leftmost leaf page.
searchLeft
(OpenBTree
The open btree to associate latches/locks with.
btree
)

Search and return the left most leaf page.

protected abstract ControlRow

Returns:

The rightmost leaf page.
searchRight
(OpenBTree
The open btree to associate latches/locks with.
btree
)

Search and return the right most leaf page.

protected void
setIsRoot(boolean isRoot)

protected void
protected void
setLevel(int newlevel)

pack-priv void
setParent(long parent)

protected void
protected void
setVersion(int version)

Set version of the control row.

protected abstract boolean
shrinkFor(OpenBTree btree, DataValueDescriptor[] key)

Perform a recursive shrink operation for the key.

protected abstract long

Returns:

page number of the newly allocated leaf page created by split.
splitFor
(OpenBTree
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.
parentpage
,
DataValueDescriptor[]
The key to make room for during the split pass.
row
,
int
A flag used to direct where point of split should be chosen.
flag
)

Perform a top down split pass making room for the the key in "row".

public String
toString()

Overrides java.lang.Object.toString.

The standard toString().

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

btreeback to summary
private BTree btree

A copy of the Conglomerate that describes the owning conglom.

This information is used during logical undo to get the type information so that rows can be compared and searched for. We may be able to get away with a subset of the information stored in the conglomerate.

RESOLVE (mikem) - change this to only store the info on the root page.

CR_COLID_FIRSTback to summary
protected static final int CR_COLID_FIRST

Column number assignments for columns of the control row.

The control row is stored as the first row in a btree page. The row is an array of columns. The Control row columns are the columns numbered from ControlRow.CR_COLID_FIRST through ControlRow.CR_COLID_LAST. The classes which implement the concrete derived classes of ControlRow may add columns to the control row, but they must be added after the ControlRow columns.

CR_COLID_LASTback to summary
protected static final int CR_COLID_LAST
CR_CONGLOM_BITSETback to summary
protected static final FormatableBitSet CR_CONGLOM_BITSET
CR_CONGLOM_COLIDback to summary
protected static final int CR_CONGLOM_COLID
CR_ISROOT_BITSETback to summary
protected static final FormatableBitSet CR_ISROOT_BITSET
CR_ISROOT_COLIDback to summary
protected static final int CR_ISROOT_COLID
CR_LEFTSIB_BITSETback to summary
protected static final FormatableBitSet CR_LEFTSIB_BITSET
CR_LEFTSIB_COLIDback to summary
protected static final int CR_LEFTSIB_COLID
CR_LEVEL_BITSETback to summary
protected static final FormatableBitSet CR_LEVEL_BITSET
CR_LEVEL_COLIDback to summary
protected static final int CR_LEVEL_COLID
CR_NCOLUMNSback to summary
protected static final int CR_NCOLUMNS
CR_PARENT_BITSETback to summary
protected static final FormatableBitSet CR_PARENT_BITSET
CR_PARENT_COLIDback to summary
protected static final int CR_PARENT_COLID
CR_RIGHTSIB_BITSETback to summary
protected static final FormatableBitSet CR_RIGHTSIB_BITSET
CR_RIGHTSIB_COLIDback to summary
protected static final int CR_RIGHTSIB_COLID
CR_SLOTback to summary
protected static final int CR_SLOT

The slot at which all control rows reside.

CR_VERSION_BITSETback to summary
protected static final FormatableBitSet CR_VERSION_BITSET

bit sets used to fetch single columns at a time.

CR_VERSION_COLIDback to summary
protected static final int CR_VERSION_COLID
fetchDescback to summary
protected FetchDescriptor fetchDesc

FetchDescriptor used to replace fetchFieldFromSlot() calls.

isRootback to summary
private SQLLongint isRoot

Is this page the root of the btree?

Currently "1" if the page is the root page, else "0".

RESOLVE (mikem) When real datatype come about, this value should probably be just a bit in some status word.

last_search_resultback to summary
protected transient int last_search_result

In memory hint about where to begin the binary search to find a key on the the current control page.

leftSiblingPageNumberback to summary
private SQLLongint leftSiblingPageNumber

Pointer to page which is "left" at the current level.

Currently all pages at a level are doubly linked. The leftmost page in a level has a leftSiblingPageNumber == ContainerHandle.INVALID_PAGE_NUMBER. All key values on the page which is left must precede the first key value on the current page.

levelback to summary
private SQLLongint level

The level of the btree.

The leaf level of the btree is 0. The first branch level (parent level of the leaf), is level 1. The height of the btree is (level + 1).

The smallest btree is a one page btree with only a leaf, and no branch pages.

pageback to summary
protected Page page

The page that this control row describes.

parentPageNumberback to summary
private SQLLongint parentPageNumber

The parent page of the current page.

For consistency checking it is useful to maintain the parentPageNumber field of the current page. The root page has a value of ContainerHandle.INVALID_PAGE_NUMBER in it's parentPageNumber field.

RESOLVE (mikem) - we need to come up with some way to not maintain these, maybe by providing a property on secondary index or a different 2nd index.

rightSiblingPageNumberback to summary
private SQLLongint rightSiblingPageNumber

Pointer to page which is "right" at the current level.

Currently all pages at a level are doubly linked. The rightmost page in a level has a rightSiblingPageNumber == ContainerHandle.INVALID_PAGE_NUMBER. All key values on the page which is right of the current page must follow the last key value on the current page.

rowback to summary
protected DataValueDescriptor[] row

The page that this control row describes.

scratch_rowback to summary
protected DataValueDescriptor[] scratch_row

row used to replace fetchFieldFromSlot() calls.

SPLIT_FLAG_FIRST_IN_TABLEback to summary
public static final int SPLIT_FLAG_FIRST_IN_TABLE
SPLIT_FLAG_FIRST_ON_PAGEback to summary
public static final int SPLIT_FLAG_FIRST_ON_PAGE
SPLIT_FLAG_LAST_IN_TABLEback to summary
public static final int SPLIT_FLAG_LAST_IN_TABLE
SPLIT_FLAG_LAST_ON_PAGEback to summary
public static final int SPLIT_FLAG_LAST_ON_PAGE

Values passed in the flag argument to splitFor.

use_last_search_result_hintback to summary
protected transient boolean use_last_search_result_hint

In memory hint about whether to use the last_search_result hint during search.

versionback to summary
private StorableFormatId version

Version indentifier of the control row within the page.

This is the format id of the control row. The format id is currently one of either StoredFormatIds.ACCESS_BTREE_LEAFCONTROLROW_ID or StoredFormatIds.ACCESS_BTREE_BRANCHCONTROLROW_ID.

Constructor Detail

ControlRowback to summary
protected ControlRow()

No arg constructor.

GetControlRowForPage() will call this constructor when it uses the monitor to create a control row dynamically given a given format id.

ControlRowback to summary
protected ControlRow(OpenBTree btree, Page page, int level, ControlRow parent, boolean isRoot) throws StandardException

Constructor for making a new control row as part of allocating a new page. Fills in all the fields but does not write them anywhere.

Changes to this constructor will probably require changes to the corresponding accessor(s).

Parameters
btree:OpenBTree

Static information about the btree.

page:Page

The page described by this control row.

parent:ControlRow

The parent page of this page, "null" if this page is root or if not maintaining parent links.

isRoot:boolean

Is this page the root of the tree?

Exceptions
StandardException:
Standard exception policy.
ControlRowback to summary
protected ControlRow(ContainerHandle container, Page page) throws StandardException

Constructor for making a control row for an existing page.

Not all the fields are filled in; their values will get faulted in from the page as necessary.

Classes which extend ControlRow must delegate to this constructor and may want to override it as well. Changes to this constructor will probably require changes to the corresponding accessor(s).

Parameters
container:ContainerHandle

Open container

page:Page

The page described by this control row.

Exceptions
StandardException:
Standard exception policy.

Method Detail

auxObjectInvalidatedback to summary
public void auxObjectInvalidated()

Implements org.apache.derby.iapi.store.raw.AuxObject.auxObjectInvalidated.

Called when the page is being evicted from cache or when a rollback happened on the page and may possibly have changed the control row's value

See Also
AuxObject#auxObjectInvalidated
checkConsistencyback to summary
protected abstract int checkConsistency(OpenBTree btree, ControlRow parent, boolean check_other_pages) throws StandardException

Check consistency of the page and its children, returning the number of pages seen, and throwing errors if inconsistencies are found.

Parameters
btree:OpenBTree

The open btree to associate latches/locks with.

parent:ControlRow

The parent page of this page, "null" if this page is root or if not maintaining parent links.

check_other_pages:boolean

Should the consistency check go to other pages (this option breaks the latch protocol).

Returns:int

The identifier to be used to open the conglomerate later.

Exceptions
StandardException:
Standard exception policy.
checkGenericback to summary
protected void checkGeneric(OpenBTree btree, ControlRow parent, boolean check_other_pages) throws StandardException

Perform consistency checks which are common to all pages that derive from ControlRow (both leaf and branch pages). The checks are:

  • This page thinks the parent argument is actually its parent.
  • The level of this page is 1 less than the level of the parent.
  • All the rows on the page are in order.
  • Both left and right siblings, if they exist, are at the same level of this page.
  • This page is the left sibling of its right sibling, and it's the right sibling of its left sibling.
  • The last row on the left sibling is < the first row on this page.
  • The first row on the right sibling is > than the the last row on this page.
  • Note that these last two are really only true if there are never duplicate keys.
    Exceptions
    StandardException:
    Standard exception policy.
    checkRowOrderback to summary
    protected boolean checkRowOrder(OpenBTree btree, ControlRow parent) throws StandardException

    Check that all rows on the page are in order. This means that each key is > than the previous key.

    Exceptions
    StandardException:
    Standard exception policy.
    checkSiblingsback to summary
    protected void checkSiblings(OpenBTree btree) throws StandardException

    Perform checks on the siblings of this page: make sure that they're at the same level as this page, that they're mutually linked together, and that the first/last keys on sibling pages are in order.

    Exceptions
    StandardException:
    Standard exception policy.
    compareIndexRowFromPageToKeyback to summary
    public static int compareIndexRowFromPageToKey(ControlRow indexpage, int slot, DataValueDescriptor[] indexrow, DataValueDescriptor[] key, int nCompareCols, int partialKeyOrder, boolean[] ascOrDesc) throws StandardException

    Compare two orderable rows, considering nCompareCols, and return -1, 0, or 1 depending on whether the first row (indexrow) is less than, equal to, or greater than the second (key). The key may have fewer columns present than nCompareCols. In such a case, if all the columns of the partial key match all of the corresponding columns in the index row, then the value passed in in partialKeyOrder is returned. The caller should pass in partialKeyOrder=1 if the index rows which match a partial key should be considered to be greater than the partial key, and -1 if they should be considered to be less. This routine only reads objects off the page if it needs them, so if a multi-part key differs in the first column the subsequent columns are not read.

    Parameters
    indexpage:ControlRow

    Controlrow of page to get target row from.

    slot:int

    Slot to get control row from.

    indexrow:DataValueDescriptor[]

    template of the target row (the row in the index).

    key:DataValueDescriptor[]

    the (possibly partial) search key.

    nCompareCols:int

    the number of columns to compare.

    partialKeyOrder:int

    what to return on a partial key match.

    ascOrDesc:boolean[]

    column sort order information

    Exceptions
    StandardException:
    if lower levels have a problem.
    compareIndexRowToKeyback to summary
    public static int compareIndexRowToKey(DataValueDescriptor[] indexrow, DataValueDescriptor[] key, int nCompareCols, int partialKeyOrder, boolean[] ascOrDesc) throws StandardException
    compareRowsOnSiblingsback to summary
    protected boolean compareRowsOnSiblings(OpenBTree btree, ControlRow left_sib, ControlRow right_sib) throws StandardException
    controlRowInitback to summary
    protected abstract void controlRowInit()

    Perform page specific initialization.

    debugPageback to summary
    public String debugPage(OpenBTree open_btree) throws StandardException

    Dump complete information about control row and rows on the page.

    Returns:String

    string with all info.

    Exceptions
    StandardException:
    Standard exception policy.
    getback to summary
    public static ControlRow get(OpenBTree open_btree, long pageNumber) throws StandardException

    Get the control row from the given page in the b-tree. The returned control row will be of the correct type for the page (i.e., either a LeafControlRow or a BranchControlRow).

    Exceptions
    StandardException:
    Standard exception policy.
    getback to summary
    public static ControlRow get(ContainerHandle container, long pageNumber) throws StandardException
    getConglomback to summary
    public BTree getConglom(int format_id) throws StandardException

    Get format id information for row on page.

    Returns the format id information for a row on the page. faulting it in from the page if necessary.

    Returns:BTree

    format id of a row on the page.

    Exceptions
    StandardException:
    Standard exception policy.
    getControlRowForPageback to summary
    protected static ControlRow getControlRowForPage(ContainerHandle container, Page page) throws StandardException
    getIsRootback to summary
    protected boolean getIsRoot() throws StandardException
    getLeftChildback to summary
    protected abstract ControlRow getLeftChild(OpenBTree 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
    btree:OpenBTree

    The open btree to associate latches/locks with.

    Returns:ControlRow

    The page which is the leftmost child of this page.

    Exceptions
    StandardException:
    Standard exception policy.
    getLeftSiblingback to summary
    public ControlRow getLeftSibling(OpenBTree btree) throws StandardException, WaitError

    Get the control row for this page's left sibling, or null if there is no left sibling (which probably means it's the leftmost page at its level). Since right-to-left traversal of an index level is deadlock-prone, this method will only get get the left sibling if it can latch it without waiting.

    Exceptions
    StandardException:
    Standard exception policy.
    WaitError:
    if the latch request would have had to wait.
    getleftSiblingPageNumberback to summary
    public long getleftSiblingPageNumber() throws StandardException

    Get the page number of the left sibling. Fault it's value in if it hasn't been yet.

    Exceptions
    StandardException:
    Standard exception policy.
    getLevelback to summary
    protected int getLevel() throws StandardException
    getNoWaitback to summary
    public static ControlRow getNoWait(OpenBTree open_btree, long pageNumber) throws StandardException

    Get the control row for the given page if the latch on the page can be obtained without waiting, else return null.

    Exceptions
    StandardException:
    Standard exception policy.
    getNumberOfControlRowColumnsback to summary
    protected abstract int getNumberOfControlRowColumns()

    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.

    Returns:int

    The total number of columns in the control row.

    getPageback to summary
    public Page getPage()
    getParentPageNumberback to summary
    protected long getParentPageNumber() throws StandardException

    Get the page number of the parent, if it's being maintained. Note that there is intentionally no way to get the control row for the parent page - the b-tree code NEVER traverses up the tree, even in consistency checks.

    Exceptions
    StandardException:
    Standard exception policy.
    getRightChildback to summary
    protected abstract ControlRow getRightChild(OpenBTree btree) throws StandardException

    Return the right child pointer for the page.

    Leaf pages don't have children, so they override this and return null.

    Parameters
    btree:OpenBTree

    The open btree to associate latches/locks with.

    Returns:ControlRow

    The page which is the rightmost child of this page.

    Exceptions
    StandardException:
    Standard exception policy.
    getRightSiblingback to summary
    protected ControlRow getRightSibling(OpenBTree open_btree) throws StandardException

    Return the control row for this page's right sibling. Unlike getting the left sibling, it's ok to wait for the right sibling latch since left-to-right is the deadlock-free ordering.

    Exceptions
    StandardException:
    Standard exception policy.
    getrightSiblingPageNumberback to summary
    protected long getrightSiblingPageNumber() throws StandardException

    Get the page number of the right sibling. Fault it's value in if it hasn't been yet.

    Exceptions
    StandardException:
    Standard exception policy.
    getRowback to summary
    protected final DataValueDescriptor[] getRow()

    Get the row.

    Return the object array that represents the control row for use in raw store fetch, insert, and/or update.

    Returns:DataValueDescriptor[]

    The row.

    getRowTemplateback to summary
    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).

    Returns:DataValueDescriptor[]

    Newly allocated template.

    Exceptions
    StandardException:
    Standard exception policy.
    getVersionback to summary
    protected int getVersion() throws StandardException

    Get version of the control row.

    Returns the version of the control row, faulting it in from the page if necessary.

    Returns:int

    version of the control row.

    Exceptions
    StandardException:
    Standard exception policy.
    isLeftmostLeafback to summary
    public abstract boolean isLeftmostLeaf() throws StandardException

    Is the current page the leftmost leaf of tree?

    Returns:boolean

    true if the current page is the leftmost leaf of the tree, else return false.

    Exceptions
    StandardException:
    Standard exception policy.
    isRightmostLeafback to summary
    public abstract boolean isRightmostLeaf() throws StandardException

    Is the current page the rightmost leaf of tree?

    Returns:boolean

    true if the current page is the rightmost leaf of the tree, else return false.

    Exceptions
    StandardException:
    Standard exception policy.
    linkRightback to summary
    pack-priv void linkRight(OpenBTree btree, ControlRow target) throws StandardException

    Link this page to the right of the target page.

    Upon entry, this page and the target must be latched. Upon exit, this page and the target remain latched.

    This method carefully acquires pages from left to right in order to avoid deadlocks.

    Exceptions
    StandardException:
    Standard exception policy.
    printTreeback to summary
    public abstract void printTree(OpenBTree btree) throws StandardException

    Recursively print the tree starting at current node in tree.

    Exceptions
    StandardException:
    Standard exception policy.
    releaseback to summary
    public void release()

    Release this control row's resources.

    searchback to summary
    public abstract ControlRow search(SearchParameters search_params) 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 resultExact field will be true. Otherwise, resultExact field will be false, and the row slot returned will be the one immediately preceding the position at which the key belongs.

    Exceptions
    StandardException:
    Standard exception policy.
    searchForEntryback to summary
    protected void searchForEntry(SearchParameters params) throws StandardException

    Search this index page.

    This method is very performance sensitive. It is the intention that no object allocations occur during the execution of this method.

    This method performs a binary search on the page and finds the entry i on the page such that entry[i] <= key < entry[i+1]. The result of the search is filled into the passed in params structure.

    Parameters
    params:SearchParameters

    the parameters of the search

    Exceptions
    StandardException:
    could be thrown by underlying raw store operations.
    See Also
    SearchParameters
    searchForEntryBackwardback to summary
    protected void searchForEntryBackward(SearchParameters params) throws StandardException
    searchLeftback to summary
    protected abstract ControlRow searchLeft(OpenBTree btree) throws StandardException

    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()).

    Parameters
    btree:OpenBTree

    The open btree to associate latches/locks with.

    Returns:ControlRow

    The leftmost leaf page.

    Exceptions
    StandardException:
    Standard exception policy.
    searchRightback to summary
    protected abstract ControlRow searchRight(OpenBTree btree) throws StandardException

    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()).

    Parameters
    btree:OpenBTree

    The open btree to associate latches/locks with.

    Returns:ControlRow

    The rightmost leaf page.

    Exceptions
    StandardException:
    Standard exception policy.
    setIsRootback to summary
    protected void setIsRoot(boolean isRoot) throws StandardException
    setLeftSiblingback to summary
    protected void setLeftSibling(ControlRow leftsib) throws StandardException
    setLevelback to summary
    protected void setLevel(int newlevel) throws StandardException
    setParentback to summary
    pack-priv void setParent(long parent) throws StandardException
    setRightSiblingback to summary
    protected void setRightSibling(ControlRow rightsib) throws StandardException
    setVersionback to summary
    protected void setVersion(int version) throws StandardException

    Set version of the control row.

    Sets the version of the control row. Updates both the in-memory control row and the disk copy.

    Exceptions
    StandardException:
    Standard exception policy.
    shrinkForback to summary
    protected abstract boolean shrinkFor(OpenBTree btree, DataValueDescriptor[] key) throws StandardException

    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.

    As currently implemented shrinkFor must be executed while holding an exclusive container lock on the entire table. It is expected that this call is made within an internal transaction which has been called by a post commit thread. Latches are released by the code. The raw store guarantees that deallocated pages are not seen by other xacts until the transaction has been committed.

    Note that a non-table level lock implementation must hold latches on pages affected until end transaction.

    On entry, the current page is latched. On exit, all pages will have been unlatched.

    Exceptions
    StandardException:
    Standard exception policy.
    splitForback to summary
    protected abstract long splitFor(OpenBTree open_btree, DataValueDescriptor[] template, BranchControlRow parentpage, DataValueDescriptor[] row, int flag) throws StandardException

    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.

    Parameters
    open_btree:OpenBTree

    The open btree to associate latches with.

    template:DataValueDescriptor[]

    A scratch area to use while searching for split pass.

    parentpage:BranchControlRow

    The parent page of the current page in the split pass. starts at null for root.

    row:DataValueDescriptor[]

    The key to make room for during the split pass.

    flag:int

    A flag used to direct where point of split should be chosen.

    Returns:long

    page number of the newly allocated leaf page created by split.

    Exceptions
    StandardException:
    Standard exception policy.
    toStringback to summary
    public String toString()

    Overrides java.lang.Object.toString.

    The standard toString().

    This is a concise print out of the info in the control row, does not include anything the page.

    Returns:String

    Doc from java.lang.Object.toString.

    a string representation of the object