diff options
author | Dwight <dwight@10gen.com> | 2010-12-13 14:53:49 -0500 |
---|---|---|
committer | Dwight <dwight@10gen.com> | 2010-12-13 14:53:49 -0500 |
commit | 4a437cc8b861ca7f02fd6f93ad03dd149ba7bc26 (patch) | |
tree | a047d36c0ca1099c1f371f26902c4862d5feb09a /db/dur.h | |
parent | fd899470c165374afbe05548b4ad5760e086ccc9 (diff) | |
download | mongo-4a437cc8b861ca7f02fd6f93ad03dd149ba7bc26.tar.gz |
commitNow()
Diffstat (limited to 'db/dur.h')
-rw-r--r-- | db/dur.h | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -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 |