#include <storage_engine_lock_file.h>
◆ StorageEngineLockFile()
mongo::StorageEngineLockFile::StorageEngineLockFile |
( |
const std::string & |
dbpath | ) |
|
Checks existing lock file, if present, to see if it contains data from a previous unclean shutdown.
A clean shutdown should have produced a zero length lock file. Uses open() to read existing lock file or create new file. Uses boost::filesystem to check lock file so may throw boost::exception.
◆ ~StorageEngineLockFile()
mongo::StorageEngineLockFile::~StorageEngineLockFile |
( |
| ) |
|
|
virtual |
◆ clearPidAndUnlock()
void mongo::StorageEngineLockFile::clearPidAndUnlock |
( |
| ) |
|
Truncates file contents and releases file locks.
◆ close()
void mongo::StorageEngineLockFile::close |
( |
| ) |
|
Closes lock file handles.
◆ createdByUncleanShutdown()
bool mongo::StorageEngineLockFile::createdByUncleanShutdown |
( |
| ) |
const |
Returns true if lock file was not zeroed out due to previous unclean shutdown.
This state is evaluated at object initialization to allow storage engine to make decisions on recovery based on this information after open() has been called.
◆ get()
◆ getFilespec()
std::string mongo::StorageEngineLockFile::getFilespec |
( |
| ) |
const |
Returns the path to the lock file.
◆ MONGO_DISALLOW_COPYING()
◆ open()
Status mongo::StorageEngineLockFile::open |
( |
| ) |
|
Opens and locks 'mongod.lock' in 'dbpath' directory.
◆ writePid()
Status mongo::StorageEngineLockFile::writePid |
( |
| ) |
|
Writes current process ID to file.
Fails if lock file has not been opened.
◆ _dbpath
std::string mongo::StorageEngineLockFile::_dbpath |
|
private |
◆ _filespec
std::string mongo::StorageEngineLockFile::_filespec |
|
private |
◆ _lockFileHandle
std::unique_ptr<LockFileHandle> mongo::StorageEngineLockFile::_lockFileHandle |
|
private |
◆ _uncleanShutdown
bool mongo::StorageEngineLockFile::_uncleanShutdown |
|
private |
The documentation for this class was generated from the following files: