Fennel: MappedPageListener Class Reference (original) (raw)

MappedPageListener defines an interface which allows a derived class to receive notifications of events on mapped pages. More...

#include <[MappedPageListener.h](MappedPageListener%5F8h-source.html)>

Inheritance diagram for MappedPageListener:

List of all members.

Public Member Functions
virtual ~MappedPageListener ()
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 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.
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.
virtual MappedPageListener * notifyAfterPageCheckpointFlush (CachePage &page)
Receives notification that a page has been flushed during a checkpoint.
virtual MappedPageListener * getTracingListener ()=0
Retrieves the tracing wrapper corresponding to this listener if tracing is turned on.

Detailed Description

MappedPageListener defines an interface which allows a derived class to receive notifications of events on mapped pages.

All methods have dummy implementations (not pure virtual) so derived classes only need to override those of interest.

Definition at line 37 of file MappedPageListener.h.


Constructor & Destructor Documentation

| MappedPageListener::~MappedPageListener | ( | | ) | [virtual] | | ---------------------------------------- | - | | - | ----------- |


Member Function Documentation

void MappedPageListener::notifyPageMap ( CachePage & page ) [virtual]
void MappedPageListener::notifyPageUnmap ( CachePage & page ) [virtual]
void MappedPageListener::notifyAfterPageRead ( CachePage & page ) [virtual]
void MappedPageListener::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 in DelegatingSegment, DynamicDelegatingSegment, SnapshotRandomAllocationSegment, TracingSegment, VersionedSegment, and WALSegment.

Definition at line 41 of file MappedPageListener.cpp.

bool MappedPageListener::canFlushPage ( CachePage & page ) [virtual]
void MappedPageListener::notifyBeforePageFlush ( CachePage & page ) [virtual]

Receives notification from CacheImpl just before a dirty page is flushed to disk.

Allows some logging action to be taken; for example, flushing corresponding write-ahead log pages, or storing a checksum in the page header. Called with the page mutex held, so the implementation must take care to avoid deadlock.

Parameters:

page the page to be flushed

Reimplemented in DelegatingSegment, DynamicDelegatingSegment, and TracingSegment.

Definition at line 45 of file MappedPageListener.cpp.

void MappedPageListener::notifyAfterPageFlush ( CachePage & page ) [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 in SnapshotRandomAllocationSegment, and TracingSegment.

Definition at line 62 of file MappedPageListener.cpp.

00064 { 00065 return NULL; 00066 }


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


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