diff options
author | Shaun Verch <shaun.verch@10gen.com> | 2013-09-18 14:02:36 -0400 |
---|---|---|
committer | Shaun Verch <shaun.verch@10gen.com> | 2013-10-04 16:58:54 -0400 |
commit | 6fc951d492881a32754bc3e38e8b5eca78929197 (patch) | |
tree | 73c2afe3120a8a87cf3bc8379e53461b2cf05b1e /src/mongo/db/commands/parameters.cpp | |
parent | 99372153dfe9dd9251e49371d872b5f27dfd6f2c (diff) | |
download | mongo-6fc951d492881a32754bc3e38e8b5eca78929197.tar.gz |
SERVER-8510 Get rid of CmdLine struct and use new option handling style
Diffstat (limited to 'src/mongo/db/commands/parameters.cpp')
-rw-r--r-- | src/mongo/db/commands/parameters.cpp | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/src/mongo/db/commands/parameters.cpp b/src/mongo/db/commands/parameters.cpp index 8341d758167..1e860659ff3 100644 --- a/src/mongo/db/commands/parameters.cpp +++ b/src/mongo/db/commands/parameters.cpp @@ -33,8 +33,8 @@ #include "mongo/client/dbclient_rs.h" #include "mongo/db/auth/authorization_manager.h" #include "mongo/db/commands.h" -#include "mongo/db/cmdline.h" #include "mongo/db/server_parameters.h" +#include "mongo/db/storage_options.h" #include "mongo/util/mongoutils/str.h" namespace mongo { @@ -75,9 +75,10 @@ namespace mongo { // TODO: convert to ServerParameters -- SERVER-10515 - if( cmdLine.dur && (all || cmdObj.hasElement("journalCommitInterval")) ) { + if (isJournalingEnabled() && (all || cmdObj.hasElement("journalCommitInterval")) && + !isMongos()) { result.append("journalCommitInterval", - cmdLine.journalCommitInterval); + getJournalCommitInterval()); } if( all || cmdObj.hasElement( "traceExceptions" ) ) { result.append("traceExceptions", @@ -128,13 +129,17 @@ namespace mongo { // TODO: convert to ServerParameters -- SERVER-10515 if( cmdObj.hasElement("journalCommitInterval") ) { - if( !cmdLine.dur ) { + if (isMongos()) { + errmsg = "cannot set journalCommitInterval on a mongos"; + return false; + } + if(!isJournalingEnabled()) { errmsg = "journaling is off"; return false; } int x = (int) cmdObj["journalCommitInterval"].Number(); verify( x > 1 && x < 500 ); - cmdLine.journalCommitInterval = x; + setJournalCommitInterval(x); log() << "setParameter journalCommitInterval=" << x << endl; s++; } @@ -226,23 +231,11 @@ namespace mongo { } } logLevelSetting; - ExportedServerParameter<bool> NoTableScanSetting( ServerParameterSet::getGlobal(), - "notablescan", - &cmdLine.noTableScan, - true, - true ); - ExportedServerParameter<bool> QuietSetting( ServerParameterSet::getGlobal(), "quiet", - &cmdLine.quiet, + &serverGlobalParams.quiet, true, true ); - - ExportedServerParameter<double> SyncdelaySetting( ServerParameterSet::getGlobal(), - "syncdelay", - &cmdLine.syncdelay, - true, - true ); } } |