Fennel: VersionedSegment Class Reference (original) (raw)
VersionedSegment provides versioned updates to an underlying data segment by keeping before-images of modified pages in a separate write-ahead log segment. More...
#include <[VersionedSegment.h](VersionedSegment%5F8h-source.html)>
Inheritance diagram for VersionedSegment:

| Public Types | |
|---|---|
| enum | AllocationOrder { RANDOM_ALLOCATION, ASCENDING_ALLOCATION, CONSECUTIVE_ALLOCATION, LINEAR_ALLOCATION } |
| Enumeration of the possible orderings of PageIds returned from allocatePageId. More... | |
| Public Member Functions | |
| virtual | ~VersionedSegment () |
| void | recover (SharedSegment pDelegatingSegment, PageId firstLogPageId, SegVersionNum versionNumber=MAXU) |
| Recovers to a specific version from the log. | |
| void | recover (SharedSegment pDelegatingSegment, PageId firstLogPageId, SegVersionNum versionNumber, PseudoUuid const &onlineUuid) |
| Recovers to a specific version from the log and resets the online uuid. | |
| void | prepareOnlineRecovery () |
| Prepares for "online" recovery, meaning a revert back to the last checkpointed version. | |
| PageId | getRecoveryPageId () const |
| **Returns:**the PageId of the oldest log page still needed for recovery after a crash | |
| PageId | getOnlineRecoveryPageId () const |
| **Returns:**the PageId of the oldest log page still needed for recovery while online | |
| SegVersionNum | getPageVersion (CachePage &page) |
| Gets the version number of a locked page. | |
| SegVersionNum | getVersionNumber () const |
| **Returns:**the current version number for this segment | |
| SharedSegment | getLogSegment () const |
| **Returns:**the WAL segment | |
| void | deallocateCheckpointedLog (CheckpointType checkpointType) |
| Deallocates any old log pages which have become irrelevant after a checkpoint. | |
| virtual void | deallocatePageRange (PageId startPageId, PageId endPageId) |
| Deallocates a range of pages allocated from this segment. | |
| virtual void | delegatedCheckpoint (Segment &delegatingSegment, CheckpointType checkpointType) |
| Helper for DelegatingSegment. | |
| virtual void | notifyPageDirty (CachePage &page, bool bDataValid) |
| Receives notification from CacheImpl the first time a page becomes dirty after it has been mapped (but before the contents have changed). | |
| virtual bool | canFlushPage (CachePage &page) |
| Informs CacheImpl whether a dirty page can safely be flushed to disk. | |
| SharedSegment const & | getDelegateSegment () const |
| virtual BlockNum | getAllocatedSizeInPages () |
| **Returns:**number of pages allocated from this segment | |
| virtual BlockNum | getNumPagesOccupiedHighWater () |
| Returns the max number of pages occupied by this segment instance. | |
| virtual BlockNum | getNumPagesExtended () |
| **Returns:**the number of incremental pages added to this instance of the segment | |
| virtual PageId | getPageSuccessor (PageId pageId) |
| Determines the successor of a given PageId. | |
| virtual void | setPageSuccessor (PageId pageId, PageId successorId) |
| Sets the successor of a given PageId. | |
| virtual BlockId | translatePageId (PageId) |
| Maps from a PageId in this segment to a BlockId. | |
| virtual PageId | translateBlockId (BlockId) |
| Maps from a BlockId to a PageId in this segment. | |
| virtual PageId | allocatePageId (PageOwnerId ownerId=ANON_PAGE_OWNER_ID) |
| Allocates a page without locking it into memory. | |
| virtual bool | ensureAllocatedSize (BlockNum nPages) |
| Allocates pages as needed to make getAllocatedSizeInPages() meet a lower bound. | |
| virtual bool | isPageIdAllocated (PageId pageId) |
| Tests whether a PageId is allocated. | |
| virtual AllocationOrder | getAllocationOrder () const |
| **Returns:**the AllocationOrder for this segment | |
| virtual PageId | updatePage (PageId pageId, bool needsTranslation=false) |
| Determines whether a page can be updated in-place, and if so, prepares the page for update. | |
| virtual void | notifyPageMap (CachePage &page) |
| Receives notification from CacheImpl as soon as a page is mapped, before any I/O is initiated to retrieve the page contents. | |
| virtual void | notifyPageUnmap (CachePage &page) |
| Receives notification from CacheImpl just before a page is unmapped. | |
| virtual void | notifyAfterPageRead (CachePage &page) |
| Receives notification from CacheImpl after a page read completes. | |
| virtual void | notifyBeforePageFlush (CachePage &page) |
| Receives notification from CacheImpl just before a dirty page is flushed to disk. | |
| virtual void | notifyAfterPageFlush (CachePage &page) |
| Receives notification from CacheImpl when a page flush completes successfully. | |
| SharedCache | getCache () const |
| **Returns:**the Cache for this Segment | |
| uint | getFullPageSize () const |
| **Returns:**the full size of pages stored in this segment; this is the same as the size of underlying cache pages | |
| uint | getUsablePageSize () const |
| **Returns:**the full size of pages stored in this segment minus the size for any footer information stored at the end of each page | |
| virtual void | initForUse () |
| Performs additional initialization required on the segment after it has been properly formatted. | |
| SharedSegment | getTracingSegment () |
| **Returns:**tracing segment associated with this segment if tracing is turned on; otherwise, returns the segment itself | |
| void | setTracingSegment (WeakSegment pTracingSegmentInit) |
| Sets the tracing segment associated with this segment. | |
| void | checkpoint (CheckpointType checkpointType=CHECKPOINT_FLUSH_ALL) |
| Checkpoints this segment. | |
| virtual MappedPageListener * | getMappedPageListener (BlockId blockId) |
| Returns the mapped page listener corresponding to a page. | |
| virtual bool | isWriteVersioned () |
| **Returns:**true if the segment supports versioning | |
| virtual MappedPageListener * | getTracingListener () |
| Retrieves the tracing wrapper corresponding to this listener if tracing is turned on. | |
| virtual MappedPageListener * | notifyAfterPageCheckpointFlush (CachePage &page) |
| Receives notification that a page has been flushed during a checkpoint. | |
| bool | isClosed () const |
| **Returns:**whether the object has been closed | |
| void | close () |
| Closes this object, releasing any unallocated resources. | |
| Static Public Member Functions | |
| static PageId | getLinearPageId (BlockNum iPage) |
| Constructs a linear PageId based on a linear page number. | |
| static BlockNum | getLinearBlockNum (PageId pageId) |
| Obtains the linear page number from a linear PageId. | |
| Protected Types | |
| typedef std::hash_map< PageId, PageId > | PageMap |
| typedef PageMap::const_iterator | PageMapConstIter |
| Protected Member Functions | |
| void | setUsablePageSize (uint) |
| PConstBuffer | getReadableFooter (CachePage &page) |
| PBuffer | getWritableFooter (CachePage &page) |
| PageId | getLinearPageSuccessor (PageId pageId) |
| An implementation of getPageSuccessor suitable for LINEAR_ALLOCATION. | |
| void | setLinearPageSuccessor (PageId pageId, PageId successorId) |
| An implementation of setPageSuccessor suitable for LINEAR_ALLOCATION. | |
| bool | isLinearPageIdAllocated (PageId pageId) |
| An implementation of isPageIdAllocated suitable for LINEAR_ALLOCATION when deallocation holes are disallowed. | |
| Protected Attributes | |
| SharedCache | pCache |
| Cache managing pages of this segment. | |
| WeakSegment | pTracingSegment |
| The tracing segment associated with this segment, if tracing is turned on. | |
| bool | needsClose |
| Private Member Functions | |
| VersionedSegment (SharedSegment dataSegment, SharedSegment logSegment, PseudoUuid const &onlineUuid, SegVersionNum versionNumber) | |
| uint64_t | computeChecksum (void const *pPageData) |
| Private Attributes | |
| bool | inRecovery |
| PseudoUuid | onlineUuid |
| SegVersionNum | versionNumber |
| PageId | oldestLogPageId |
| PageId | newestLogPageId |
| PageId | lastCheckpointLogPageId |
| StrictMutex | mutex |
| SharedSegment | logSegment |
| WALSegment * | pWALSegment |
| FuzzyCheckpointSet | fuzzyCheckpointSet |
| boost::crc_32_type | crcComputer |
| PageMap | dataToLogMap |
| Friends | |
| class | SegmentFactory |
Detailed Description
VersionedSegment provides versioned updates to an underlying data segment by keeping before-images of modified pages in a separate write-ahead log segment.
See the design docs for more detail.
Definition at line 44 of file VersionedSegment.h.
Member Typedef Documentation
Member Enumeration Documentation
Enumeration of the possible orderings of PageIds returned from allocatePageId.
The enumeration is from weakest to strongest ordering, and should not be changed.
Enumerator:
| RANDOM_ALLOCATION | Random order. |
|---|---|
| ASCENDING_ALLOCATION | Later calls always return greater PageIds, but not necessarily consecutively. |
| CONSECUTIVE_ALLOCATION | PageIds are returned in consecutive ascending order of BlockNum; the DeviceId is always the same. |
| LINEAR_ALLOCATION | PageIds are returned in consecutive ascending order starting with 0; all bytes of the PageId are used (no division into DeviceId/BlockNum), yielding maximum range. |
Definition at line 105 of file Segment.h.
Constructor & Destructor Documentation
Definition at line 68 of file VersionedSegment.cpp.
References Segment::getUsablePageSize(), inRecovery, lastCheckpointLogPageId, logSegment, newestLogPageId, NULL_PAGE_ID, oldestLogPageId, onlineUuid, pWALSegment, Segment::setUsablePageSize(), and versionNumber.
| VersionedSegment::~VersionedSegment | ( | | ) | [virtual] | | ------------------------------------ | - | | - | ----------- |
Member Function Documentation
| SegVersionNum VersionedSegment::computeChecksum | ( | void const * | pPageData | ) | [private] |
|---|
Recovers to a specific version from the log.
Parameters:
| pDelegatingSegment | segment from which pages to recover originate |
|---|---|
| firstLogPageId | starting PageId in log segment |
| versionNumber | version number to recover to, or MAXU to use current version number |
Definition at line 284 of file VersionedSegment.cpp.
References VersionedPageFooter::checksum, computeChecksum(), VersionedPageFooter::dataPageId, dataToLogMap, Segment::getFullPageSize(), WALSegment::getMinDirtyPageId(), SegPageLock::getPage(), Segment::getReadableFooter(), CachePage::getWritableData(), inRecovery, isMAXU(), SegPageLock::lockExclusive(), logSegment, NULL_PAGE_ID, onlineUuid, VersionedPageFooter::onlineUuid, Segment::pCache, pWALSegment, VersionedPageFooter::versionNumber, and versionNumber.
Referenced by recover(), Database::recoverPhysical(), Database::restoreFromBackup(), and VersionedSegmentTest::testRecovery().
00288 {
00289 assert(dataToLogMap.empty());
00290 assert(pWALSegment->getMinDirtyPageId() == NULL_PAGE_ID);
00291
00292 inRecovery = true;
00293
00294 if ((versionNumberInit)) {
00295 versionNumber = versionNumberInit;
00296 }
00297
00298
00299
00300
00301
00302
00303 std::hash_set recoveredPageSet;
00304
00305
00306
00307
00308
00309 SegmentAccessor logSegmentAccessor(logSegment,pCache);
00310 SegmentAccessor dataSegmentAccessor(pDelegatingSegment,pCache);
00311 for (; firstLogPageId != NULL_PAGE_ID;
00312 firstLogPageId = logSegment->getPageSuccessor(firstLogPageId))
00313 {
00314 SegPageLock logPageLock(logSegmentAccessor);
00315 logPageLock.lockShared(firstLogPageId);
00316 if (!logPageLock.getPage().isDataValid()) {
00317 break;
00318 }
00319 PConstBuffer pLogPageBuffer = logPageLock.getPage().getReadableData();
00320 VersionedPageFooter const *pLogFooter =
00321 reinterpret_cast<VersionedPageFooter const *>(
00322 getReadableFooter(logPageLock.getPage()));
00323 if (pLogFooter->checksum != computeChecksum(pLogPageBuffer)) {
00324 break;
00325 }
00326 if (pLogFooter->onlineUuid != onlineUuid) {
00327 break;
00328 }
00329 assert(pLogFooter->versionNumber < (versionNumber + 2));
00330 if (pLogFooter->versionNumber < versionNumber) {
00331 continue;
00332 }
00333 if (recoveredPageSet.find(pLogFooter->dataPageId)
00334 != recoveredPageSet.end())
00335 {
00336 assert(pLogFooter->versionNumber > versionNumber);
00337 continue;
00338 }
00339
00340 SegPageLock dataPageLock(dataSegmentAccessor);
00341 dataPageLock.lockExclusive(pLogFooter->dataPageId);
00342 memcpy(
00343 dataPageLock.getPage().getWritableData(),
00344 pLogPageBuffer,
00345 getFullPageSize());
00346 recoveredPageSet.insert(pLogFooter->dataPageId);
00347 }
00348
00349 inRecovery = false;
00350 }
Recovers to a specific version from the log and resets the online uuid.
Parameters:
| pDelegatingSegment | segment from which pages to recover originate |
|---|---|
| firstLogPageId | starting PageId in log segment |
| versionNumber | version number to recover to |
| onlineUuid | online uuid corresponding to the recovered instance |
Definition at line 274 of file VersionedSegment.cpp.
References onlineUuid, and recover().
00279 { 00280 onlineUuid = onlineUuidInit; 00281 recover(pDelegatingSegment, firstLogPageId, versionNumberInit); 00282 }
| void VersionedSegment::prepareOnlineRecovery | ( | | ) | | -------------------------------------------- | - | | - |
| PageId VersionedSegment::getRecoveryPageId | ( | | ) | const | | ------------------------------------------ | - | | - | ----- |
| PageId VersionedSegment::getOnlineRecoveryPageId | ( | | ) | const | | ------------------------------------------------ | - | | - | ----- |
| void VersionedSegment::deallocateCheckpointedLog | ( | CheckpointType | checkpointType | ) |
|---|
| void VersionedSegment::deallocatePageRange | ( | PageId | startPageId, |
|---|---|---|---|
| PageId | endPageId | ||
| ) | [virtual] |
Deallocates a range of pages allocated from this segment.
Some segment implementations may impose restrictions on the range (e.g. individual pages only, entire segment truncation only, start-ranges, or end-ranges). The interpretation of the range may also vary by segment (e.g. for a LINEAR_ALLOCATION segment, it's a simple linear PageId range, while for a RANDOM_ALLOCATION segment, successors could be used).
Depending on the circumstances, it may be the responsibility of the segment to discard the corresponding blocks from the cache. The details vary by segment implementation.
Parameters:
| startPageId | inclusive start of PageId range to deallocate, or default NULL_PAGE_ID for beginning of segment |
|---|---|
| endPageId | inclusive end of PageId range to deallocate, or default NULL_PAGE_ID for end of segment |
Reimplemented from DelegatingSegment.
Definition at line 152 of file VersionedSegment.cpp.
References DelegatingSegment::deallocatePageRange(), and NULL_PAGE_ID.
| void VersionedSegment::delegatedCheckpoint | ( | Segment & | delegatingSegment, |
|---|---|---|---|
| CheckpointType | checkpointType | ||
| ) | [virtual] |
Helper for DelegatingSegment.
Parameters:
| delegatingSegment | the Segment on which checkpoint was originally called |
|---|---|
| checkpointType | type of checkpoint requested |
Reimplemented from DelegatingSegment.
Definition at line 99 of file VersionedSegment.cpp.
References CHECKPOINT_DISCARD, CHECKPOINT_FLUSH_FUZZY, FuzzyCheckpointSet::clear(), dataToLogMap, DelegatingSegment::delegatedCheckpoint(), FuzzyCheckpointSet::finishCheckpoint(), fuzzyCheckpointSet, WALSegment::getMinDirtyPageId(), lastCheckpointLogPageId, logSegment, mutex, NULL_PAGE_ID, oldestLogPageId, Segment::pCache, pWALSegment, FuzzyCheckpointSet::setDelegatePagePredicate(), and versionNumber.
| void VersionedSegment::notifyPageDirty | ( | CachePage & | page, |
|---|---|---|---|
| bool | bDataValid | ||
| ) | [virtual] |
Receives notification from CacheImpl the first time a page becomes dirty after it has been mapped (but before the contents have changed).
Allows some logging action to be taken; for example, making a backup copy of the unmodified page contents. Note that when called for a newly allocated page, the page contents are invalid. Because it is implied that the calling thread already has an exclusive lock on the page, no cache locks are held when called.
Parameters:
| page | the page being modified |
|---|---|
| bDataValid | if true, the page data was already valid; if false, the data was invalid, but has now been marked valid since it's about to be written |
Reimplemented from DelegatingSegment.
Definition at line 163 of file VersionedSegment.cpp.
References SegPageLock::allocatePage(), VersionedPageFooter::checksum, computeChecksum(), VersionedPageFooter::dataPageId, dataToLogMap, PseudoUuid::generateInvalid(), CachePage::getBlockId(), SegPageLock::getPage(), CachePage::getReadableData(), Segment::getUsablePageSize(), CachePage::getWritableData(), Segment::getWritableFooter(), inRecovery, logSegment, mutex, newestLogPageId, DelegatingSegment::notifyPageDirty(), NULL_PAGE_ID, oldestLogPageId, onlineUuid, VersionedPageFooter::onlineUuid, Segment::pCache, DelegatingSegment::translateBlockId(), versionNumber, and VersionedPageFooter::versionNumber.
| bool VersionedSegment::canFlushPage | ( | CachePage & | page | ) | [virtual] |
|---|
| SharedSegment const& DelegatingSegment::getDelegateSegment | ( | | ) | const [inline, inherited] | | -------------------------------------------------------------------------------------------------------------------- | - | | - | --------------------------- |
| BlockNum DelegatingSegment::getAllocatedSizeInPages | ( | | ) | [virtual, inherited] | | ------------------------------------------------------------------------------------------------------- | - | | - | ---------------------- |
| BlockNum DelegatingSegment::getNumPagesOccupiedHighWater | ( | | ) | [virtual, inherited] | | ------------------------------------------------------------------------------------------------------------ | - | | - | ---------------------- |
Returns the max number of pages occupied by this segment instance.
In other words, pages that are allocated but subsequently deallocated, are included in this count. Also, the count includes all pages used by the segment, including metadata pages.
Returns:
the max number of pages occupied by a segment
Implements Segment.
Reimplemented in RandomAllocationSegmentBase.
Definition at line 52 of file DelegatingSegment.cpp.
References DelegatingSegment::pDelegateSegment.
| BlockNum DelegatingSegment::getNumPagesExtended | ( | | ) | [virtual, inherited] | | --------------------------------------------------------------------------------------------------- | - | | - | ---------------------- |
| PageId DelegatingSegment::getPageSuccessor | ( | PageId | pageId | ) | [virtual, inherited] |
|---|
| void DelegatingSegment::setPageSuccessor | ( | PageId | pageId, |
|---|---|---|---|
| PageId | successorId | ||
| ) | [virtual, inherited] |
| BlockId DelegatingSegment::translatePageId | ( | PageId | | ) | [virtual, inherited] | | ------------------------------------------ | - | ------ | | - | ---------------------- |
| PageId DelegatingSegment::translateBlockId | ( | BlockId | | ) | [virtual, inherited] | | ------------------------------------------ | - | ------- | | - | ---------------------- |
| PageId DelegatingSegment::allocatePageId | ( | PageOwnerId | ownerId = ANON_PAGE_OWNER_ID | ) | [virtual, inherited] |
|---|
| bool DelegatingSegment::ensureAllocatedSize | ( | BlockNum | nPages | ) | [virtual, inherited] |
|---|
| bool DelegatingSegment::isPageIdAllocated | ( | PageId | pageId | ) | [virtual, inherited] |
|---|
| PageId DelegatingSegment::updatePage | ( | PageId | pageId, |
|---|---|---|---|
| bool | needsTranslation = false | ||
| ) | [virtual, inherited] |
| void DelegatingSegment::notifyPageMap | ( | CachePage & | page | ) | [virtual, inherited] |
|---|
| void DelegatingSegment::notifyPageUnmap | ( | CachePage & | page | ) | [virtual, inherited] |
|---|
| void DelegatingSegment::notifyAfterPageRead | ( | CachePage & | page | ) | [virtual, inherited] |
|---|
| void DelegatingSegment::notifyBeforePageFlush | ( | CachePage & | page | ) | [virtual, inherited] |
|---|
| void DelegatingSegment::notifyAfterPageFlush | ( | CachePage & | page | ) | [virtual, inherited] |
|---|
| void Segment::setUsablePageSize | ( | uint | | ) | [protected, inherited] | | ------------------------------- | - | ----------------------------------------------------------------- | | - | ------------------------ |
| PageId Segment::getLinearPageSuccessor | ( | PageId | pageId | ) | [protected, inherited] |
|---|
| void Segment::setLinearPageSuccessor | ( | PageId | pageId, |
|---|---|---|---|
| PageId | successorId | ||
| ) | [protected, inherited] |
| bool Segment::isLinearPageIdAllocated | ( | PageId | pageId | ) | [protected, inherited] |
|---|
| SharedCache Segment::getCache | ( | | ) | const [inline, inherited] | | --------------------------------------------------------------------------------------- | - | | - | --------------------------- |
| uint Segment::getFullPageSize | ( | | ) | const [inherited] | | ------------------------------------------------------------------------------------------ | - | | - | ------------------- |
| uint Segment::getUsablePageSize | ( | | ) | const [inline, inherited] | | -------------------------------------------------------------------------------------------- | - | | - | --------------------------- |
| void Segment::initForUse | ( | | ) | [virtual, inherited] | | ------------------------ | - | | - | ---------------------- |
Returns:
tracing segment associated with this segment if tracing is turned on; otherwise, returns the segment itself
Definition at line 50 of file Segment.cpp.
References Segment::pTracingSegment.
Referenced by VersionedRandomAllocationSegment::allocateAllocNodes(), RandomAllocationSegment::allocateFromExtent(), RandomAllocationSegment::allocateFromNewExtent(), RandomAllocationSegment::allocatePageId(), VersionedRandomAllocationSegment::backupAllocationNodes(), VersionedRandomAllocationSegment::chainPageEntries(), SnapshotRandomAllocationSegment::commitChanges(), VersionedRandomAllocationSegment::copyPageEntryFromTemp(), VersionedRandomAllocationSegment::copyPageEntryToTemp(), RandomAllocationSegmentBase::deallocatePageId(), VersionedRandomAllocationSegment::findAllocPageIdForRead(), RandomAllocationSegmentBase::format(), RandomAllocationSegmentBase::formatPageExtentsTemplate(), RandomAllocationSegmentBase::freePageEntryTemplate(), RandomAllocationSegment::getExtAllocPageIdForRead(), VersionedRandomAllocationSegment::getOldestTxnId(), VersionedRandomAllocationSegment::getOldPageIds(), RandomAllocationSegmentBase::getPageEntryCopyTemplate(), RandomAllocationSegment::getSegAllocPageIdForRead(), VersionedRandomAllocationSegment::getTempAllocNodePage(), Segment::getTracingListener(), VersionedRandomAllocationSegment::locateDataPages(), VersionedRandomAllocationSegment::restoreFromBackup(), SnapshotRandomAllocationSegment::rollbackChanges(), RandomAllocationSegment::setPageSuccessor(), VersionedRandomAllocationSegment::updateExtentEntry(), and VersionedRandomAllocationSegment::validateFreePageCount().
00051 { 00052 SharedSegment sharedPtr = pTracingSegment.lock(); 00053 if (sharedPtr && sharedPtr.get()) { 00054 return sharedPtr; 00055 } else { 00056 return shared_from_this(); 00057 } 00058 }
| void Segment::setTracingSegment | ( | WeakSegment | pTracingSegmentInit | ) | [inherited] |
|---|
Sets the tracing segment associated with this segment.
Parameters:
| pTracingSegmentInit | the tracing segment |
|---|
Definition at line 60 of file Segment.cpp.
References Segment::pTracingSegment.
| void Segment::checkpoint | ( | CheckpointType | checkpointType = CHECKPOINT_FLUSH_ALL | ) | [inherited] |
|---|
| MappedPageListener * Segment::getMappedPageListener | ( | BlockId | blockId | ) | [virtual, inherited] |
|---|
| bool Segment::isWriteVersioned | ( | | ) | [virtual, inherited] | | ------------------------------ | - | | - | ---------------------- |
| PageId Segment::getLinearPageId | ( | BlockNum | iPage | ) | [inline, static, inherited] |
|---|
Constructs a linear PageId based on a linear page number.
Definition at line 348 of file Segment.h.
Referenced by RandomAllocationSegmentBase::allocateFromLockedExtentTemplate(), ScratchSegment::allocatePageId(), LinearViewSegment::allocatePageId(), LinearDeviceSegment::allocatePageId(), CircularSegment::allocatePageId(), RandomAllocationSegmentBase::getExtentAllocPageId(), VersionedRandomAllocationSegment::getOldPageIds(), RandomAllocationSegmentBase::getSegAllocPageId(), Database::init(), VersionedRandomAllocationSegment::locateDataPages(), SegmentTestBase::lockPage(), SegmentTestBase::prefetchPage(), SegPageIterTest::testBoundedIter(), SegPageEntryIterTest::testBoundedIter(), ScratchSegment::translateBlockId(), LinearViewSegment::translateBlockId(), LinearDeviceSegment::translateBlockId(), CircularSegment::translateBlockId(), and CircularSegment::translatePageId().
00349 { 00350 return PageId(iPage); 00351 }
| BlockNum Segment::getLinearBlockNum | ( | PageId | pageId | ) | [inline, static, inherited] |
|---|
Obtains the linear page number from a linear PageId.
Definition at line 353 of file Segment.h.
References opaqueToInt().
Referenced by CircularSegment::CircularSegment(), LinearDeviceSegment::deallocatePageRange(), CircularSegment::deallocatePageRange(), Segment::isLinearPageIdAllocated(), CircularSegment::isPageIdAllocated(), SegmentTestBase::lockPage(), SegInputStream::readPrevBuffer(), Segment::setLinearPageSuccessor(), RandomAllocationSegmentBase::splitPageId(), CircularSegment::translateBlockId(), ScratchSegment::translatePageId(), LinearViewSegment::translatePageId(), LinearDeviceSegment::translatePageId(), CircularSegment::translatePageId(), and LinearViewSegment::updatePage().
Receives notification that a page has been flushed during a checkpoint.
Also determines if the listener on the page needs to be reset.
Note that if the page listener is reset, that page may not be unmapped during a CHECKPOINT_FLUSH_AND_UNMAP checkpoint call.
This method should be called immediately after the page flush has completed while the checkpoint is still in progress.
Parameters:
| page | the page that was flushed |
|---|
Returns:
NULL if the listener on the page does not need to be reset; otherwise, returns the listener that the page should be reset to
Reimplemented in SnapshotRandomAllocationSegment, and TracingSegment.
Definition at line 62 of file MappedPageListener.cpp.
00064 { 00065 return NULL; 00066 }
| bool ClosableObject::isClosed | ( | | ) | const [inline, inherited] | | ----------------------------- | - | | - | --------------------------- |
Returns:
whether the object has been closed
Definition at line 58 of file ClosableObject.h.
| void ClosableObject::close | ( | | ) | [inherited] | | -------------------------- | - | | - | ------------- |
Closes this object, releasing any unallocated resources.
Reimplemented in CollectExecStream, CorrelationJoinExecStream, LcsClusterAppendExecStream, and LcsClusterReplaceExecStream.
Definition at line 39 of file ClosableObject.cpp.
References ClosableObject::closeImpl(), and ClosableObject::needsClose.
Referenced by CacheImpl< PageT, VictimPolicyT >::allocatePages(), LcsRowScanBaseExecStream::closeImpl(), ExecStreamGraphImpl::closeImpl(), FlatFileBuffer::open(), ClosableObjectDestructor::operator()(), and Segment::~Segment().
Friends And Related Function Documentation
Member Data Documentation
Cache managing pages of this segment.
Definition at line 62 of file Segment.h.
Referenced by VersionedRandomAllocationSegment::allocateAllocNodes(), RandomAllocationSegmentBase::allocateFromExtentTemplate(), RandomAllocationSegmentBase::allocateFromNewExtentTemplate(), RandomAllocationSegmentBase::allocatePageIdFromSegment(), VersionedRandomAllocationSegment::backupAllocationNodes(), VersionedRandomAllocationSegment::chainPageEntries(), VersionedRandomAllocationSegment::copyPageEntryFromTemp(), VersionedRandomAllocationSegment::copyPageEntryToTemp(), RandomAllocationSegmentBase::deallocatePageId(), VersionedRandomAllocationSegment::deallocateSinglePage(), VersionedRandomAllocationSegment::deferDeallocation(), delegatedCheckpoint(), SnapshotRandomAllocationSegment::delegatedCheckpoint(), Segment::delegatedCheckpoint(), RandomAllocationSegmentBase::format(), RandomAllocationSegmentBase::formatPageExtentsTemplate(), RandomAllocationSegmentBase::freePageEntryTemplate(), Segment::getCache(), Segment::getFullPageSize(), VersionedRandomAllocationSegment::getOldestTxnId(), VersionedRandomAllocationSegment::getOldPageIds(), RandomAllocationSegmentBase::getPageEntryCopyTemplate(), VersionedRandomAllocationSegment::getTempAllocNodePage(), VersionedRandomAllocationSegment::initPageEntry(), VersionedRandomAllocationSegment::locateDataPages(), notifyPageDirty(), recover(), VersionedRandomAllocationSegment::restoreFromBackup(), RandomAllocationSegmentBase::setPageSuccessorTemplate(), RandomAllocationSegmentBase::tallySegAllocNodePages(), VersionedRandomAllocationSegment::uncommittedDeallocation(), VersionedRandomAllocationSegment::updateExtentEntry(), VersionedRandomAllocationSegment::updatePageEntry(), VersionedRandomAllocationSegment::updateTempPageEntry(), and VersionedRandomAllocationSegment::validateFreePageCount().
The documentation for this class was generated from the following files:
- /home/pub/open/dev/fennel/segment/VersionedSegment.h
- /home/pub/open/dev/fennel/segment/VersionedSegment.cpp
