Storage Engine API
mongo::DataFile Class Reference

#include <data_file.h>

Public Member Functions

 DataFile (OperationContext *opCtx, int fn)
 
Status openExisting (OperationContext *opCtx, const char *filename)
 
void open (OperationContext *opCtx, const char *filename, int requestedDataSize=0, bool preallocateOnly=false)
 creates if DNE More...
 
void close (OperationContext *opCtx)
 Must be called before destruction. More...
 
DiskLoc allocExtentArea (OperationContext *opCtx, int size)
 
DataFileHeadergetHeader ()
 
const DataFileHeadergetHeader () const
 
HANDLE getFd ()
 
unsigned long long length () const
 
void flush (bool sync)
 fsync More...
 

Static Public Member Functions

static int maxSize ()
 

Private Member Functions

void badOfs (int) const
 
int _defaultSize () const
 
void grow (DiskLoc dl, int size)
 
char * p () const
 
DataFileHeaderheader ()
 
const DataFileHeaderheader () const
 

Private Attributes

const int _fileNo
 
DurableMappedFile mmf
 
void_mb
 

Friends

class MmapV1ExtentManager
 

Constructor & Destructor Documentation

◆ DataFile()

mongo::DataFile::DataFile ( OperationContext *  opCtx,
int  fn 
)
inline

Member Function Documentation

◆ _defaultSize()

int mongo::DataFile::_defaultSize ( ) const
private

◆ allocExtentArea()

DiskLoc mongo::DataFile::allocExtentArea ( OperationContext *  opCtx,
int  size 
)

◆ badOfs()

NOINLINE_DECL void mongo::DataFile::badOfs ( int  ofs) const
private

◆ close()

void mongo::DataFile::close ( OperationContext *  opCtx)
inline

Must be called before destruction.

◆ flush()

void mongo::DataFile::flush ( bool  sync)

fsync

◆ getFd()

HANDLE mongo::DataFile::getFd ( )
inline

◆ getHeader() [1/2]

DataFileHeader* mongo::DataFile::getHeader ( )
inline

◆ getHeader() [2/2]

const DataFileHeader* mongo::DataFile::getHeader ( ) const
inline

◆ grow()

void mongo::DataFile::grow ( DiskLoc  dl,
int  size 
)
private

◆ header() [1/2]

DataFileHeader* mongo::DataFile::header ( )
inlineprivate

◆ header() [2/2]

const DataFileHeader* mongo::DataFile::header ( ) const
inlineprivate

◆ length()

unsigned long long mongo::DataFile::length ( ) const
inline

◆ maxSize()

int mongo::DataFile::maxSize ( )
static

◆ open()

void mongo::DataFile::open ( OperationContext *  opCtx,
const char *  filename,
int  requestedDataSize = 0,
bool  preallocateOnly = false 
)

creates if DNE

◆ openExisting()

Status mongo::DataFile::openExisting ( OperationContext *  opCtx,
const char *  filename 
)
Returns
true if found and opened. if uninitialized (prealloc only) does not open.

◆ p()

char* mongo::DataFile::p ( ) const
inlineprivate

Friends And Related Function Documentation

◆ MmapV1ExtentManager

friend class MmapV1ExtentManager
friend

Member Data Documentation

◆ _fileNo

const int mongo::DataFile::_fileNo
private

◆ _mb

void* mongo::DataFile::_mb
private

◆ mmf

DurableMappedFile mongo::DataFile::mmf
private

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