Fennel: LcsClusterVerifier Class Reference (original) (raw)

LcsClusterVerifier is a class for verifying cluster pages. More...

#include <[LcsClusterVerifier.h](LcsClusterVerifier%5F8h-source.html)>

Inheritance diagram for LcsClusterVerifier:

List of all members.

Public Member Functions
LcsClusterVerifier (BTreeDescriptor const &treeDescriptor)
ClusterPageData & getPageData ()
Retrieves cluster page data for the current cluster page.
void setRootPageId (PageId rootPageId)
Sets the root pageId of the underlying btree corresponding to the cluster.
void initColumnReaders (uint nClusterColsInit, TupleProjection const &clusterProj)
Initializes cluster reader with column readers.
void open ()
Initializes state variables used by cluster reader.
void close ()
Performs shutdown on cluster reader.
bool getFirstClusterPageForRead (PConstLcsClusterNode &pBlock)
Gets first page in a cluster.
bool getNextClusterPageForRead (PConstLcsClusterNode &pBlock)
Gets next page in a cluster, based on current position in btree.
bool isPositioned () const
Returns true if positioned within some range in a batch.
LcsRid getRangeStartRid () const
Returns first rid in a range.
LcsRid getRangeEndRid () const
Returns first rid after the end of the current range.
uint getRangeSize () const
Returns number of rids in the range.
uint getRangePos () const
Returns offset within the current range.
LcsRid getCurrentRid () const
Returns rid currently positioned at.
uint getRangeRowsLeft () const
Returns number of rids yet to be read.
bool position (LcsRid rid)
Positions scan on the rid, moving to a new range if necessary.
bool nextRange ()
Positions scan on the first rid of the next range.
bool advance (uint nRids)
Moves "nRids" forward in the current range.
void advanceWithinBatch (uint nRids)
Advances nRids forward in the current batch.
virtual PageId getNextPageForPrefetch (LcsRid &rid, bool &found)
Determines the next page to be pre-fetched based on the rids that need to be read.
void catchUp (uint parentBufPos, LcsRid parentNextRid)
Resynchronizes the cluster reader's prefetch position to that of the parent scan.
RecordNum getNumRows ()
**Returns:**the number of rows in the cluster
uint getNumClusterCols ()
Returns number of columns in cluster.
void setNumClusterCols (uint nCols)
Sets number of columns in cluster.
void unlockClusterPage ()
Unlocks cluster page.
virtual void initPrefetchEntry (LcsRid &entry)
Initializes a specific entry in the pre-fetch queue.
Static Public Member Functions
static LcsRid getFetchRids (CircularBufferIter< LcsRidRun > &ridRunIter, LcsRid &nextRid, bool remove)
Retrieves the current and next rids that need to be read, based on the current rid run being processed.
Public Attributes
uint nColsToRead
Number of cluster columns that will be read.
boost::scoped_array< LcsColumnReader > clusterCols
Column readers for each cluster column that will be read.
Protected Member Functions
LcsRid readRid ()
Returns RID from btree tuple.
PageId readClusterPageId ()
Returns cluster pageid from btree tuple.
void setHdrOffsets (PConstLcsClusterNode pHdr)
Sets pointers to offset arrays in cluster page header.
Protected Attributes
TupleData bTreeTupleData
Tuple data representing the btree key corresponding to the cluster page.
SegmentAccessor segmentAccessor
Accessor for segment storing both btree and cluster pages.
ClusterPageLock clusterLock
Buffer lock for the actual cluster node pages.
PageId clusterPageId
Current cluster pageid.
LcsRid bTreeRid
Current rid in btree used to access current cluster page.
uint nClusterCols
Number of columns in cluster.
uint16_t * lastVal
Offsets to the last value stored on the page for each column in cluster.
uint16_t * firstVal
Offsets to the first value stored on the page for each column in cluster.
uint * nVal
Number of distinct values in the page for each column in cluster.
uint16_t * delta
For each column in the cluster, offset used to get the real offset within the page.
Private Attributes
ClusterPageData pageData
Information gathered for the current cluster page.

Detailed Description

LcsClusterVerifier is a class for verifying cluster pages.

It reads cluster pages and gathers data regarding the page.

Definition at line 49 of file LcsClusterVerifier.h.


Constructor & Destructor Documentation

LcsClusterVerifier::LcsClusterVerifier ( BTreeDescriptor const & treeDescriptor ) [explicit]

Member Function Documentation

void LcsClusterReader::setRootPageId ( PageId rootPageId ) [inherited]
void LcsClusterReader::initColumnReaders ( uint nClusterColsInit,
TupleProjection const & clusterProj
) [inherited]

| void LcsClusterReader::open | ( | | ) | [inherited] | | --------------------------- | - | | - | ------------- |

| void LcsClusterReader::close | ( | | ) | [inherited] | | ---------------------------- | - | | - | ------------- |

| bool LcsClusterReader::isPositioned | ( | | ) | const [inline, inherited] | | ----------------------------------- | - | | - | --------------------------- |

| LcsRid LcsClusterReader::getRangeStartRid | ( | | ) | const [inline, inherited] | | ----------------------------------------- | - | | - | --------------------------- |

| LcsRid LcsClusterReader::getRangeEndRid | ( | | ) | const [inline, inherited] | | --------------------------------------- | - | | - | --------------------------- |

| uint LcsClusterReader::getRangeSize | ( | | ) | const [inline, inherited] | | ------------------------------------------------------------------------------------------------ | - | | - | --------------------------- |

| uint LcsClusterReader::getRangePos | ( | | ) | const [inline, inherited] | | ----------------------------------------------------------------------------------------------- | - | | - | --------------------------- |

| LcsRid LcsClusterReader::getCurrentRid | ( | | ) | const [inline, inherited] | | -------------------------------------- | - | | - | --------------------------- |

| uint LcsClusterReader::getRangeRowsLeft | ( | | ) | const [inline, inherited] | | ---------------------------------------------------------------------------------------------------- | - | | - | --------------------------- |

bool LcsClusterReader::position ( LcsRid rid ) [inherited]

Positions scan on the rid, moving to a new range if necessary.

Parameters:

Returns:

false if rid is beyond end of cluster

Definition at line 135 of file LcsClusterReader.cpp.

References LcsClusterReader::bTreeReader, LcsClusterReader::currRid, SegPageEntryIter< EntryT >::mapRange(), LcsClusterReader::moveToBlock(), LcsClusterReader::moveToBlockWithRid(), LcsClusterReader::noPrefetch, NULL_PAGE_ID, LcsClusterReader::pLeaf, LcsClusterReader::positionInBlock(), LcsClusterReader::prefetchQueue, LcsClusterAccessBase::readClusterPageId(), LcsClusterReader::searchForRid(), and LcsClusterAccessBase::segmentAccessor.

Referenced by LcsClusterReader::nextRange().

| bool LcsClusterReader::nextRange | ( | | ) | [inline, inherited] | | -------------------------------- | - | | - | --------------------- |

bool LcsClusterReader::advance ( uint nRids ) [inherited]

Moves "nRids" forward in the current range.

Parameters:

nRids number of rids to move forward

Returns:

false if we are at the endof the range and therefore cannot advance the desired number of rids

Definition at line 295 of file LcsClusterReader.cpp.

References LcsClusterReader::nRangePos.

00296 { 00297 uint newPos = nRangePos + nRids; 00298 00299 if (newPos < pRangeBatches->nRow) { 00300 nRangePos = newPos; 00301 return true; 00302 } else { 00303 return false; 00304 } 00305 }

void LcsClusterReader::advanceWithinBatch ( uint nRids ) [inline, inherited]
PageId LcsClusterReader::getNextPageForPrefetch ( LcsRid & rid,
bool & found
) [virtual, inherited]

Determines the next page to be pre-fetched based on the rids that need to be read.

Parameters:

[out] rid returns the rid corresponding to the page to be pre-fetched
[out] found true if a pre-fetch page was found

Returns:

the page to be pre-fetched next

Implements SegPageEntryIterSource< LcsRid >.

Definition at line 307 of file LcsClusterReader.cpp.

References LcsClusterReader::currRid, CircularBufferIter< T >::done(), LcsClusterReader::dumbPrefetch, LcsClusterReader::getFetchRids(), LcsClusterReader::getNextBTreeEntry(), MAXU, LcsClusterReader::nextBTreeEntry, LcsClusterReader::nextRid, NULL_PAGE_ID, LcsClusterAccessBase::readClusterPageId(), LcsClusterAccessBase::readRid(), LcsClusterReader::ridRunIter, and LcsClusterReader::searchForRid().

LcsRid LcsClusterReader::getFetchRids ( CircularBufferIter< LcsRidRun > & ridRunIter,
LcsRid & nextRid,
bool remove
) [static, inherited]

Retrieves the current and next rids that need to be read, based on the current rid run being processed.

Parameters:

ridRunIter iterator over the circular buffer that provides the rid runs
[in,out] nextRid on input, indicates the minimum rid value to be retrieved; on return, the next rid that will need to be read
remove if true, remove the first element from the circular buffer if the rid run buffer's position is incremented

Returns:

the current rid that needs to be read

Definition at line 390 of file LcsClusterReader.cpp.

References CircularBufferIter< T >::end(), MAXU, LcsRidRun::nRids, CircularBufferIter< T >::removeFront(), LcsClusterReader::ridRunIter, and LcsRidRun::startRid.

Referenced by LcsRowScanExecStream::execute(), and LcsClusterReader::getNextPageForPrefetch().

void LcsClusterReader::catchUp ( uint parentBufPos,
LcsRid parentNextRid
) [inherited]

| RecordNum LcsClusterReader::getNumRows | ( | | ) | [inherited] | | ------------------------------------------------------------------------------------------ | - | | - | ------------- |

| LcsRid LcsClusterAccessBase::readRid | ( | | ) | [protected, inherited] | | ------------------------------------ | - | | - | ------------------------ |

| PageId LcsClusterAccessBase::readClusterPageId | ( | | ) | [protected, inherited] | | ---------------------------------------------- | - | | - | ------------------------ |

| uint LcsClusterAccessBase::getNumClusterCols | ( | | ) | [inline, inherited] | | --------------------------------------------------------------------------------------------------------- | - | | - | --------------------- |

void LcsClusterAccessBase::setNumClusterCols ( uint nCols ) [inline, inherited]

| void LcsClusterAccessBase::unlockClusterPage | ( | | ) | [inherited] | | -------------------------------------------- | - | | - | ------------- |

virtual void SegPageEntryIterSource< LcsRid >::initPrefetchEntry ( LcsRid & entry ) [inline, virtual, inherited]

Initializes a specific entry in the pre-fetch queue.

Parameters:

entry the entry that will be initialized

Definition at line 46 of file SegPageEntryIterSource.h.


Member Data Documentation

Number of columns in cluster.

Definition at line 68 of file LcsClusterAccessBase.h.

Referenced by LcsClusterNodeWriter::addValue(), LcsClusterNodeWriter::allocArrays(), LcsClusterDump::dump(), LcsClusterReader::getNumRows(), LcsClusterNodeWriter::init(), LcsClusterReader::initColumnReaders(), LcsClusterNodeWriter::LcsClusterNodeWriter(), LcsClusterNodeWriter::moveFromIndexToTemp(), LcsClusterNodeWriter::moveFromTempToIndex(), LcsClusterNodeWriter::openAppend(), LcsClusterNodeWriter::openNew(), LcsClusterReader::positionInBlock(), and LcsClusterAccessBase::setHdrOffsets().

Offsets to the last value stored on the page for each column in cluster.

Definition at line 74 of file LcsClusterAccessBase.h.

Referenced by LcsClusterNodeWriter::addValue(), LcsClusterDump::dump(), LcsClusterNodeWriter::moveFromIndexToTemp(), LcsClusterNodeWriter::moveFromTempToIndex(), LcsClusterNodeWriter::openAppend(), LcsClusterNodeWriter::openNew(), LcsClusterNodeWriter::pickCompressionMode(), LcsClusterNodeWriter::putCompressedBatch(), LcsClusterNodeWriter::putFixedVarBatch(), LcsClusterNodeWriter::rollBackLastBatch(), LcsClusterAccessBase::setHdrOffsets(), and LcsClusterNodeWriter::undoValue().

Number of distinct values in the page for each column in cluster.

Definition at line 87 of file LcsClusterAccessBase.h.

Referenced by LcsClusterNodeWriter::addValue(), LcsClusterDump::dump(), LcsClusterNodeWriter::moveFromIndexToTemp(), LcsClusterNodeWriter::moveFromTempToIndex(), LcsClusterNodeWriter::openAppend(), LcsClusterNodeWriter::openNew(), LcsClusterNodeWriter::pickCompressionMode(), LcsClusterNodeWriter::putCompressedBatch(), LcsClusterNodeWriter::putFixedVarBatch(), LcsClusterNodeWriter::rollBackLastBatch(), LcsClusterAccessBase::setHdrOffsets(), and LcsClusterNodeWriter::undoValue().


The documentation for this class was generated from the following files:


Generated on Mon Jun 22 04:00:37 2009 for Fennel by doxygen 1.5.1