Fennel: SnapshotRandomAllocationSegment Class Reference (original) (raw)
SnapshotRandomAllocationSegment implements a random allocation segment that provides a consistent view of the data in the segment based on a specified point in time. More...
#include <[SnapshotRandomAllocationSegment.h](SnapshotRandomAllocationSegment%5F8h-source.html)>
Inheritance diagram for SnapshotRandomAllocationSegment:

| 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 | |
| SnapshotRandomAllocationSegment (SharedSegment delegateSegment, SharedSegment versionedSegment, TxnId snapshotCsnInit, bool readOnlyCommittedData) | |
| TxnId | getSnapshotCsn () |
| **Returns:**the csn associated with the snapshot segment | |
| void | commitChanges (TxnId commitCsn) |
| Commits page entry changes. | |
| void | rollbackChanges () |
| Rolls back page entry changes. | |
| void | versionPage (PageId destAnchorPageId, PageId srcAnchorPageId) |
| Adds a source page chain into a destination page chain. | |
| void | setForceCacheUnmap () |
| Indicates that a checkpoint should be always be executed, even if no pages are dirty when flushing and unmapping cache entries. | |
| virtual BlockId | translatePageId (PageId pageId) |
| Maps from a PageId in this segment to a BlockId. | |
| 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 PageId | allocatePageId (PageOwnerId ownerId) |
| Allocates a page without locking it into memory. | |
| virtual void | deallocatePageRange (PageId startPageId, PageId endPageId) |
| Deallocates a range of pages allocated from 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 MappedPageListener * | getMappedPageListener (BlockId blockId) |
| Returns the mapped page listener corresponding to a page. | |
| virtual void | delegatedCheckpoint (Segment &delegatingSegment, CheckpointType checkpointType) |
| Helper for DelegatingSegment. | |
| virtual MappedPageListener * | notifyAfterPageCheckpointFlush (CachePage &page) |
| Receives notification that a page has been flushed during a checkpoint. | |
| virtual bool | canFlushPage (CachePage &page) |
| Informs CacheImpl whether a dirty page can safely be flushed to disk. | |
| 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 | isWriteVersioned () |
| **Returns:**true if the segment supports versioning | |
| 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 | translateBlockId (BlockId) |
| Maps from a BlockId to a PageId in this segment. | |
| 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 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 * | getTracingListener () |
| Retrieves the tracing wrapper corresponding to this listener if tracing is turned on. | |
| 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 | |
| PageId | getSnapshotId (PageId pageId) |
| Retrieves the pageId corresponding to this segment's snapshot of a specified page. | |
| void | incrPageUpdateCount (PageId pageId, PageOwnerId ownerId, ModifiedPageEntry::ModType modType) |
| Increments the counters that keep track of the number of modifications made to a page entry as well as allocations/deallocations. | |
| PageId | getAnchorPageId (PageId snapshotId) |
| Retrieves the pageId of the anchor page corresponding to a snapshot page. | |
| bool | isPageNewlyAllocated (PageId pageId) |
| Determines whether a snapshot page corresponds to a newly allocated one. | |
| void | chainPageEntries (PageId pageId, PageId versionChainId, PageId successorId) |
| Chains one page to another. | |
| Private Attributes | |
| ModifiedPageEntryMap | modPageEntriesMap |
| Keeps track of the number of modifications made to the page entry and extent entry corresponding to a page. | |
| PageMap | snapshotPageMap |
| Maintains a mapping between a pageId and the snapshot page for this segment. | |
| SXMutex | modPageMapMutex |
| Mutex that ensures only a single thread is modifying modPageEntriesMap. | |
| StrictMutex | snapshotPageMapMutex |
| Mutex protecting the snapshotPageMap. | |
| VersionedRandomAllocationSegment * | pVersionedRandomSegment |
| Underlying segment that provides versioning of pages. | |
| TxnId | snapshotCsn |
| The commit sequence number used to determine which pages to read. | |
| bool | readOnlyCommittedData |
| True if only committed data should be read by the segment. | |
| bool | needPageFlush |
| If true, some snapshot page has been modified and therefore pages need to be flushed during a checkpoint call. | |
| bool | forceCacheUnmap |
| If true, always issue the checkpoint to remove entries from the cache when flushing and unmapping cache entries. |
Detailed Description
SnapshotRandomAllocationSegment implements a random allocation segment that provides a consistent view of the data in the segment based on a specified point in time.
All pages read are as of that specified point in time. If a page is updated, and this is the first time the page is being updated, a new copy of the page is created and used for the remaining lifetime of the segment.
This segment delegates much of its work to its underlying VersionedRandomAllocationSegment. That segment is responsible for the actual underlying data storage.
Definition at line 48 of file SnapshotRandomAllocationSegment.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
| SnapshotRandomAllocationSegment::SnapshotRandomAllocationSegment | ( | SharedSegment | delegateSegment, |
|---|---|---|---|
| SharedSegment | versionedSegment, | ||
| TxnId | snapshotCsnInit, | ||
| bool | readOnlyCommittedData | ||
| ) | [explicit] |
Member Function Documentation
| PageId SnapshotRandomAllocationSegment::getSnapshotId | ( | PageId | pageId | ) | [private] |
|---|
Retrieves the pageId corresponding to this segment's snapshot of a specified page.
Parameters:
| pageId | pageId of the desired page |
|---|
Returns:
snapshot pageId corresponding to the desired pageId
Definition at line 61 of file SnapshotRandomAllocationSegment.cpp.
References VersionedPageEntry::allocationCsn, getAnchorPageId(), VersionedRandomAllocationSegment::getLatestPageEntryCopy(), PageEntry::ownerId, pVersionedRandomSegment, readOnlyCommittedData, snapshotCsn, snapshotPageMap, snapshotPageMapMutex, UNCOMMITTED_PAGE_OWNER_ID, and VersionedPageEntry::versionChainPageId.
Referenced by getPageSuccessor(), setPageSuccessor(), translatePageId(), and updatePage().
| void SnapshotRandomAllocationSegment::incrPageUpdateCount | ( | PageId | pageId, |
|---|---|---|---|
| PageOwnerId | ownerId, | ||
| ModifiedPageEntry::ModType | modType | ||
| ) | [private] |
Increments the counters that keep track of the number of modifications made to a page entry as well as allocations/deallocations.
This method assumes that the caller has already acquired an exclusive mutex on modPageEntriesMap.
Parameters:
| pageId | the pageId of the page whose counters are being incremented |
|---|---|
| ownerId | the ownerId that will be set on the page entry when it's committed; only used in the case of a page allocation |
| modType | type of modification made to the page entry (i.e., allocated, deallocated, or modified) |
Definition at line 131 of file SnapshotRandomAllocationSegment.cpp.
References ModifiedPageEntry::ALLOCATED, ModifiedPageEntry::DEALLOCATED, SXMutex::isLocked(), LOCKMODE_X, modPageEntriesMap, modPageMapMutex, and needPageFlush.
Referenced by allocatePageId(), chainPageEntries(), deallocatePageRange(), and setPageSuccessor().
| PageId SnapshotRandomAllocationSegment::getAnchorPageId | ( | PageId | snapshotId | ) | [private] |
|---|
| bool SnapshotRandomAllocationSegment::isPageNewlyAllocated | ( | PageId | pageId | ) | [private] |
|---|
| void SnapshotRandomAllocationSegment::chainPageEntries | ( | PageId | pageId, |
|---|---|---|---|
| PageId | versionChainId, | ||
| PageId | successorId | ||
| ) | [private] |
| TxnId SnapshotRandomAllocationSegment::getSnapshotCsn | ( | | ) | | ----------------------------------------------------- | - | | - |
| void SnapshotRandomAllocationSegment::commitChanges | ( | TxnId | commitCsn | ) |
|---|
Commits page entry changes.
Parameters:
| commitCsn | sequence number to write into pageEntry's on commit |
|---|
Definition at line 355 of file SnapshotRandomAllocationSegment.cpp.
References Segment::getTracingSegment(), modPageEntriesMap, modPageMapMutex, pVersionedRandomSegment, readOnlyCommittedData, snapshotPageMap, and VersionedRandomAllocationSegment::updateAllocNodes().
Referenced by SnapshotSegmentTestBase::commitChanges(), BackupRestoreTest::createSnapshotData(), BackupRestoreTest::executeSnapshotTxn(), LcsClusterReplaceExecStreamTest::testClusterReplace(), and CmdInterpreter::visit().
| void SnapshotRandomAllocationSegment::rollbackChanges | ( | | ) | | ----------------------------------------------------- | - | | - |
| void SnapshotRandomAllocationSegment::versionPage | ( | PageId | destAnchorPageId, |
|---|---|---|---|
| PageId | srcAnchorPageId | ||
| ) |
Adds a source page chain into a destination page chain.
All pages in the source chain must be newer than the pages in the destination chain.
Parameters:
| destAnchorPageId | pageId of the anchor page of the destination page chain |
|---|---|
| srcAnchorPageId | pageId of the anchor page of the source page chain |
Definition at line 453 of file SnapshotRandomAllocationSegment.cpp.
References VersionedPageEntry::allocationCsn, chainPageEntries(), getAnchorPageId(), VersionedRandomAllocationSegment::getLatestPageEntryCopy(), modPageMapMutex, NULL_PAGE_ID, pVersionedRandomSegment, readOnlyCommittedData, snapshotPageMap, snapshotPageMapMutex, and VersionedPageEntry::versionChainPageId.
Referenced by LbmSplicerExecStream::execute(), and LcsClusterReplaceExecStream::getTupleForLoad().
| void SnapshotRandomAllocationSegment::setForceCacheUnmap | ( | | ) | | -------------------------------------------------------- | - | | - |
| BlockId SnapshotRandomAllocationSegment::translatePageId | ( | PageId | pageId | ) | [virtual] |
|---|
| PageId SnapshotRandomAllocationSegment::getPageSuccessor | ( | PageId | pageId | ) | [virtual] |
|---|
| void SnapshotRandomAllocationSegment::setPageSuccessor | ( | PageId | pageId, |
|---|---|---|---|
| PageId | successorId | ||
| ) | [virtual] |
| PageId SnapshotRandomAllocationSegment::allocatePageId | ( | PageOwnerId | ownerId | ) | [virtual] |
|---|
Allocates a page without locking it into memory.
Parameters:
| ownerId | the PageOwnerId of the object which will own this page, or ANON_PAGE_OWNER_ID for pages unassociated with an owner |
|---|
Returns:
the PageId of the allocated page, or NULL_PAGE_ID if none could be allocated
Reimplemented from DelegatingSegment.
Definition at line 202 of file SnapshotRandomAllocationSegment.cpp.
References ModifiedPageEntry::ALLOCATED, DelegatingSegment::allocatePageId(), ANON_PAGE_OWNER_ID, incrPageUpdateCount(), VersionedRandomAllocationSegment::initPageEntry(), ModifiedPageEntry::MODIFIED, modPageMapMutex, pVersionedRandomSegment, readOnlyCommittedData, snapshotCsn, and UNCOMMITTED_PAGE_OWNER_ID.
Referenced by updatePage().
| void SnapshotRandomAllocationSegment::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 221 of file SnapshotRandomAllocationSegment.cpp.
References ANON_PAGE_OWNER_ID, ModifiedPageEntry::DEALLOCATED, DelegatingSegment::deallocatePageRange(), VersionedRandomAllocationSegment::getLatestPageEntryCopy(), incrPageUpdateCount(), modPageMapMutex, NULL_PAGE_ID, pVersionedRandomSegment, readOnlyCommittedData, snapshotPageMap, snapshotPageMapMutex, and VersionedPageEntry::versionChainPageId.
| PageId SnapshotRandomAllocationSegment::updatePage | ( | PageId | pageId, |
|---|---|---|---|
| bool | needsTranslation = false | ||
| ) | [virtual] |
Determines whether a page can be updated in-place, and if so, prepares the page for update.
Parameters:
| pageId | pageId of the page being modified |
|---|---|
| needsTranslation | true if the pageId needs to be mapped to the appropriate update page; defaults to false |
Returns:
NULL_PAGE_ID if the page can be updated in place; otherwise, the pageId of the page that should be used when updates are made to the page
Reimplemented from DelegatingSegment.
Definition at line 256 of file SnapshotRandomAllocationSegment.cpp.
References allocatePageId(), chainPageEntries(), getAnchorPageId(), VersionedRandomAllocationSegment::getLatestPageEntryCopy(), getSnapshotId(), isPageNewlyAllocated(), modPageMapMutex, NULL_PAGE_ID, PageEntry::ownerId, pVersionedRandomSegment, readOnlyCommittedData, snapshotPageMap, snapshotPageMapMutex, PageEntry::successorId, and VersionedPageEntry::versionChainPageId.
| MappedPageListener * SnapshotRandomAllocationSegment::getMappedPageListener | ( | BlockId | blockId | ) | [virtual] |
|---|
| void SnapshotRandomAllocationSegment::delegatedCheckpoint | ( | Segment & | delegatingSegment, |
|---|---|---|---|
| CheckpointType | checkpointType | ||
| ) | [virtual] |
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 from MappedPageListener.
Definition at line 419 of file SnapshotRandomAllocationSegment.cpp.
References pVersionedRandomSegment, and readOnlyCommittedData.
| bool SnapshotRandomAllocationSegment::canFlushPage | ( | CachePage & | page | ) | [virtual] |
|---|
| void SnapshotRandomAllocationSegment::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 436 of file SnapshotRandomAllocationSegment.cpp.
References DelegatingSegment::notifyPageDirty(), and readOnlyCommittedData.
| bool SnapshotRandomAllocationSegment::isWriteVersioned | ( | | ) | [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::translateBlockId | ( | BlockId | | ) | [virtual, inherited] | | ------------------------------------------ | - | ------- | | - | ---------------------- |
| bool DelegatingSegment::ensureAllocatedSize | ( | BlockNum | nPages | ) | [virtual, inherited] |
|---|
| bool DelegatingSegment::isPageIdAllocated | ( | PageId | pageId | ) | [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(), 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(), 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] |
|---|
| 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().
| 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().
Member Data Documentation
Underlying segment that provides versioning of pages.
Definition at line 93 of file SnapshotRandomAllocationSegment.h.
Referenced by allocatePageId(), chainPageEntries(), commitChanges(), deallocatePageRange(), getAnchorPageId(), getMappedPageListener(), getSnapshotId(), notifyAfterPageCheckpointFlush(), rollbackChanges(), SnapshotRandomAllocationSegment(), updatePage(), and versionPage().
True if only committed data should be read by the segment.
This includes not reading uncommitted data created by the current transaction.
Definition at line 105 of file SnapshotRandomAllocationSegment.h.
Referenced by allocatePageId(), canFlushPage(), commitChanges(), deallocatePageRange(), getSnapshotId(), notifyAfterPageCheckpointFlush(), notifyPageDirty(), rollbackChanges(), setPageSuccessor(), SnapshotRandomAllocationSegment(), updatePage(), and versionPage().
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(), VersionedSegment::delegatedCheckpoint(), 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(), VersionedSegment::notifyPageDirty(), VersionedSegment::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/SnapshotRandomAllocationSegment.h
- /home/pub/open/dev/fennel/segment/SnapshotRandomAllocationSegment.cpp
