![]() |
Storage Engine API
|
Used to implement likelyInPhysicalMemory() for the MMAP v1 storage engine. More...
#include <record_access_tracker.h>
Used to implement likelyInPhysicalMemory() for the MMAP v1 storage engine.
Since MMAP v1 holds exclusive collection-level locks, it should yield the locks during a page fault. The RecordAccessTracker is used to guess at which records are in memory, so that a yield can be requested unless we're sure that the record has been recently accessed.
Classes | |
struct | Entry |
class | Rolling |
this contains many slices of times the idea you put mem status in the current time slice and then after a certain period of time, it rolls off so we check again More... | |
class | Slice |
simple hash map for region -> status this constitutes a single region of time it does chaining, but very short chains More... | |
Public Types | |
enum | Constants { SliceSize = 1024, MaxChain = 20, NumSlices = 10, RotateTimeSecs = 90, BigHashSize = 128 } |
Public Member Functions | |
RecordAccessTracker (ClockSource *cs) | |
void | markAccessed (const void *record) |
Informs this record access tracker that 'record' has been accessed. More... | |
bool | checkAccessedAndMark (const void *record) |
void | reset () |
Clears out any history of record accesses. More... | |
void | disableSystemBlockInMemCheck () |
The accessedRecently() implementation falls back to making a system call if it appears that the record is not in physical memory. More... | |
Private Types | |
enum | State { In, Out, Unk } |
Private Member Functions | |
MONGO_DISALLOW_COPYING (RecordAccessTracker) | |
Private Attributes | |
bool | _blockSupported |
ClockSource * | _clock |
std::unique_ptr< Rolling[]> | _rollingTable |
|
private |
mongo::RecordAccessTracker::RecordAccessTracker | ( | ClockSource * | cs | ) |
bool mongo::RecordAccessTracker::checkAccessedAndMark | ( | const void * | record | ) |
Also has the side effect of marking 'record' as accessed.
void mongo::RecordAccessTracker::disableSystemBlockInMemCheck | ( | ) |
The accessedRecently() implementation falls back to making a system call if it appears that the record is not in physical memory.
Use this method to disable the fallback for testing.
Informs this record access tracker that 'record' has been accessed.
|
private |
void mongo::RecordAccessTracker::reset | ( | ) |
Clears out any history of record accesses.
|
private |
|
private |
|
private |