Fennel: TwoQPage Class Reference (original) (raw)

Inheritance diagram for TwoQPage:

List of all members.

Public Types
enum DataStatus { DATA_INVALID, DATA_ERROR, DATA_CLEAN, DATA_DIRTY, DATA_WRITE, DATA_READ }
Enumeration of possible status of page data. More...
enum PageState { PAGE_STATE_POPULAR_PINNED, PAGE_STATE_POPULAR_UNPINNED, PAGE_STATE_FRESHMAN, PAGE_STATE_FREE }
Enumeration of possible state values for a page when used with TwoQVictimPolicy. More...
Public Member Functions
TwoQPage (Cache &cache, PBuffer buffer)
Cache & getCache ()
**Returns:**the cache which manages this page
bool isDirty () const
**Returns:**are the in-memory page contents different from those in the corresponding block on disk?
bool isTransferInProgress () const
**Returns:**is I/O currently in progress on this page?
bool isDataValid () const
**Returns:**is the page data valid?
bool isDataError () const
**Returns:**did the read required for mapping fail?
BlockId getBlockId () const
**Returns:**the mapped BlockId
PConstBuffer getReadableData () const
Obtains a const pointer to the page contents.
PBuffer getWritableData ()
Obtains a writable pointer to the page contents, marking the page dirty.
bool isScratchLocked () const
**Returns:**true if page is currently locked as scratch memory
MappedPageListener * getMappedPageListener () const
**Returns:**the MappedPageListener associated with this page
bool tryUpgrade (TxnId txnId)
Attempts to upgrade from LOCKMODE_S (which caller must already have acquired) to LOCKMODE_X.
void upgrade (TxnId txnId)
Upgrades from LOCKMODE_S (which caller must already have acquired) to LOCKMODE_X.
void swapBuffers (CachePage &other)
Swaps this page's buffer with another page.
PageState getState ()
**Returns:**state of a page
void setState (PageState newState)
Sets a page's state.
TwoQDirtyPage & getDirtyPageNode ()
**Returns:**the dirty node corresponding to the page
IntrusiveDListNode * getNext () const
IntrusiveDListNode * getPrev () const
void detach ()
void insertBefore (IntrusiveDListNode &newNext)
void insertAfter (IntrusiveDListNode &newPrev)

Detailed Description

Definition at line 42 of file Cache.cpp.


Member Enumeration Documentation

Enumeration of possible status of page data.

Order matters (valid data states are grouped together, as are I/O states).

Enumerator:

DATA_INVALID The page contents are invalid (either unmapped or newly allocated).
DATA_ERROR The last transfer failed (so the page contents are invalid).
DATA_CLEAN No transfer is in progress, and the page contains valid, unmodified data.
DATA_DIRTY No transfer is in progress, and the page contains valid, dirty data.
DATA_WRITE A disk write is in progress (so the page contains valid data).
DATA_READ A disk read is in progress (so the page does not yet contain valid data).

Definition at line 64 of file CachePage.h.

Enumeration of possible state values for a page when used with TwoQVictimPolicy.

Enumerator:

PAGE_STATE_POPULAR_PINNED Page is in the popular-pinned queue.
PAGE_STATE_POPULAR_UNPINNED Page is in the popular-unpinned queue.
PAGE_STATE_FRESHMAN Page is in the freshmen queue.
PAGE_STATE_FREE Page is not currently in the cache.

Definition at line 294 of file TwoQVictimPolicy.h.


Constructor & Destructor Documentation

TwoQPage::TwoQPage ( Cache & cache,
PBuffer buffer
) [inline]

Member Function Documentation

| Cache& CachePage::getCache | ( | | ) | [inline, inherited] | | --------------------------------------------- | - | | - | --------------------- |

| bool CachePage::isDirty | ( | | ) | const [inline, inherited] | | ----------------------- | - | | - | --------------------------- |

| bool CachePage::isTransferInProgress | ( | | ) | const [inline, inherited] | | ------------------------------------ | - | | - | --------------------------- |

Returns:

is I/O currently in progress on this page?

Definition at line 223 of file CachePage.h.

| bool CachePage::isDataValid | ( | | ) | const [inline, inherited] | | --------------------------- | - | | - | --------------------------- |

| bool CachePage::isDataError | ( | | ) | const [inline, inherited] | | --------------------------- | - | | - | --------------------------- |

Returns:

did the read required for mapping fail?

Definition at line 239 of file CachePage.h.

| BlockId CachePage::getBlockId | ( | | ) | const [inline, inherited] | | ----------------------------- | - | | - | --------------------------- |

Returns:

the mapped BlockId

Definition at line 247 of file CachePage.h.

Referenced by VersionedSegment::canFlushPage(), CachePage::isScratchLocked(), TracingSegment::notifyAfterPageCheckpointFlush(), WALSegment::notifyAfterPageFlush(), TracingSegment::notifyAfterPageFlush(), TracingSegment::notifyAfterPageRead(), TracingSegment::notifyBeforePageFlush(), WALSegment::notifyPageDirty(), VersionedSegment::notifyPageDirty(), TracingSegment::notifyPageDirty(), TracingSegment::notifyPageMap(), TracingSegment::notifyPageUnmap(), CacheImpl< PageT, VictimPolicyT >::notifyTransferCompletion(), and DeviceIdPagePredicate::operator()().

00248 { 00249 return blockId; 00250 }

| PConstBuffer CachePage::getReadableData | ( | | ) | const [inline, inherited] | | ------------------------------------------------------------------------------------------- | - | | - | --------------------------- |

| PBuffer CachePage::getWritableData | ( | | ) | [inline, inherited] | | -------------------------------------------------------------------------------------- | - | | - | --------------------- |

Obtains a writable pointer to the page contents, marking the page dirty.

The page must be locked in exclusive mode first. The number of valid bytes returned depends on the page size.

Returns:

pointer to the page contents

Definition at line 274 of file CachePage.h.

References Cache::getCache().

Referenced by LcsClusterNodeWriter::allocArrays(), LbmEntryTest::allocateBuf(), ExternalSortRunLoader::allocateBuffer(), BTreePrefetchSearchExecStream::allocateScratchPages(), LhxHashTable::allocBlock(), DoubleBufferExecStream::execute(), PagingTestBase::fillPage(), SegNodeLock< Node >::getNodeForWrite(), Segment::getWritableFooter(), LbmGeneratorExecStream::initBitmapTable(), LcsClusterAppendExecStream::initLoad(), SegPageBackupRestoreDevice::initScratchPages(), VersionedSegment::notifyPageDirty(), LbmUnionExecStream::open(), LbmChopperExecStream::open(), FlatFileExecStreamImpl::open(), ScratchBufferExecStream::open(), DoubleBufferExecStream::open(), VersionedSegment::recover(), SpillOutputStream::SpillOutputStream(), SegPageLock::swapBuffers(), and RandomAllocationSegmentTest::testAllocateAndDeallocate().

| bool CachePage::isScratchLocked | ( | | ) | const [inherited] | | ------------------------------- | - | | - | ------------------- |

bool CachePage::tryUpgrade ( TxnId txnId ) [inline, inherited]
void CachePage::upgrade ( TxnId txnId ) [inline, inherited]
void CachePage::swapBuffers ( CachePage & other ) [inherited]

| PageState TwoQVictim::getState | ( | | ) | [inline, inherited] | | --------------------------------------------------------------------------------------- | - | | - | --------------------- |

void TwoQVictim::setState ( PageState newState ) [inline, inherited]

Sets a page's state.

Parameters:

newState the new state value for a page

Definition at line 345 of file TwoQVictimPolicy.h.

00346 { 00347 state = newState; 00348 }

| TwoQDirtyPage& TwoQVictim::getDirtyPageNode | ( | | ) | [inline, inherited] | | ---------------------------------------------------------------------- | - | | - | --------------------- |

| void IntrusiveDListNode::detach | ( | | ) | [inline, inherited] | | ------------------------------- | - | | - | --------------------- |

void IntrusiveDListNode::insertBefore ( IntrusiveDListNode & newNext ) [inline, inherited]

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


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