summaryrefslogtreecommitdiff
path: root/db/database.h
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-12-29 12:27:27 -0500
committerEliot Horowitz <eliot@10gen.com>2009-12-29 12:27:27 -0500
commit7d65d20f5aed286a418d6e9e0bcc12d8bcb75cb8 (patch)
tree16ee1f1f8f25735873ad5908555c94ae58143061 /db/database.h
parent3b37c3fbd4fa4f705540696d07f9d2ddb7904f3b (diff)
downloadmongo-7d65d20f5aed286a418d6e9e0bcc12d8bcb75cb8.tar.gz
--profile command line option SERVER-456
Diffstat (limited to 'db/database.h')
-rw-r--r--db/database.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/db/database.h b/db/database.h
index 3fd162b6158..f951081c988 100644
--- a/db/database.h
+++ b/db/database.h
@@ -18,6 +18,8 @@
#pragma once
+#include "cmdline.h"
+
/* Database represents a database database
Each database database has its own set of files -- dbname.ns, dbname.0, dbname.1, ...
*/
@@ -48,11 +50,13 @@ namespace mongo {
// If already exists, open. Otherwise behave as if empty until
// there's a write, then open.
- if ( !newDb ) {
+ if ( ! newDb || cmdLine.defaultProfile ) {
namespaceIndex.init();
if( _openAllFiles )
openAllFiles();
+
}
+
}
~Database() {
@@ -170,6 +174,8 @@ namespace mongo {
*/
bool setProfilingLevel( int newLevel , string& errmsg );
+ void finishInit();
+
vector<MongoDataFile*> files;
string name; // "alleyinsider"
string path;