#include <mmap.h>
◆ MemoryMappedFile()
mongo::MemoryMappedFile::MemoryMappedFile |
( |
OperationContext * |
opCtx, |
|
|
OptionSet |
options = NONE |
|
) |
| |
◆ ~MemoryMappedFile()
mongo::MemoryMappedFile::~MemoryMappedFile |
( |
| ) |
|
|
virtual |
◆ close()
void mongo::MemoryMappedFile::close |
( |
OperationContext * |
opCtx | ) |
|
|
virtual |
◆ create()
void * mongo::MemoryMappedFile::create |
( |
OperationContext * |
opCtx, |
|
|
const std::string & |
filename, |
|
|
unsigned long long |
len, |
|
|
bool |
zero |
|
) |
| |
uasserts if file exists.
fasserts on mmap error.
- Parameters
-
zero | fill file with zeros when true |
◆ createPrivateMap()
void * mongo::MemoryMappedFile::createPrivateMap |
( |
| ) |
|
Creates a new view with the specified properties.
Automatically cleaned up upon close/destruction of the MemoryMappedFile object. Returns nullptr on mmap error.
◆ flush()
void mongo::MemoryMappedFile::flush |
( |
bool |
sync | ) |
|
|
virtual |
◆ getFd()
HANDLE mongo::MemoryMappedFile::getFd |
( |
| ) |
const |
|
inline |
◆ getUniqueId()
virtual uint64_t mongo::MemoryMappedFile::getUniqueId |
( |
| ) |
const |
|
inlinevirtual |
◆ isClosed()
bool mongo::MemoryMappedFile::isClosed |
( |
| ) |
|
|
virtual |
◆ length()
unsigned long long mongo::MemoryMappedFile::length |
( |
| ) |
const |
|
inlinevirtual |
◆ map() [1/2]
void * mongo::MemoryMappedFile::map |
( |
OperationContext * |
opCtx, |
|
|
const char * |
filename |
|
) |
| |
uasserts if file doesn't exist.
fasserts on mmap error.
◆ map() [2/2]
void * mongo::MemoryMappedFile::map |
( |
OperationContext * |
opCtx, |
|
|
const char * |
filename, |
|
|
unsigned long long & |
length |
|
) |
| |
|
protected |
Creates with length if DNE, otherwise validates input length.
Returns nullptr on mmap error.
◆ prepareFlush()
returns a thread safe object that you can call flush on Flushable has to fail nicely if the underlying object gets killed
Implements mongo::MongoFile.
◆ remapPrivateView()
void * mongo::MemoryMappedFile::remapPrivateView |
( |
OperationContext * |
opCtx, |
|
|
void * |
oldPrivateAddr |
|
) |
| |
|
protected |
Close the current private view and open a new replacement.
Returns nullptr on mmap error.
◆ shortLength()
long mongo::MemoryMappedFile::shortLength |
( |
| ) |
const |
|
inline |
◆ totalMappedLengthInMB()
static int mongo::MemoryMappedFile::totalMappedLengthInMB |
( |
| ) |
|
|
inlinestatic |
◆ updateLength()
void mongo::MemoryMappedFile::updateLength |
( |
const char * |
filename, |
|
|
unsigned long long & |
length |
|
) |
| |
|
staticprivate |
◆ viewForFlushing()
virtual void* mongo::MemoryMappedFile::viewForFlushing |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ _uniqueId
const uint64_t mongo::MemoryMappedFile::_uniqueId |
|
private |
◆ fd
HANDLE mongo::MemoryMappedFile::fd = 0 |
|
private |
◆ len
unsigned long long mongo::MemoryMappedFile::len = 0u |
|
private |
◆ maphandle
HANDLE mongo::MemoryMappedFile::maphandle = 0 |
|
private |
◆ totalMappedLength
AtomicUInt64 mongo::MemoryMappedFile::totalMappedLength |
|
staticprivate |
◆ views
std::vector<void*> mongo::MemoryMappedFile::views |
|
private |
The documentation for this class was generated from the following files:
- /home/louis/git/mongodbsource.github.io/src/src/mongo/db/storage/mmap_v1/mmap.h
- /home/louis/git/mongodbsource.github.io/src/src/mongo/db/storage/mmap_v1/mmap.cpp
- /home/louis/git/mongodbsource.github.io/src/src/mongo/db/storage/mmap_v1/mmap_posix.cpp
- /home/louis/git/mongodbsource.github.io/src/src/mongo/db/storage/mmap_v1/mmap_windows.cpp