Fennel: SegNodeLock< Node > Class Template Reference (original) (raw)
SegNodeLock refines SegPageLock to allow typecasting to be hidden. More...
#include <[SegPageLock.h](SegPageLock%5F8h-source.html)>
Inheritance diagram for SegNodeLock< Node >:

| Public Member Functions | |
|---|---|
| SegNodeLock () | |
| SegNodeLock (SegmentAccessor &segmentAccessor) | |
| bool | checkMagicNumber () const |
| Node const & | getNodeForRead () const |
| Node & | getNodeForWrite () |
| PageId | allocatePage (PageOwnerId ownerId=ANON_PAGE_OWNER_ID) |
| PageId | tryAllocatePage (PageOwnerId ownerId=ANON_PAGE_OWNER_ID) |
| void | setMagicNumber () |
| bool | isMagicNumberValid () |
| void | accessSegment (SegmentAccessor const &segmentAccessorInit) |
| bool | isLocked () const |
| CachePage & | getPage () const |
| void | deallocateLockedPage () |
| void | deallocateUnlockedPage (PageId pageId) |
| void | unlock () |
| void | dontUnlock () |
| void | lockPage (PageId pageId, LockMode lockModeInit, bool readIfUnmapped=true) |
| void | lockPageWithCoupling (PageId pageId, LockMode lockModeInit) |
| void | lockShared (PageId pageId) |
| void | lockExclusive (PageId pageId) |
| void | lockSharedNoWait (PageId pageId) |
| void | lockExclusiveNoWait (PageId pageId) |
| void | updatePage () |
| void | lockUpdatePage (PageId updatePageId) |
| PageId | getPageId () |
| void | flushPage (bool async) |
| void | swapBuffers (SegPageLock &other) |
| bool | tryUpgrade () |
| SharedCacheAccessor | getCacheAccessor () const |
| Private Member Functions | |
| void | verifyMagicNumber (Node const &node) const |
Detailed Description
template
class SegNodeLock< Node >
SegNodeLock refines SegPageLock to allow typecasting to be hidden.
Whereas a SegPageLock references an arbitrary CachePage, usage of SegNodeLock demonstrates the intention to lock only pages of a given type. The Node template parameter determines the derived class of StoredNode. It must have a static member MAGIC_NUMBER defining its unique magic number. (To generate these, I run uuidgen on Linux and take the last 16 nybbles.)
For more information, see the HOWTO.
Definition at line 414 of file SegPageLock.h.
Constructor & Destructor Documentation
Member Function Documentation
template
| void SegNodeLock< Node >::verifyMagicNumber | ( | Node const & | node | ) | const [inline, private] |
|---|
template
| bool SegNodeLock< Node >::checkMagicNumber | ( | | ) | const [inline] | | ------------------------------------------------------------------- | - | | - | ---------------- |
template
| Node const& SegNodeLock< Node >::getNodeForRead | ( | | ) | const [inline] | | ------------------------------------------------------------------------ | - | | - | ---------------- |
Definition at line 439 of file SegPageLock.h.
References SegPageLock::getPage(), CachePage::getReadableData(), and SegNodeLock< Node >::verifyMagicNumber().
Referenced by BTreeReader::accessLeafTuple(), RandomAllocationSegmentBase::allocatePageIdFromSegment(), VersionedRandomAllocationSegment::backupAllocationNodes(), BTreeWriter::checkMonotonicity(), VersionedRandomAllocationSegment::copyPageEntryToTemp(), BTreeAccessBase::getFirstChild(), VersionedRandomAllocationSegment::getOldestTxnId(), VersionedRandomAllocationSegment::getOldPageIds(), FixedBuildLevel::indexLastKey(), BTreeBuildLevel::isFinished(), BTreeNonLeafReader::isPositionedOnInfinityKey(), BTreeNonLeafReader::isRootOnly(), Database::loadHeader(), VersionedRandomAllocationSegment::locateDataPages(), SegInputStream::lockBuffer(), CrcSegInputStream::lockBufferParanoid(), BTreeWriter::lockParentPage(), LcsClusterReader::moveToBlock(), LcsClusterReader::moveToBlockWithRid(), LcsClusterReader::readClusterPage(), VersionedRandomAllocationSegment::restoreFromBackup(), BTreeLeafReader::searchExtreme(), BTreeReader::searchExtremeInternal(), BTreeReader::searchForKeyTemplate(), BTreeReader::searchNext(), BTreeNonLeafReader::searchNext(), BTreeLeafReader::searchNext(), BTreeReader::searchNextInternal(), BTreeWriter::splitCurrentNode(), RandomAllocationSegmentBase::tallySegAllocNodePages(), BTreeBuilder::truncate(), BTreeBuilder::truncateChildren(), VersionedRandomAllocationSegment::uncommittedDeallocation(), BTreeBuildLevel::unmarshalLastKey(), VersionedRandomAllocationSegment::validateFreePageCount(), BTreeVerifier::verifyNode(), and BackupRestoreTest::verifySnapshotData().
template
| Node& SegNodeLock< Node >::getNodeForWrite | ( | | ) | [inline] | | ------------------------------------------------------------------- | - | | - | ---------- |
Definition at line 447 of file SegPageLock.h.
References SegPageLock::getPage(), CachePage::getWritableData(), and SegPageLock::updatePage().
Referenced by VersionedRandomAllocationSegment::allocateAllocNodes(), BTreeBuildLevel::allocateAndLinkNewNode(), LcsClusterNodeWriter::allocateClusterPage(), Database::allocateHeader(), BTreeBuildLevel::allocatePage(), RandomAllocationSegmentBase::allocatePageIdFromSegment(), BTreeWriter::attemptInsertWithoutSplit(), BTreeBuilder::buildBalanced(), VersionedRandomAllocationSegment::chainPageEntries(), BTreeWriter::compactNode(), VersionedRandomAllocationSegment::copyPageEntryFromTemp(), VersionedRandomAllocationSegment::copyPageEntryToTemp(), BTreeBuilder::createEmptyRoot(), BackupRestoreTest::createSnapshotData(), RandomAllocationSegmentBase::deallocatePageId(), VersionedRandomAllocationSegment::deallocateSinglePage(), VersionedRandomAllocationSegment::deferDeallocation(), BTreeWriter::deleteCurrent(), BackupRestoreTest::executeSnapshotTxn(), SegOutputStream::flushBuffer(), RandomAllocationSegmentBase::format(), LcsClusterNodeWriter::getLastClusterPageForWrite(), BTreeWriter::grow(), BTreeBuildLevel::indexLastChild(), VersionedRandomAllocationSegment::initPageEntry(), BTreeBuildLevel::processInput(), SegNodeLock< Node >::setMagicNumber(), BTreeWriter::splitCurrentNode(), BTreeBuilder::swapRoot(), BTreeBuilder::truncate(), BTreeWriter::updateCurrent(), VersionedRandomAllocationSegment::updateExtentEntry(), SegOutputStream::updatePage(), VersionedRandomAllocationSegment::updateTempPageEntry(), and Database::writeHeader().
Reimplemented from SegPageLock.
Definition at line 453 of file SegPageLock.h.
References SegPageLock::allocatePage(), and SegNodeLock< Node >::setMagicNumber().
Referenced by LcsClusterNodeWriter::allocArrays(), LcsClusterNodeWriter::allocateClusterPage(), Database::allocateHeader(), BTreeBuildLevel::allocatePage(), BTreePrefetchSearchExecStream::allocateScratchPages(), BTreeWriter::compactNode(), BTreeBuilder::createEmptyRoot(), BackupRestoreTest::createSnapshotData(), SegOutputStream::flushBuffer(), BTreeWriter::grow(), LbmGeneratorExecStream::initBitmapTable(), LcsClusterAppendExecStream::initLoad(), and BTreeWriter::splitCurrentNode().
template
| void SegNodeLock< Node >::setMagicNumber | ( | | ) | [inline] | | ----------------------------------------------------------------- | - | | - | ---------- |
template
| bool SegNodeLock< Node >::isMagicNumberValid | ( | | ) | [inline] | | --------------------------------------------------------------------- | - | | - | ---------- |
| void SegPageLock::accessSegment | ( | SegmentAccessor const & | segmentAccessorInit | ) | [inline, inherited] |
|---|
Definition at line 119 of file SegPageLock.h.
References SegmentAccessor::pCacheAccessor, and SegmentAccessor::pSegment.
Referenced by BTreeBuildLevel::allocateAndLinkNewNode(), BTreeBuildLevel::BTreeBuildLevel(), BTreeReader::BTreeReader(), BTreeWriter::BTreeWriter(), BTreeBuilder::createEmptyRoot(), ExternalSortRunLoader::ExternalSortRunLoader(), SegPageBackupRestoreDevice::init(), LhxHashTable::init(), LcsClusterAccessBase::LcsClusterAccessBase(), LcsClusterNodeWriter::LcsClusterNodeWriter(), LcsClusterAppendExecStream::prepare(), LbmUnionExecStream::prepare(), LbmGeneratorExecStream::prepare(), LbmChopperExecStream::prepare(), BTreePrefetchSearchExecStream::prepare(), FlatFileExecStreamImpl::prepare(), ScratchBufferExecStream::prepare(), MockResourceExecStream::prepare(), DoubleBufferExecStream::prepare(), SpillOutputStream::SpillOutputStream(), LbmEntryTest::testldb35(), LbmEntryTest::testler5920(), LbmEntryTest::testMergeEntry(), LbmEntryTest::testZeroBytes(), BTreeBuilder::truncate(), BTreeBuilder::truncateChildren(), BTreeBuilder::truncateExternal(), and BTreeVerifier::verifyNode().
| bool SegPageLock::isLocked | ( | | ) | const [inline, inherited] | | -------------------------- | - | | - | --------------------------- |
Definition at line 129 of file SegPageLock.h.
Referenced by LcsClusterNodeWriter::allocateClusterPage(), LcsClusterNodeWriter::close(), SpillOutputStream::closeImpl(), BTreeWriter::compactNode(), BTreeWriter::deleteCurrent(), SpillOutputStream::flushBuffer(), SegOutputStream::flushBuffer(), SpillOutputStream::getInputStream(), BTreeReader::isPositioned(), BTreeNonLeafReader::isPositionedOnInfinityKey(), SegmentTestBase::lockPage(), ScratchBufferExecStream::open(), DoubleBufferExecStream::open(), SegInputStream::readNextBuffer(), BTreeReader::searchNext(), BTreeNonLeafReader::searchNext(), BTreeLeafReader::searchNext(), SegPageLock::swapBuffers(), BTreeWriter::updateCurrent(), and SegOutputStream::updatePage().
00130 { 00131 return pPage ? true : false; 00132 }
| CachePage& SegPageLock::getPage | ( | | ) | const [inline, inherited] | | ------------------------------------------------------ | - | | - | --------------------------- |
Definition at line 134 of file SegPageLock.h.
Referenced by LcsClusterNodeWriter::allocArrays(), BTreeBuildLevel::allocateAndLinkNewNode(), LbmEntryTest::allocateBuf(), ExternalSortRunLoader::allocateBuffer(), BTreePrefetchSearchExecStream::allocateScratchPages(), LhxHashTable::allocBlock(), VersionedRandomAllocationSegment::backupAllocationNodes(), SegNodeLock< Node >::checkMagicNumber(), DoubleBufferExecStream::execute(), SegOutputStream::flushBuffer(), SpillOutputStream::getInputStream(), SegNodeLock< Node >::getNodeForRead(), SegNodeLock< Node >::getNodeForWrite(), LbmGeneratorExecStream::initBitmapTable(), LcsClusterAppendExecStream::initLoad(), SegPageBackupRestoreDevice::initScratchPages(), SegNodeLock< Node >::isMagicNumberValid(), VersionedRandomAllocationSegment::locateDataPages(), CrcSegInputStream::lockBufferParanoid(), SegmentTestBase::lockPage(), VersionedSegment::notifyPageDirty(), LbmUnionExecStream::open(), LbmChopperExecStream::open(), FlatFileExecStreamImpl::open(), ScratchBufferExecStream::open(), DoubleBufferExecStream::open(), VersionedSegment::recover(), SpillOutputStream::spill(), SpillOutputStream::SpillOutputStream(), RandomAllocationSegmentTest::testAllocateAndDeallocate(), and Database::writeHeader().
| void SegPageLock::deallocateLockedPage | ( | | ) | [inline, inherited] | | -------------------------------------- | - | | - | --------------------- |
| void SegPageLock::deallocateUnlockedPage | ( | PageId | pageId | ) | [inline, inherited] |
|---|
| void SegPageLock::unlock | ( | | ) | [inline, inherited] | | ------------------------ | - | | - | --------------------- |
Definition at line 179 of file SegPageLock.h.
Referenced by BTreeReader::adjustRootLockMode(), LcsClusterNodeWriter::allocArrays(), LbmEntryTest::allocateBuf(), ExternalSortRunLoader::allocateBuffer(), Database::allocateHeader(), RandomAllocationSegmentBase::allocatePageIdFromSegment(), LhxHashTable::allocBlock(), LcsClusterNodeWriter::close(), SpillOutputStream::closeImpl(), SegStream::closeImpl(), SegInputStream::closeImpl(), ScratchBufferExecStream::closeImpl(), DoubleBufferExecStream::closeImpl(), BackupRestoreTest::createSnapshotData(), BTreeReader::endSearch(), BackupRestoreTest::executeSnapshotTxn(), SegOutputStream::flushBuffer(), BTreeWriter::grow(), LcsClusterAppendExecStream::initLoad(), BTreeNonLeafReader::isRootOnly(), VersionedRandomAllocationSegment::locateDataPages(), CrcSegInputStream::lockBuffer(), BTreeWriter::lockParentPage(), LbmUnionExecStream::open(), SegInputStream::readNextBuffer(), BTreeWriter::releaseScratchBuffers(), BTreeReader::searchForKeyTemplate(), SpillOutputStream::spill(), BTreeWriter::splitCurrentNode(), SegmentTestBase::testAllocate(), RandomAllocationSegmentTest::testAllocateAndDeallocate(), SegPageIterTest::testIter(), SegPageEntryIterTest::testIter(), BTreeBuilder::truncateChildren(), and LcsClusterAccessBase::unlockClusterPage().
| void SegPageLock::dontUnlock | ( | | ) | [inline, inherited] | | ---------------------------- | - | | - | --------------------- |
| void SegPageLock::lockPage | ( | PageId | pageId, |
|---|---|---|---|
| LockMode | lockModeInit, | ||
| bool | readIfUnmapped = true | ||
| ) | [inline, inherited] |
| void SegPageLock::lockPageWithCoupling | ( | PageId | pageId, |
|---|---|---|---|
| LockMode | lockModeInit | ||
| ) | [inline, inherited] |
| void SegPageLock::lockShared | ( | PageId | pageId | ) | [inline, inherited] |
|---|
Definition at line 232 of file SegPageLock.h.
References LOCKMODE_S.
Referenced by VersionedRandomAllocationSegment::backupAllocationNodes(), VersionedRandomAllocationSegment::copyPageEntryToTemp(), BTreeAccessBase::getFirstChild(), VersionedRandomAllocationSegment::getOldestTxnId(), VersionedRandomAllocationSegment::getOldPageIds(), Database::loadHeader(), VersionedRandomAllocationSegment::locateDataPages(), SegInputStream::lockBuffer(), CrcSegInputStream::lockBufferParanoid(), LcsClusterReader::moveToBlock(), LcsClusterReader::moveToBlockWithRid(), LcsClusterReader::readClusterPage(), VersionedRandomAllocationSegment::restoreFromBackup(), SegmentTestBase::testDeallocate(), SegPageIterTest::testIter(), SegPageEntryIterTest::testIter(), VersionedRandomAllocationSegment::uncommittedDeallocation(), VersionedRandomAllocationSegment::validateFreePageCount(), BTreeVerifier::verifyNode(), and BackupRestoreTest::verifySnapshotData().
| void SegPageLock::lockExclusive | ( | PageId | pageId | ) | [inline, inherited] |
|---|
Definition at line 237 of file SegPageLock.h.
References LOCKMODE_X.
Referenced by VersionedRandomAllocationSegment::allocateAllocNodes(), BTreeBuildLevel::allocateAndLinkNewNode(), RandomAllocationSegmentBase::allocatePageIdFromSegment(), BTreeBuilder::buildBalanced(), VersionedRandomAllocationSegment::chainPageEntries(), VersionedRandomAllocationSegment::copyPageEntryFromTemp(), VersionedRandomAllocationSegment::copyPageEntryToTemp(), RandomAllocationSegmentBase::deallocatePageId(), VersionedRandomAllocationSegment::deallocateSinglePage(), VersionedRandomAllocationSegment::deferDeallocation(), BackupRestoreTest::executeSnapshotTxn(), RandomAllocationSegmentBase::format(), LcsClusterNodeWriter::getLastClusterPageForWrite(), VersionedRandomAllocationSegment::initPageEntry(), VersionedSegment::recover(), BTreeBuilder::swapRoot(), RandomAllocationSegmentBase::tallySegAllocNodePages(), BTreeBuilder::truncate(), BTreeBuilder::truncateChildren(), VersionedRandomAllocationSegment::updateExtentEntry(), VersionedRandomAllocationSegment::updateTempPageEntry(), VersionedRandomAllocationSegment::validateFreePageCount(), and Database::writeHeader().
| void SegPageLock::lockSharedNoWait | ( | PageId | pageId | ) | [inline, inherited] |
|---|
| void SegPageLock::lockExclusiveNoWait | ( | PageId | pageId | ) | [inline, inherited] |
|---|
| void SegPageLock::updatePage | ( | | ) | [inline, inherited] | | ---------------------------- | - | | - | --------------------- |
| void SegPageLock::lockUpdatePage | ( | PageId | updatePageId | ) | [inline, inherited] |
|---|
| PageId SegPageLock::getPageId | ( | | ) | [inline, inherited] | | ----------------------------- | - | | - | --------------------- |
| void SegPageLock::flushPage | ( | bool | async | ) | [inline, inherited] |
|---|
| void SegPageLock::swapBuffers | ( | SegPageLock & | other | ) | [inline, inherited] |
|---|
| bool SegPageLock::tryUpgrade | ( | | ) | [inline, inherited] | | ---------------------------- | - | | - | --------------------- |
The documentation for this class was generated from the following file:
- /home/pub/open/dev/fennel/segment/SegPageLock.h
