#include <MappedPageListener.h>
Inheritance diagram for MappedPageListener:
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. |
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.
MappedPageListener::~MappedPageListener | ( | ) | [virtual] |
void MappedPageListener::notifyPageMap | ( | CachePage & | page | ) | [virtual] |
Receives notification from CacheImpl as soon as a page is mapped, before any I/O is initiated to retrieve the page contents.
Called with the page mutex held, so the implementation must take care to avoid deadlock.
page | the page being mapped |
Reimplemented in DelegatingSegment, DynamicDelegatingSegment, and TracingSegment.
Definition at line 29 of file MappedPageListener.cpp.
Referenced by CacheImpl< PageT, VictimPolicyT >::mapPage().
void MappedPageListener::notifyPageUnmap | ( | CachePage & | page | ) | [virtual] |
Receives notification from CacheImpl just before a page is unmapped.
Called with the page mutex held, so the implementation must take care to avoid deadlock.
page | the page being unmapped |
Reimplemented in DelegatingSegment, DynamicDelegatingSegment, TracingSegment, and WALSegment.
Definition at line 33 of file MappedPageListener.cpp.
void MappedPageListener::notifyAfterPageRead | ( | CachePage & | page | ) | [virtual] |
Receives notification from CacheImpl after a page read completes.
Called with the page mutex held, so the implementation must take care to avoid deadlock.
page | the page read |
Reimplemented in DelegatingSegment, DynamicDelegatingSegment, and TracingSegment.
Definition at line 37 of file MappedPageListener.cpp.
Referenced by CacheImpl< PageT, VictimPolicyT >::notifyTransferCompletion().
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.
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] |
Informs CacheImpl whether a dirty page can safely be flushed to disk.
Called with the page mutex held, so the implementation must take care to avoid deadlock.
page | the page to be flushed |
Reimplemented in DelegatingSegment, DynamicDelegatingSegment, SnapshotRandomAllocationSegment, and VersionedSegment.
Definition at line 53 of file MappedPageListener.cpp.
Referenced by CacheImpl< PageT, VictimPolicyT >::flushPage().
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.
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 from CacheImpl when a page flush completes successfully.
Called with the page mutex held, so the implementation must take care to avoid deadlock.
page | the page that was flushed |
Reimplemented in DelegatingSegment, DynamicDelegatingSegment, TracingSegment, and WALSegment.
Definition at line 49 of file MappedPageListener.cpp.
Referenced by CacheImpl< PageT, VictimPolicyT >::notifyTransferCompletion().
MappedPageListener * MappedPageListener::notifyAfterPageCheckpointFlush | ( | 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.
page | the page that was flushed |
Reimplemented in SnapshotRandomAllocationSegment, and TracingSegment.
Definition at line 62 of file MappedPageListener.cpp.
virtual MappedPageListener* MappedPageListener::getTracingListener | ( | ) | [pure virtual] |
Retrieves the tracing wrapper corresponding to this listener if tracing is turned on.
Otherwise, returns this listener itself.
Implemented in Segment.
Referenced by TracingSegment::getMappedPageListener(), and TracingSegment::notifyAfterPageCheckpointFlush().