Storage Engine API
mongo::LogFile Class Reference

#include <logfile.h>

Public Member Functions

 LogFile (const std::string &name, bool readwrite=false)
 create the file and open. More...
 
 ~LogFile ()
 closes More...
 
void synchronousAppend (const void *buf, size_t len)
 append to file. More...
 
void writeAt (unsigned long long offset, const void *_bug, size_t _len)
 write at specified offset. More...
 
void readAt (unsigned long long offset, void *_buf, size_t _len)
 
void truncate ()
 

Public Attributes

const std::string _name
 

Private Types

typedef int fd_type
 

Private Attributes

const size_t minDirectIOSizeBytes = 4096
 
fd_type _fd
 
bool _direct
 
size_t _blkSize
 

Member Typedef Documentation

◆ fd_type

typedef int mongo::LogFile::fd_type
private

Constructor & Destructor Documentation

◆ LogFile()

mongo::LogFile::LogFile ( const std::string &  name,
bool  readwrite = false 
)

create the file and open.

must not already exist. throws UserAssertion on i/o error

◆ ~LogFile()

mongo::LogFile::~LogFile ( )

closes

Member Function Documentation

◆ readAt()

void mongo::LogFile::readAt ( unsigned long long  offset,
void _buf,
size_t  _len 
)

◆ synchronousAppend()

void mongo::LogFile::synchronousAppend ( const void buf,
size_t  len 
)

append to file.

does not return until sync'd. uses direct i/o when possible. throws UserAssertion on an i/o error note direct i/o may have alignment requirements

◆ truncate()

void mongo::LogFile::truncate ( )

◆ writeAt()

void mongo::LogFile::writeAt ( unsigned long long  offset,
const void _bug,
size_t  _len 
)

write at specified offset.

must be aligned. noreturn until physically written. thread safe

Member Data Documentation

◆ _blkSize

size_t mongo::LogFile::_blkSize
private

◆ _direct

bool mongo::LogFile::_direct
private

◆ _fd

fd_type mongo::LogFile::_fd
private

◆ _name

const std::string mongo::LogFile::_name

◆ minDirectIOSizeBytes

const size_t mongo::LogFile::minDirectIOSizeBytes = 4096
private

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