BTreeNode Struct Reference

Header stored on each page of a BTree. More...

#include <BTreeNode.h>

Inheritance diagram for BTreeNode:

StoredNode List of all members.

Public Member Functions

PBuffer getDataForWrite ()
 
Returns:
writable start of data after header

PConstBuffer getDataForRead () const
 
Returns:
read-only start of data after header


Public Attributes

PageId rightSibling
 Link to right sibling.
uint nEntries
 Number of entries stored on this node.
uint height
 Height of this node in the tree (0 for leaf).
uint cbTotalFree
 Amount of (possibly discontiguous) free space available on this page.
uint cbCompactFree
 Amount of contiguous free space available on this page.
MagicNumber magicNumber
 Magic number identifying the derived StoredNode class.

Static Public Attributes

static const MagicNumber MAGIC_NUMBER = 0x9d4ec481f86aa93eLL

Detailed Description

Header stored on each page of a BTree.

Definition at line 34 of file BTreeNode.h.


Member Function Documentation

PBuffer BTreeNode::getDataForWrite (  )  [inline]

Returns:
writable start of data after header

Definition at line 76 of file BTreeNode.h.

Referenced by BTreeCompactNodeAccessor::allocateEntry(), BTreeCompactNodeAccessor::deallocateEntry(), BTreeHeapNodeAccessor::getEntryOffsetPointer(), and BTreeWriter::grow().

00077     {
00078         return reinterpret_cast<PBuffer>(this + 1);
00079     }

PConstBuffer BTreeNode::getDataForRead (  )  const [inline]

Returns:
read-only start of data after header

Definition at line 84 of file BTreeNode.h.

Referenced by BTreeCompactNodeAccessor::getEntryForReadInline(), BTreeHeapNodeAccessor::getEntryOffsetPointer(), and BTreeWriter::grow().

00085     {
00086         return reinterpret_cast<PConstBuffer>(this + 1);
00087     }


Member Data Documentation

const MagicNumber BTreeNode::MAGIC_NUMBER = 0x9d4ec481f86aa93eLL [static]

Definition at line 37 of file BTreeNode.h.

Referenced by BTreeVerifier::verifyNode().

PageId BTreeNode::rightSibling

Link to right sibling.

This is redundant with Segment::getPageSuccessor. We store it in both places since when we've already locked a node, it's faster to use rightSibling, but when we're doing prefetch, we need Segment::getPageSuccessor (since if we already knew what was on a page, we wouldn't need to prefetch it!).

Definition at line 46 of file BTreeNode.h.

Referenced by BTreeNodeAccessor::clearNode(), BTreeNodeAccessor::dumpNode(), BTreeAccessBase::getFirstChild(), BTreeNodeAccessor::getKeyCount(), BTreeWriter::lockParentPage(), BTreeReader::searchExtremeInternal(), BTreeReader::searchForKeyTemplate(), BTreeAccessBase::setRightSibling(), BTreeWriter::splitCurrentNode(), BTreeVerifier::verifyChildren(), and BTreeVerifier::verifyNode().

uint BTreeNode::nEntries

Number of entries stored on this node.

Definition at line 51 of file BTreeNode.h.

Referenced by BTreeKeyedNodeAccessor< NodeAccessor, KeyAccessor >::accessTupleInline(), BTreeHeapNodeAccessor::allocateEntry(), BTreeCompactNodeAccessor::allocateEntry(), BTreeKeyedNodeAccessor< NodeAccessor, KeyAccessor >::binarySearch(), BTreeBuilder::buildBalanced(), BTreeWriter::checkMonotonicity(), BTreeNodeAccessor::clearNode(), BTreeNodeAccessor::compactNode(), BTreeHeapNodeAccessor::deallocateEntry(), BTreeCompactNodeAccessor::deallocateEntry(), BTreeNodeAccessor::dumpNode(), BTreeHeapNodeAccessor::getEntryOffset(), BTreeAccessBase::getFirstChild(), BTreeNodeAccessor::getKeyCount(), BTreeWriter::grow(), BTreeBuildLevel::indexLastChild(), FixedBuildLevel::isNodeFull(), BTreeBuildLevel::processInput(), BTreeLeafReader::searchExtreme(), BTreeReader::searchExtremeInternal(), BTreeReader::searchForKeyTemplate(), BTreeLeafReader::searchNext(), BTreeWriter::splitCurrentNode(), BTreeNodeAccessor::splitNode(), BTreeBuilder::swapRoot(), BTreeBuilder::truncate(), BTreeBuilder::truncateChildren(), BTreeBuildLevel::unmarshalLastKey(), BTreeVerifier::verifyChildren(), and BTreeVerifier::verifyNode().

uint BTreeNode::height

Height of this node in the tree (0 for leaf).

Definition at line 56 of file BTreeNode.h.

Referenced by BTreeBuildLevel::allocatePage(), BTreeKeyedNodeAccessor< NodeAccessor, KeyAccessor >::binarySearch(), BTreeBuilder::buildBalanced(), BTreeNodeAccessor::clearNode(), BTreeNodeAccessor::dumpNode(), BTreeAccessBase::getFirstChild(), BTreeNodeAccessor::getKeyCount(), BTreeAccessBase::getLeafNodeAccessor(), BTreeAccessBase::getNodeAccessor(), BTreeAccessBase::getNonLeafNodeAccessor(), BTreeWriter::grow(), BTreeNonLeafReader::isRootOnly(), BTreeWriter::lockParentPage(), BTreeReader::searchExtremeInternal(), BTreeReader::searchForKeyTemplate(), BTreeWriter::splitCurrentNode(), BTreeNodeAccessor::splitNode(), BTreeBuilder::truncate(), BTreeBuilder::truncateChildren(), BTreeVerifier::verifyChildren(), and BTreeVerifier::verifyNode().

uint BTreeNode::cbTotalFree

Amount of (possibly discontiguous) free space available on this page.

Definition at line 61 of file BTreeNode.h.

Referenced by BTreeHeapNodeAccessor::allocateEntry(), BTreeCompactNodeAccessor::allocateEntry(), BTreeHeapNodeAccessor::calculateCapacity(), BTreeCompactNodeAccessor::calculateCapacity(), BTreeNodeAccessor::clearNode(), BTreeHeapNodeAccessor::clearNode(), BTreeNodeAccessor::compactNode(), BTreeHeapNodeAccessor::deallocateEntry(), BTreeCompactNodeAccessor::deallocateEntry(), BTreeNodeAccessor::dumpNode(), and BTreeNodeAccessor::splitNode().

uint BTreeNode::cbCompactFree

Amount of contiguous free space available on this page.

If MAXU, ignore (that means only cbTotalFree is maintained).

Definition at line 67 of file BTreeNode.h.

Referenced by BTreeHeapNodeAccessor::allocateEntry(), BTreeHeapNodeAccessor::calculateCapacity(), BTreeNodeAccessor::clearNode(), BTreeHeapNodeAccessor::clearNode(), BTreeNodeAccessor::compactNode(), and BTreeNodeAccessor::dumpNode().

MagicNumber StoredNode::magicNumber [inherited]

Magic number identifying the derived StoredNode class.

Definition at line 394 of file SegPageLock.h.

Referenced by Database::init(), and BTreeVerifier::verifyNode().


The documentation for this struct was generated from the following file:
Generated on Mon Jun 22 04:00:25 2009 for Fennel by  doxygen 1.5.1