Cache Class Reference

Cache defines an abstract interface for caching pages of devices. More...

#include <Cache.h>

Inheritance diagram for Cache:

ClosableObject CacheAccessor StatsSource CacheImpl< PageT, VictimPolicyT > List of all members.

Public Member Functions

virtual ~Cache ()
 Destructor.
virtual void setAllocatedPageCount (uint nMemPages)=0
 Resizes this cache.
virtual uint getMaxAllocatedPageCount ()=0
 
Returns:
maximum number of pages that can be allocated; i.e., the value of the cachePagesMax parameter

virtual uint getAllocatedPageCount ()=0
 Gets a count of how many pages currently have allocated buffers.
virtual void collectStats (CacheStats &stats)=0
 Gets a snapshot of cache activity; as a side-effect, clears cumulative performance counters.
uint getPageSize () const
 
Returns:
the size of cached pages (in bytes)

virtual CacheAllocatorgetAllocator () const=0
virtual void registerDevice (DeviceId deviceId, SharedRandomAccessDevice pDevice)=0
 Registers the given device with the Cache; must be called exactly once before any other caching operations can be requested for pages of this device.
virtual void unregisterDevice (DeviceId deviceId)=0
 Unregisters the given device from the Cache, asserting that no pages remain mapped to the specified device.
virtual SharedRandomAccessDevicegetDevice (DeviceId deviceId)=0
 Dereferences a device ID to the registered object which represents it.
virtual uint checkpointPages (PagePredicate &pagePredicate, CheckpointType checkpointType=CHECKPOINT_FLUSH_ALL)=0
 Flushes and/or unmaps selected pages.
virtual bool isPageMapped (BlockId blockId)=0
 Determines if a particular page is mapped.
virtual CachePagelockScratchPage (BlockNum blockNum=0)=0
 Allocates a free page buffer for scratch usage.
virtual DeviceAccessSchedulergetDeviceAccessScheduler (RandomAccessDevice &)=0
 Gets the correct access scheduler for a given device.
virtual SharedCache getCache ()
 
Returns:
the underlying Cache accessed by this CacheAccessor

virtual uint getMaxLockedPages ()
 
Returns:
the page lock quota on this accessor

virtual void setMaxLockedPages (uint nPages)
 Sets the page lock quota on this accessor.
virtual void setTxnId (TxnId txnId)
 Sets a default TxnId to use for locking pages (to be used when IMPLICIT_TXN_ID is specified).
virtual TxnId getTxnId () const
 
Returns:
default TxnId associated with this accessor

virtual void writeStats (StatsTarget &target)
 Writes a current stats snapshot to a StatsTarget.
bool isClosed () const
 
Returns:
whether the object has been closed

void close ()
 Closes this object, releasing any unallocated resources.
virtual CachePagelockPage (BlockId blockId, LockMode lockMode, bool readIfUnmapped=true, MappedPageListener *pMappedPageListener=NULL, TxnId txnId=IMPLICIT_TXN_ID)=0
 Locks a page into memory with the specified concurrency mode.
virtual void unlockPage (CachePage &page, LockMode lockMode, TxnId txnId=IMPLICIT_TXN_ID)=0
 Releases lock held on page.
virtual void discardPage (BlockId blockId)=0
 Unmaps a page from the cache if already mapped, discarding its contents if dirty.
virtual bool prefetchPage (BlockId blockId, MappedPageListener *pMappedPageListener=NULL)=0
 Hints that a page should be prefetched in preparation for a future lock request.
virtual void prefetchBatch (BlockId blockId, uint nPages, MappedPageListener *pMappedPageListener=NULL)=0
 Hints that a contiguous run of pages should be prefetched.
virtual void flushPage (CachePage &page, bool async)=0
 Forces the contents of a dirty page to its mapped location.
virtual void nicePage (CachePage &page)=0
 Marks a page as nice, indicating that it is very unlikely the page's mapping will be needed again any time soon, so it is a good candidate for victimization.
virtual void getPrefetchParams (uint &prefetchPagesMax, uint &prefetchThrottleRate)=0
 Retrieves the current pre-fetch caching parameters that determine how many pages should be pre-fetched and how often the pre-fetches should occur.

Static Public Member Functions

static SharedCache newCache (CacheParams const &cacheParams, CacheAllocator *bufferAllocator=NULL)
 Factory method.

Static Public Attributes

static const DeviceId NULL_DEVICE_ID
 The DeviceId assigned to the instance of RandomAccessNullDevice associated with every cache.

Protected Member Functions

virtual void closeImpl ()=0
 Must be implemented by derived class to release any resources.

Protected Attributes

uint cbPage
bool needsClose

Private Member Functions

virtual void notifyTransferCompletion (CachePage &, bool bSuccess)=0
virtual void markPageDirty (CachePage &)=0

Friends

class CachePage

Detailed Description

Cache defines an abstract interface for caching pages of devices.

This interface does not dictate how cache buffers are allocated, only how they are accessed. A Cache keeps track of a collection of registered devices; only pages of registered devices may be accessed through the cache.

Note that all concurrency control is performed within the implementations of these methods, so there is never any need to acquire any kind of lock object before calling them. However, some methods are themselves synchronization points, so callers should be aware of the potential for deadlock.

Definition at line 56 of file Cache.h.


Constructor & Destructor Documentation

Cache::~Cache (  )  [virtual]

Destructor.

Should not be called directly; use close instead. All devices must already have been unregistered.

Definition at line 34 of file Cache.cpp.

00035 {
00036 }


Member Function Documentation

SharedCache Cache::newCache ( CacheParams const &  cacheParams,
CacheAllocator bufferAllocator = NULL 
) [static]

Factory method.

This creates a cache which uses TwoQVictimPolicy. To create a cache with custom policies, include CacheImpl.h and instantiate CacheImpl directly.

Parameters:
cacheParams parameters to use to instantiate this cache
bufferAllocator allocator to use for obtaining buffer memory; NULL indicates use a private VMAllocator without mlocking
Returns:
new Cache

Definition at line 51 of file Cache.cpp.

Referenced by DatabaseTest::DatabaseTest(), CacheTestBase::newCache(), SparseBitmapTest::openStorage(), BackupRestoreTest::testBackupCleanup(), BTreeTxnTest::testCaseSetUp(), BackupRestoreTest::testHeaderBackupRestore(), CacheTest::testLargeCacheInit(), CacheTest::testLargeCacheRequest(), and CmdInterpreter::visit().

00054 {
00055     typedef CacheImpl<
00056         TwoQPage,
00057         TwoQVictimPolicy<TwoQPage>
00058         > TwoQCache;
00059     return SharedCache(
00060         new TwoQCache(cacheParams,bufferAllocator),
00061         ClosableObjectDestructor());
00062 }

virtual void Cache::setAllocatedPageCount ( uint  nMemPages  )  [pure virtual]

Resizes this cache.

If nMemPages is greater than the number of page buffers currently allocated, allocates more. If less, frees some (victimizing as necessary).

Parameters:
nMemPages desired buffer allocation count; must be less than the nMemPagesMax specified when the cache was created, and also less than the current clean page target

Implemented in CacheImpl< PageT, VictimPolicyT >.

Referenced by PagingTestBase::testCacheResize().

virtual uint Cache::getMaxAllocatedPageCount (  )  [pure virtual]

Returns:
maximum number of pages that can be allocated; i.e., the value of the cachePagesMax parameter

Implemented in CacheImpl< PageT, VictimPolicyT >.

virtual uint Cache::getAllocatedPageCount (  )  [pure virtual]

Gets a count of how many pages currently have allocated buffers.

Returns:
the current count

Implemented in CacheImpl< PageT, VictimPolicyT >.

Referenced by getMaxLockedPages().

virtual void Cache::collectStats ( CacheStats stats  )  [pure virtual]

Gets a snapshot of cache activity; as a side-effect, clears cumulative performance counters.

Parameters:
stats receives the snapshot

Implemented in CacheImpl< PageT, VictimPolicyT >.

Referenced by writeStats().

uint Cache::getPageSize (  )  const [inline]

Returns:
the size of cached pages (in bytes)

Definition at line 137 of file Cache.h.

Referenced by DoubleBufferExecStream::execute(), CachePage::getBufferSize(), FlatFileExecStreamImpl::open(), ScratchBufferExecStream::open(), DoubleBufferExecStream::open(), CachePage::tryUpgrade(), and CachePage::upgrade().

00138     {
00139         return cbPage;
00140     }

virtual CacheAllocator& Cache::getAllocator (  )  const [pure virtual]

Implemented in CacheImpl< PageT, VictimPolicyT >.

virtual void Cache::registerDevice ( DeviceId  deviceId,
SharedRandomAccessDevice  pDevice 
) [pure virtual]

Registers the given device with the Cache; must be called exactly once before any other caching operations can be requested for pages of this device.

Parameters:
deviceId the ID of the device to be registered
pDevice the device to be registered

Implemented in CacheImpl< PageT, VictimPolicyT >.

virtual void Cache::unregisterDevice ( DeviceId  deviceId  )  [pure virtual]

Unregisters the given device from the Cache, asserting that no pages remain mapped to the specified device.

Parameters:
deviceId the ID of the device to be unregistered

Implemented in CacheImpl< PageT, VictimPolicyT >.

virtual SharedRandomAccessDevice& Cache::getDevice ( DeviceId  deviceId  )  [pure virtual]

Dereferences a device ID to the registered object which represents it.

Parameters:
deviceId the ID of the device of interest
Returns:
the device, or NULL if no such device is registered with this Cache

Implemented in CacheImpl< PageT, VictimPolicyT >.

virtual uint Cache::checkpointPages ( PagePredicate pagePredicate,
CheckpointType  checkpointType = CHECKPOINT_FLUSH_ALL 
) [pure virtual]

Flushes and/or unmaps selected pages.

Parameters:
pagePredicate caller-provided interface for deciding which pages should be checkpointed; the given PagePredicate will be called for each mapped page, and only those which satisfy the predicate will be affected by the checkpoint (note that the page mutex is held for the duration of the call, so implementations must take care to avoid deadlock)
checkpointType type of checkpoint to execute
Returns:
number of pages for which pagePredicate returned true

Implemented in CacheImpl< PageT, VictimPolicyT >.

Referenced by PagingTestBase::testCheckpoint().

virtual bool Cache::isPageMapped ( BlockId  blockId  )  [pure virtual]

Determines if a particular page is mapped.

Parameters:
blockId BlockId of the page to test
Returns:
true if the page is currently mapped

Implemented in CacheImpl< PageT, VictimPolicyT >.

virtual CachePage& Cache::lockScratchPage ( BlockNum  blockNum = 0  )  [pure virtual]

Allocates a free page buffer for scratch usage.

The returned page is considered to be locked in exclusive mode but not mapped to any device. To release the page, use unlock(LOCKMODE_X).

Although the page remains unmapped, its BlockId is set for the duration of the lock. The caller can supply a BlockNum, which need not be unique.

Parameters:
blockNum the block number to use when making up the Page's BlockId; the device ID will be NULL_DEVICE_ID
Returns:
the locked page

Implemented in CacheImpl< PageT, VictimPolicyT >.

virtual DeviceAccessScheduler& Cache::getDeviceAccessScheduler ( RandomAccessDevice  )  [pure virtual]

Gets the correct access scheduler for a given device.

Currently the same scheduler is used for all devices.

Implemented in CacheImpl< PageT, VictimPolicyT >.

SharedCache Cache::getCache (  )  [virtual]

Returns:
the underlying Cache accessed by this CacheAccessor

Implements CacheAccessor.

Definition at line 64 of file Cache.cpp.

Referenced by CachePage::getWritableData(), CachePage::tryUpgrade(), and CachePage::upgrade().

00065 {
00066     return shared_from_this();
00067 }

uint Cache::getMaxLockedPages (  )  [virtual]

Returns:
the page lock quota on this accessor

Implements CacheAccessor.

Definition at line 69 of file Cache.cpp.

References getAllocatedPageCount().

00070 {
00071     return getAllocatedPageCount();
00072 }

void Cache::setMaxLockedPages ( uint  nPages  )  [virtual]

Sets the page lock quota on this accessor.

Ignored for accessor implementations that don't support quotas.

Parameters:
nPages new quota

Implements CacheAccessor.

Definition at line 74 of file Cache.cpp.

00075 {
00076 }

void Cache::setTxnId ( TxnId  txnId  )  [virtual]

Sets a default TxnId to use for locking pages (to be used when IMPLICIT_TXN_ID is specified).

Not all CacheAccessor implementations support this behavior.

Parameters:
txnId new default txn ID

Implements CacheAccessor.

Definition at line 78 of file Cache.cpp.

00079 {
00080 }

TxnId Cache::getTxnId (  )  const [virtual]

Returns:
default TxnId associated with this accessor

Implements CacheAccessor.

Definition at line 82 of file Cache.cpp.

References IMPLICIT_TXN_ID.

00083 {
00084     return IMPLICIT_TXN_ID;
00085 }

void Cache::writeStats ( StatsTarget target  )  [virtual]

Writes a current stats snapshot to a StatsTarget.

Parameters:
target receives the stats

Implements StatsSource.

Definition at line 87 of file Cache.cpp.

References collectStats(), CacheStats::nCheckpointWrites, CacheStats::nCheckpointWritesSinceInit, CacheStats::nDirtyPages, CacheStats::nHits, CacheStats::nHitsSinceInit, CacheStats::nIoRetries, CacheStats::nIoRetriesSinceInit, CacheStats::nLazyWriteCalls, CacheStats::nLazyWriteCallsSinceInit, CacheStats::nLazyWrites, CacheStats::nLazyWritesSinceInit, CacheStats::nMemPagesAllocated, CacheStats::nMemPagesMax, CacheStats::nMemPagesUnused, CacheStats::nPageReads, CacheStats::nPageReadsSinceInit, CacheStats::nPageWrites, CacheStats::nPageWritesSinceInit, CacheStats::nRejectedPrefetches, CacheStats::nRejectedPrefetchesSinceInit, CacheStats::nRequests, CacheStats::nRequestsSinceInit, CacheStats::nSuccessfulPrefetches, CacheStats::nSuccessfulPrefetchesSinceInit, CacheStats::nVictimizations, CacheStats::nVictimizationsSinceInit, CacheStats::nVictimizationWrites, CacheStats::nVictimizationWritesSinceInit, and StatsTarget::writeCounter().

00088 {
00089     CacheStats stats;
00090     collectStats(stats);
00091     target.writeCounter(
00092         "CacheHits", stats.nHits);
00093     target.writeCounter(
00094         "CacheHitsSinceInit", stats.nHitsSinceInit);
00095     target.writeCounter(
00096         "CacheRequests", stats.nRequests);
00097     target.writeCounter(
00098         "CacheRequestsSinceInit", stats.nRequestsSinceInit);
00099     target.writeCounter(
00100         "CacheVictimizations", stats.nVictimizations);
00101     target.writeCounter(
00102         "CacheVictimizationsSinceInit", stats.nVictimizationsSinceInit);
00103     target.writeCounter(
00104         "CacheDirtyPages", stats.nDirtyPages);
00105     target.writeCounter(
00106         "CachePagesRead", stats.nPageReads);
00107     target.writeCounter(
00108         "CachePagesReadSinceInit", stats.nPageReadsSinceInit);
00109     target.writeCounter(
00110         "CachePagesWritten", stats.nPageWrites);
00111     target.writeCounter(
00112         "CachePagesWrittenSinceInit", stats.nPageWritesSinceInit);
00113     target.writeCounter(
00114         "CachePagePrefetchesRejected", stats.nRejectedPrefetches);
00115     target.writeCounter(
00116         "CachePagePrefetchesRejectedSinceInit",
00117         stats.nRejectedPrefetchesSinceInit);
00118     target.writeCounter(
00119         "CachePageIoRetries", stats.nIoRetries);
00120     target.writeCounter(
00121         "CachePageIoRetriesSinceInit",
00122         stats.nIoRetriesSinceInit);
00123     target.writeCounter(
00124         "CachePagesPrefetched", stats.nSuccessfulPrefetches);
00125     target.writeCounter(
00126         "CachePagesPrefetchedSinceInit",
00127         stats.nSuccessfulPrefetchesSinceInit);
00128     target.writeCounter("CacheLazyWrites", stats.nLazyWrites);
00129     target.writeCounter("CacheLazyWritesSinceInit", stats.nLazyWritesSinceInit);
00130     target.writeCounter("CacheLazyWriteCalls", stats.nLazyWriteCalls);
00131     target.writeCounter(
00132         "CacheLazyWriteCallsSinceInit",
00133         stats.nLazyWriteCallsSinceInit);
00134     target.writeCounter("CacheVictimizationWrites", stats.nVictimizationWrites);
00135     target.writeCounter(
00136         "CacheVictimizationWritesSinceInit",
00137         stats.nVictimizationWritesSinceInit);
00138     target.writeCounter("CacheCheckpointWrites", stats.nCheckpointWrites);
00139     target.writeCounter(
00140         "CacheCheckpointWritesSinceInit",
00141         stats.nCheckpointWritesSinceInit);
00142     target.writeCounter(
00143         "CachePagesAllocated", stats.nMemPagesAllocated);
00144     target.writeCounter(
00145         "CachePagesUnused", stats.nMemPagesUnused);
00146     target.writeCounter(
00147         "CachePagesAllocationLimit", stats.nMemPagesMax);
00148 }

virtual void Cache::notifyTransferCompletion ( CachePage ,
bool  bSuccess 
) [private, pure virtual]

Implemented in CacheImpl< PageT, VictimPolicyT >.

Referenced by CachePage::notifyTransferCompletion().

virtual void Cache::markPageDirty ( CachePage  )  [private, pure virtual]

Implemented in CacheImpl< PageT, VictimPolicyT >.

virtual void ClosableObject::closeImpl (  )  [protected, pure virtual, inherited]

Must be implemented by derived class to release any resources.

Implemented in CacheImpl< PageT, VictimPolicyT >, ByteArrayInputStream, ByteArrayOutputStream, ByteOutputStream, CheckpointThread, Database, BarrierExecStream, DoubleBufferExecStream, ExecStream, ExecStreamGraphImpl, MockResourceExecStream, ReshapeExecStream, ScratchBufferExecStream, SegBufferExecStream, SegBufferReader, SegBufferReaderExecStream, SegBufferWriter, SegBufferWriterExecStream, JavaSinkExecStream, JavaTransformExecStream, FlatFileBuffer, FlatFileExecStreamImpl, BTreeExecStream, BTreeInsertExecStream, BTreePrefetchSearchExecStream, BTreeReadExecStream, BTreeSearchExecStream, FtrsTableWriterExecStream, LhxAggExecStream, LhxJoinExecStream, LbmBitOpExecStream, LbmChopperExecStream, LbmGeneratorExecStream, LbmIntersectExecStream, LbmMinusExecStream, LbmSplicerExecStream, LbmUnionExecStream, LcsClusterAppendExecStream, LcsRowScanBaseExecStream, LcsRowScanExecStream, DelegatingSegment, DynamicDelegatingSegment, ScratchSegment, SegInputStream, Segment, SegOutputStream, SegPageBackupRestoreDevice, SegStream, SegStreamAllocation, SpillOutputStream, and ExternalSortExecStreamImpl.

Referenced by ClosableObject::close().

bool ClosableObject::isClosed (  )  const [inline, inherited]

Returns:
whether the object has been closed

Definition at line 58 of file ClosableObject.h.

00059     {
00060         return !needsClose;
00061     }

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().

00040 {
00041     if (!needsClose) {
00042         return;
00043     }
00044     needsClose = false;
00045     closeImpl();
00046 }

virtual CachePage* CacheAccessor::lockPage ( BlockId  blockId,
LockMode  lockMode,
bool  readIfUnmapped = true,
MappedPageListener pMappedPageListener = NULL,
TxnId  txnId = IMPLICIT_TXN_ID 
) [pure virtual, inherited]

Locks a page into memory with the specified concurrency mode.

When the page contents are no longer needed, the caller must invoke the unlockPage() method with the same concurrency mode to release it. If the desired page is already locked by another thread with an incompatible concurrency mode, blocks until the page becomes available (unless the lock mode is of the NoWait variety, in which case returns NULL immediately). Note that NoWait locking only applies to lock contention, not I/O, so if an unmapped page is locked in NoWait mode, blocks until the read completes.

The device referenced by the requested blockId must already be registered with the cache and must remain registered for the duration of the lock.

Notes on concurrency modes:

Parameters:
blockId the BlockId of the page to be locked
lockMode the desired concurrency mode
readIfUnmapped if true (the default) the page data is read as part of mapping; if false, the page data is left invalid until first write (used when allocating a new block with invalid contents)
pMappedPageListener optional listener to receive notifications when this page is written; if specified, it must match all prior and subsequent lock requests for the same page mapping
txnId optional TxnId to associate with lock; default is IMPLICIT_TXN_ID, which uses current thread ID as an implicit TxnId
Returns:
the locked CachePage, or NULL if a NoWait attempt failed

Implemented in CacheImpl< PageT, VictimPolicyT >, DelegatingCacheAccessor, QuotaCacheAccessor, TransactionalCacheAccessor, and ScratchSegment.

Referenced by CacheTest::lockPage().

virtual void CacheAccessor::unlockPage ( CachePage page,
LockMode  lockMode,
TxnId  txnId = IMPLICIT_TXN_ID 
) [pure virtual, inherited]

Releases lock held on page.

Parameters:
page the page to be unlocked
lockMode must correspond to value passed to Cache::lockPage; however, for pages locked with NOWAIT, the equivalent unlock type should be normal (e.g. LOCKMODE_S instead of LOCKMODE_S_NOWAIT)
txnId must correspond to value passed to Cache::lockPage

Implemented in CacheImpl< PageT, VictimPolicyT >, DelegatingCacheAccessor, QuotaCacheAccessor, TransactionalCacheAccessor, and ScratchSegment.

Referenced by PagingTestBase::testScratch(), SegmentTestBase::unlockPage(), and CacheTest::unlockPage().

virtual void CacheAccessor::discardPage ( BlockId  blockId  )  [pure virtual, inherited]

Unmaps a page from the cache if already mapped, discarding its contents if dirty.

The caller must ensure that no other thread has the page locked.

Parameters:
blockId the BlockId of the page to be discarded

Implemented in CacheImpl< PageT, VictimPolicyT >, DelegatingCacheAccessor, and ScratchSegment.

virtual bool CacheAccessor::prefetchPage ( BlockId  blockId,
MappedPageListener pMappedPageListener = NULL 
) [pure virtual, inherited]

Hints that a page should be prefetched in preparation for a future lock request.

Parameters:
blockId the BlockId of the page to be prefetched
pMappedPageListener optional listener to receive notifications when this page is written; if specified, it must match all prior and subsequent lock requests for the same page mapping
Returns:
true if the pre-fetch request was successful

Implemented in CacheImpl< PageT, VictimPolicyT >, DelegatingCacheAccessor, and ScratchSegment.

Referenced by SegmentTestBase::prefetchPage(), and CacheTest::prefetchPage().

virtual void CacheAccessor::prefetchBatch ( BlockId  blockId,
uint  nPages,
MappedPageListener pMappedPageListener = NULL 
) [pure virtual, inherited]

Hints that a contiguous run of pages should be prefetched.

Parameters:
blockId the BlockId of the first page to be prefetched; more will be prefetched depending on the configured batch size
nPages number of pages in batch
pMappedPageListener optional listener to receive notifications when this page is written; if specified, it must match all prior and subsequent lock requests for the same page mapping

Implemented in CacheImpl< PageT, VictimPolicyT >, DelegatingCacheAccessor, and ScratchSegment.

Referenced by CacheTest::prefetchBatch().

virtual void CacheAccessor::flushPage ( CachePage page,
bool  async 
) [pure virtual, inherited]

Forces the contents of a dirty page to its mapped location.

Page must already be locked in exclusive mode. For an asynchronous flush, the caller must ensure that the page contents remain unchanged until the flush completes.

Parameters:
page the page to be flushed
async true to schedle async write and return immediately; false to wait for write to complete

Implemented in CacheImpl< PageT, VictimPolicyT >, DelegatingCacheAccessor, and ScratchSegment.

virtual void CacheAccessor::nicePage ( CachePage page  )  [pure virtual, inherited]

Marks a page as nice, indicating that it is very unlikely the page's mapping will be needed again any time soon, so it is a good candidate for victimization.

Parameters:
page the page to be marked

Implemented in CacheImpl< PageT, VictimPolicyT >, DelegatingCacheAccessor, and ScratchSegment.

Referenced by PagingTestBase::testOp().

virtual void CacheAccessor::getPrefetchParams ( uint prefetchPagesMax,
uint prefetchThrottleRate 
) [pure virtual, inherited]

Retrieves the current pre-fetch caching parameters that determine how many pages should be pre-fetched and how often the pre-fetches should occur.

Parameters:
[out] prefetchPagesMax max number of outstanding pre-fetch pages
[out] prefetchThrottleRate the number of successful pre-fetches that have to occur before the pre-fetch rate is throttled back up, in the event that it has been throttled down due to rejected requests

Implemented in CacheImpl< PageT, VictimPolicyT >, DelegatingCacheAccessor, and ScratchSegment.


Friends And Related Function Documentation

friend class CachePage [friend]

Definition at line 61 of file Cache.h.


Member Data Documentation

uint Cache::cbPage [protected]

Definition at line 64 of file Cache.h.

const DeviceId Cache::NULL_DEVICE_ID [static]

The DeviceId assigned to the instance of RandomAccessNullDevice associated with every cache.

This device is automatically registered when the cache is opened and unregistered when the cache is closed. Scratch pages have this DeviceId in their BlockIds, but no real blocks can ever be mapped to this device.

Definition at line 74 of file Cache.h.

Referenced by CacheImpl< PageT, VictimPolicyT >::closeImpl(), CachePage::isScratchLocked(), ScratchSegment::lockPage(), and ScratchSegment::translatePageId().

bool ClosableObject::needsClose [protected, inherited]

Definition at line 44 of file ClosableObject.h.

Referenced by SegStreamAllocation::beginWrite(), ExecStreamGraphImpl::clear(), ClosableObject::ClosableObject(), ClosableObject::close(), FlatFileBuffer::open(), ExecStreamGraphImpl::open(), ExecStream::open(), and ClosableObject::~ClosableObject().


The documentation for this class was generated from the following files:
Generated on Mon Jun 22 04:00:27 2009 for Fennel by  doxygen 1.5.1