summaryrefslogtreecommitdiff
path: root/db/dur.h
diff options
context:
space:
mode:
authorDwight <dwight@10gen.com>2010-12-13 14:53:49 -0500
committerDwight <dwight@10gen.com>2010-12-13 14:53:49 -0500
commit4a437cc8b861ca7f02fd6f93ad03dd149ba7bc26 (patch)
treea047d36c0ca1099c1f371f26902c4862d5feb09a /db/dur.h
parentfd899470c165374afbe05548b4ad5760e086ccc9 (diff)
downloadmongo-4a437cc8b861ca7f02fd6f93ad03dd149ba7bc26.tar.gz
commitNow()
Diffstat (limited to 'db/dur.h')
-rw-r--r--db/dur.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/db/dur.h b/db/dur.h
index bef65e68734..f089b79c27a 100644
--- a/db/dur.h
+++ b/db/dur.h
@@ -24,6 +24,21 @@ namespace mongo {
*/
virtual bool awaitCommit() = 0;
+ /** Commit immediately.
+
+ Generally, you do not want to do this often, as highly granular committing may affect
+ performance.
+
+ Does not return until the commit is complete.
+
+ You must be at least read locked when you call this. Ideally, you are not write locked
+ and then read operations can occur concurrently.
+
+ @return true if --dur is on.
+ @return false if --dur is off. (in which case there is action)
+ */
+ virtual bool commitNow() = 0;
+
/** Declare that a file has been created
Normally writes are applied only after journalling, for safety. But here the file
is created first, and the journal will just replay the creation if the create didn't
@@ -132,6 +147,7 @@ namespace mongo {
void createdFile(string filename, unsigned long long len) { }
void droppingDb(string db) { }
bool awaitCommit() { return false; }
+ bool commitNow() { return false; }
#if defined(_DEBUG)
void debugCheckLastDeclaredWrite() {}
#endif
@@ -146,6 +162,7 @@ namespace mongo {
void createdFile(string filename, unsigned long long len);
void droppingDb(string db);
bool awaitCommit();
+ bool commitNow();
#if defined(_DEBUG)
void debugCheckLastDeclaredWrite();
#endif