summaryrefslogtreecommitdiff
path: root/src/mongo/db/storage/storage_engine_lock_file.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/storage/storage_engine_lock_file.h')
-rw-r--r--src/mongo/db/storage/storage_engine_lock_file.h110
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