![]() |
Storage Engine API
|
ExtentManager basics. More...
#include <extent_manager.h>
ExtentManager basics.
Classes | |
class | CacheHint |
class | Factory |
Public Types | |
enum | HintType { Sequential, Random } |
Public Member Functions | |
ExtentManager () | |
virtual | ~ExtentManager () |
virtual void | close (OperationContext *opCtx)=0 |
virtual Status | init (OperationContext *opCtx)=0 |
opens all current files More... | |
virtual int | numFiles () const =0 |
virtual long long | fileSize () const =0 |
virtual DiskLoc | allocateExtent (OperationContext *opCtx, bool capped, int size, bool enforceQuota)=0 |
virtual void | freeExtents (OperationContext *opCtx, DiskLoc firstExt, DiskLoc lastExt)=0 |
firstExt has to be == lastExt or a chain More... | |
virtual void | freeExtent (OperationContext *opCtx, DiskLoc extent)=0 |
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 =0 |
Retrieve statistics on the the free list managed by this ExtentManger. More... | |
virtual MmapV1RecordHeader * | recordForV1 (const DiskLoc &loc) const =0 |
virtual std::unique_ptr< RecordFetcher > | recordNeedsFetch (const DiskLoc &loc) const =0 |
The extent manager tracks accesses to DiskLocs. More... | |
virtual Extent * | extentForV1 (const DiskLoc &loc) const =0 |
virtual DiskLoc | extentLocForV1 (const DiskLoc &loc) const =0 |
virtual Extent * | getExtent (const DiskLoc &loc, bool doSanityCheck=true) const =0 |
virtual int | maxSize () const =0 |
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... | |
virtual CacheHint * | cacheHint (const DiskLoc &extentLoc, const HintType &hint)=0 |
Tell the system that for this extent, it will have this kind of disk access. More... | |
virtual DataFileVersion | getFileFormat (OperationContext *opCtx) const =0 |
virtual void | setFileFormat (OperationContext *opCtx, DataFileVersion newVersion)=0 |
virtual const DataFile * | getOpenFile (int n) const =0 |
Private Member Functions | |
MONGO_DISALLOW_COPYING (ExtentManager) | |
|
inline |
|
inlinevirtual |
|
pure virtual |
Implemented in mongo::DummyExtentManager, and mongo::MmapV1ExtentManager.
|
pure virtual |
Tell the system that for this extent, it will have this kind of disk access.
Caller takes owernship of CacheHint
Implemented in mongo::MmapV1ExtentManager, and mongo::DummyExtentManager.
|
pure virtual |
Implemented in mongo::DummyExtentManager, and mongo::MmapV1ExtentManager.
loc | - has to be for a specific MmapV1RecordHeader (not an Extent) Note(erh) see comment on recordFor |
Implemented in mongo::DummyExtentManager, and mongo::MmapV1ExtentManager.
loc | - has to be for a specific MmapV1RecordHeader (not an Extent) Note(erh) see comment on recordFor |
Implemented in mongo::MmapV1ExtentManager, and mongo::DummyExtentManager.
|
pure virtual |
Implemented in mongo::DummyExtentManager, and mongo::MmapV1ExtentManager.
|
virtual |
recordLen | length of record we need |
lastExt | size of last extent which is a factor in next extent size |
|
pure virtual |
frees a single extent ignores all fields in the Extent except: magic, myLoc, length
Implemented in mongo::DummyExtentManager, and mongo::MmapV1ExtentManager.
|
pure virtual |
firstExt has to be == lastExt or a chain
Implemented in mongo::DummyExtentManager, and mongo::MmapV1ExtentManager.
|
pure virtual |
Retrieve statistics on the the free list managed by this ExtentManger.
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. |
Implemented in mongo::DummyExtentManager, and mongo::MmapV1ExtentManager.
|
pure virtual |
loc | - has to be for a specific Extent |
Implemented in mongo::MmapV1ExtentManager, and mongo::DummyExtentManager.
|
pure virtual |
Implemented in mongo::MmapV1ExtentManager, and mongo::DummyExtentManager.
|
pure virtual |
Implemented in mongo::MmapV1ExtentManager, and mongo::DummyExtentManager.
|
pure virtual |
opens all current files
Implemented in mongo::DummyExtentManager, and mongo::MmapV1ExtentManager.
|
virtual |
get a suggested size for the first extent in a namespace
recordLen | length of record we need to insert |
|
pure virtual |
Implemented in mongo::MmapV1ExtentManager, and mongo::DummyExtentManager.
|
inlinevirtual |
|
private |
|
pure virtual |
Implemented in mongo::DummyExtentManager, and mongo::MmapV1ExtentManager.
|
virtual |
quantizes extent size to >= min + page boundary
|
pure virtual |
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. |
Implemented in mongo::DummyExtentManager, and mongo::MmapV1ExtentManager.
|
pure virtual |
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.
Implemented in mongo::DummyExtentManager, and mongo::MmapV1ExtentManager.
|
pure virtual |
Implemented in mongo::MmapV1ExtentManager, and mongo::DummyExtentManager.