diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2015-06-20 00:22:50 -0400 |
---|---|---|
committer | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2015-06-20 10:56:02 -0400 |
commit | 9c2ed42daa8fbbef4a919c21ec564e2db55e8d60 (patch) | |
tree | 3814f79c10d7b490948d8cb7b112ac1dd41ceff1 /src/mongo/db/storage/storage_engine_lock_file.h | |
parent | 01965cf52bce6976637ecb8f4a622aeb05ab256a (diff) | |
download | mongo-9c2ed42daa8fbbef4a919c21ec564e2db55e8d60.tar.gz |
SERVER-18579: Clang-Format - reformat code, no comment reflow
Diffstat (limited to 'src/mongo/db/storage/storage_engine_lock_file.h')
-rw-r--r-- | src/mongo/db/storage/storage_engine_lock_file.h | 110 |
1 files changed, 55 insertions, 55 deletions
diff --git a/src/mongo/db/storage/storage_engine_lock_file.h b/src/mongo/db/storage/storage_engine_lock_file.h index 2cb14ac77d3..24e2359396e 100644 --- a/src/mongo/db/storage/storage_engine_lock_file.h +++ b/src/mongo/db/storage/storage_engine_lock_file.h @@ -36,60 +36,60 @@ namespace mongo { - class StorageEngineLockFile { - MONGO_DISALLOW_COPYING(StorageEngineLockFile); - public: - - /** - * 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(const std::string& dbpath); - - virtual ~StorageEngineLockFile(); - - /** - * Returns the path to the lock file. - */ - std::string getFilespec() 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. - */ - bool createdByUncleanShutdown() const; - - /** - * Opens and locks 'mongod.lock' in 'dbpath' directory. - */ - Status open(); - - /** - * Closes lock file handles. - */ - void close(); - - /** - * Writes current process ID to file. - * Fails if lock file has not been opened. - */ - Status writePid(); - - /** - * Truncates file contents and releases file locks. - */ - void clearPidAndUnlock(); - - private: - std::string _dbpath; - std::string _filespec; - bool _uncleanShutdown; - - class LockFileHandle; - std::unique_ptr<LockFileHandle> _lockFileHandle; - }; +class StorageEngineLockFile { + MONGO_DISALLOW_COPYING(StorageEngineLockFile); + +public: + /** + * 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(const std::string& dbpath); + + virtual ~StorageEngineLockFile(); + + /** + * Returns the path to the lock file. + */ + std::string getFilespec() 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. + */ + bool createdByUncleanShutdown() const; + + /** + * Opens and locks 'mongod.lock' in 'dbpath' directory. + */ + Status open(); + + /** + * Closes lock file handles. + */ + void close(); + + /** + * Writes current process ID to file. + * Fails if lock file has not been opened. + */ + Status writePid(); + + /** + * Truncates file contents and releases file locks. + */ + void clearPidAndUnlock(); + +private: + std::string _dbpath; + std::string _filespec; + bool _uncleanShutdown; + + class LockFileHandle; + std::unique_ptr<LockFileHandle> _lockFileHandle; +}; } // namespace mongo |