Storage Engine API
mongo::DummyExtentManager Class Reference

#include <record_store_v1_test_help.h>

Inheritance diagram for mongo::DummyExtentManager:
mongo::ExtentManager

Classes

struct  ExtentInfo
 

Public Member Functions

virtual ~DummyExtentManager ()
 
virtual void close (OperationContext *opCtx)
 
virtual Status init (OperationContext *opCtx)
 opens all current files More...
 
virtual int numFiles () const
 
virtual long long fileSize () const
 
virtual DiskLoc allocateExtent (OperationContext *opCtx, bool capped, int size, bool enforceQuota)
 
virtual void freeExtents (OperationContext *opCtx, DiskLoc firstExt, DiskLoc lastExt)
 firstExt has to be == lastExt or a chain More...
 
virtual void freeExtent (OperationContext *opCtx, DiskLoc extent)
 frees a single extent ignores all fields in the Extent except: magic, myLoc, length More...
 
virtual void freeListStats (OperationContext *opCtx, int *numExtents, int64_t *totalFreeSizeBytes) const
 Retrieve statistics on the the free list managed by this ExtentManger. More...
 
virtual MmapV1RecordHeaderrecordForV1 (const DiskLoc &loc) const
 
virtual std::unique_ptr< RecordFetcherrecordNeedsFetch (const DiskLoc &loc) const final
 The extent manager tracks accesses to DiskLocs. More...
 
virtual ExtentextentForV1 (const DiskLoc &loc) const
 
virtual DiskLoc extentLocForV1 (const DiskLoc &loc) const
 
virtual ExtentgetExtent (const DiskLoc &loc, bool doSanityCheck=true) const
 
virtual int maxSize () const
 
virtual CacheHintcacheHint (const DiskLoc &extentLoc, const HintType &hint)
 Tell the system that for this extent, it will have this kind of disk access. More...
 
DataFileVersion getFileFormat (OperationContext *opCtx) const final
 
virtual void setFileFormat (OperationContext *opCtx, DataFileVersion newVersion) final
 
const DataFilegetOpenFile (int n) const final
 
- Public Member Functions inherited from mongo::ExtentManager
 ExtentManager ()
 
virtual ~ExtentManager ()
 
virtual int minSize () const
 
virtual int followupSize (int recordLen, int lastExtentLen) const
 
virtual int initialSize (int recordLen) const
 get a suggested size for the first extent in a namespace More...
 
virtual int quantizeExtentSize (int size) const
 quantizes extent size to >= min + page boundary More...
 

Protected Attributes

std::vector< ExtentInfo_extents
 

Additional Inherited Members

- Public Types inherited from mongo::ExtentManager
enum  HintType { Sequential, Random }
 

Constructor & Destructor Documentation

◆ ~DummyExtentManager()

mongo::DummyExtentManager::~DummyExtentManager ( )
virtual

Member Function Documentation

◆ allocateExtent()

DiskLoc mongo::DummyExtentManager::allocateExtent ( OperationContext *  opCtx,
bool  capped,
int  size,
bool  enforceQuota 
)
virtual

Implements mongo::ExtentManager.

◆ cacheHint()

DummyExtentManager::CacheHint * mongo::DummyExtentManager::cacheHint ( const DiskLoc extentLoc,
const HintType hint 
)
virtual

Tell the system that for this extent, it will have this kind of disk access.

Caller takes owernship of CacheHint

Implements mongo::ExtentManager.

◆ close()

void mongo::DummyExtentManager::close ( OperationContext *  opCtx)
virtual

Implements mongo::ExtentManager.

◆ extentForV1()

Extent * mongo::DummyExtentManager::extentForV1 ( const DiskLoc loc) const
virtual
Parameters
loc- has to be for a specific MmapV1RecordHeader (not an Extent) Note(erh) see comment on recordFor

Implements mongo::ExtentManager.

◆ extentLocForV1()

DiskLoc mongo::DummyExtentManager::extentLocForV1 ( const DiskLoc loc) const
virtual
Parameters
loc- has to be for a specific MmapV1RecordHeader (not an Extent) Note(erh) see comment on recordFor

Implements mongo::ExtentManager.

◆ fileSize()

long long mongo::DummyExtentManager::fileSize ( ) const
virtual

Implements mongo::ExtentManager.

◆ freeExtent()

void mongo::DummyExtentManager::freeExtent ( OperationContext *  opCtx,
DiskLoc  extent 
)
virtual

frees a single extent ignores all fields in the Extent except: magic, myLoc, length

Implements mongo::ExtentManager.

◆ freeExtents()

void mongo::DummyExtentManager::freeExtents ( OperationContext *  opCtx,
DiskLoc  firstExt,
DiskLoc  lastExt 
)
virtual

firstExt has to be == lastExt or a chain

Implements mongo::ExtentManager.

◆ freeListStats()

void mongo::DummyExtentManager::freeListStats ( OperationContext *  opCtx,
int *  numExtents,
int64_t *  totalFreeSizeBytes 
) const
virtual

Retrieve statistics on the the free list managed by this ExtentManger.

Parameters
numExtents- non-null pointer to an int that will receive the number of extents
totalFreeSizeBytes- non-null pointer to an int64_t receiving the total free space in the free list.

Implements mongo::ExtentManager.

◆ getExtent()

Extent * mongo::DummyExtentManager::getExtent ( const DiskLoc loc,
bool  doSanityCheck = true 
) const
virtual
Parameters
loc- has to be for a specific Extent

Implements mongo::ExtentManager.

◆ getFileFormat()

DataFileVersion mongo::DummyExtentManager::getFileFormat ( OperationContext *  opCtx) const
finalvirtual

Implements mongo::ExtentManager.

◆ getOpenFile()

const DataFile * mongo::DummyExtentManager::getOpenFile ( int  n) const
finalvirtual

Implements mongo::ExtentManager.

◆ init()

Status mongo::DummyExtentManager::init ( OperationContext *  opCtx)
virtual

opens all current files

Implements mongo::ExtentManager.

◆ maxSize()

int mongo::DummyExtentManager::maxSize ( ) const
virtual
Returns
maximum size of an Extent

Implements mongo::ExtentManager.

◆ numFiles()

int mongo::DummyExtentManager::numFiles ( ) const
virtual

Implements mongo::ExtentManager.

◆ recordForV1()

MmapV1RecordHeader * mongo::DummyExtentManager::recordForV1 ( const DiskLoc loc) const
virtual
Parameters
loc- has to be for a specific MmapV1RecordHeader Note(erh): this sadly cannot be removed. A MmapV1RecordHeader DiskLoc has an offset from a file, while a RecordStore really wants an offset from an extent. This intrinsically links an original record store to the original extent manager.

Implements mongo::ExtentManager.

◆ recordNeedsFetch()

std::unique_ptr< RecordFetcher > mongo::DummyExtentManager::recordNeedsFetch ( const DiskLoc loc) const
finalvirtual

The extent manager tracks accesses to DiskLocs.

This returns non-NULL if the DiskLoc has been recently accessed, and therefore has likely been paged into physical memory. Returns nullptr if the DiskLoc is Null.

Implements mongo::ExtentManager.

◆ setFileFormat()

void mongo::DummyExtentManager::setFileFormat ( OperationContext *  opCtx,
DataFileVersion  newVersion 
)
finalvirtual

Implements mongo::ExtentManager.

Member Data Documentation

◆ _extents

std::vector<ExtentInfo> mongo::DummyExtentManager::_extents
protected

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