From 19013c4049d2dc018128c5bf2e63781fb5499b0e Mon Sep 17 00:00:00 2001 From: Shaun Verch Date: Sat, 17 Aug 2013 16:11:06 -0400 Subject: SERVER-8510 Remove all uses of boost direct storage and remove custom boost modifications --- src/mongo/db/cmdline.cpp | 69 +++++++++++++++++++++++++++++++++++++++--------- src/mongo/db/db.cpp | 11 ++++++-- 2 files changed, 65 insertions(+), 15 deletions(-) (limited to 'src/mongo/db') diff --git a/src/mongo/db/cmdline.cpp b/src/mongo/db/cmdline.cpp index 40db88584de..16e89d4c861 100644 --- a/src/mongo/db/cmdline.cpp +++ b/src/mongo/db/cmdline.cpp @@ -85,8 +85,8 @@ namespace { ("config,f", po::value(), "configuration file specifying additional options") ("verbose,v", "be more verbose (include multiple times for more verbosity e.g. -vvvvv)") ("quiet", "quieter output") - ("port", po::value(&cmdLine.port), portInfoBuilder.str().c_str()) - ("bind_ip", po::value(&cmdLine.bind_ip), "comma separated list of ip addresses to listen on - all local ips by default") + ("port", po::value(), portInfoBuilder.str().c_str()) + ("bind_ip", po::value(), "comma separated list of ip addresses to listen on - all local ips by default") ("maxConns",po::value(), maxConnInfoBuilder.str().c_str()) ("logpath", po::value() , "log file to send write to instead of stdout - has to be a file, not directory" ) ("logappend" , "append to logpath instead of over-writing" ) @@ -97,7 +97,7 @@ namespace { ("setParameter", po::value< std::vector >()->composing(), "Set a configurable parameter") ("httpinterface", "enable http interface") - ("clusterAuthMode", po::value(&cmdLine.clusterAuthMode), + ("clusterAuthMode", po::value(), "Authentication mode used for cluster authentication." " Alternatives are (keyfile|sendKeyfile|sendX509|x509)") #ifndef _WIN32 @@ -112,15 +112,16 @@ namespace { #ifdef MONGO_SSL ssl_options.add_options() ("sslOnNormalPorts" , "use ssl on configured ports" ) - ("sslPEMKeyFile" , po::value(&cmdLine.sslPEMKeyFile), "PEM file for ssl" ) - ("sslPEMKeyPassword" , new PasswordValue(&cmdLine.sslPEMKeyPassword) , "PEM file password" ) - ("sslClusterFile", po::value(&cmdLine.sslClusterFile), + ("sslPEMKeyFile" , po::value(), "PEM file for ssl" ) + ("sslPEMKeyPassword" , po::value()->implicit_value(""), + "PEM file password" ) + ("sslClusterFile", po::value(), "Key file for internal SSL authentication" ) - ("sslClusterPassword", new PasswordValue(&cmdLine.sslClusterPassword), + ("sslClusterPassword", po::value()->implicit_value(""), "Internal authentication key file password" ) - ("sslCAFile", po::value(&cmdLine.sslCAFile), + ("sslCAFile", po::value(), "Certificate Authority file for SSL") - ("sslCRLFile", po::value(&cmdLine.sslCRLFile), + ("sslCRLFile", po::value(), "Certificate Revocation List file for SSL") ("sslWeakCertificateValidation", "allow client to connect without presenting a certificate") ("sslFIPSMode", "activate FIPS 140-2 mode at startup") @@ -133,9 +134,9 @@ namespace { ("objcheck", "inspect client data for validity on receipt (DEFAULT)") ("noobjcheck", "do NOT inspect client data for validity on receipt") ("traceExceptions", "log stack traces for every exception") - ("enableExperimentalIndexStatsCmd", po::bool_switch(&cmdLine.experimental.indexStatsCmdEnabled), + ("enableExperimentalIndexStatsCmd", po::bool_switch(), "EXPERIMENTAL (UNSUPPORTED). Enable command computing aggregate statistics on indexes.") - ("enableExperimentalStorageDetailsCmd", po::bool_switch(&cmdLine.experimental.storageDetailsCmdEnabled), + ("enableExperimentalStorageDetailsCmd", po::bool_switch(), "EXPERIMENTAL (UNSUPPORTED). Enable command computing aggregate statistics on storage.") ; } @@ -254,8 +255,6 @@ namespace { po::store( po::parse_config_file( ss , all ) , params ); f.close(); } - - po::notify(params); } catch (po::error &e) { cout << "error command line: " << e.what() << endl; @@ -326,6 +325,25 @@ namespace { } } + if (params.count("enableExperimentalIndexStatsCmd")) { + cmdLine.experimental.indexStatsCmdEnabled = true; + } + if (params.count("enableExperimentalStorageDetailsCmd")) { + cmdLine.experimental.storageDetailsCmdEnabled = true; + } + + if (params.count("port")) { + cmdLine.port = params["port"].as(); + } + + if (params.count("bind_ip")) { + cmdLine.bind_ip = params["bind_ip"].as(); + } + + if (params.count("clusterAuthMode")) { + cmdLine.clusterAuthMode = params["clusterAuthMode"].as(); + } + if (params.count("quiet")) { cmdLine.quiet = true; } @@ -458,6 +476,31 @@ namespace { } #ifdef MONGO_SSL + + if (params.count("sslPEMKeyFile")) { + cmdLine.sslPEMKeyFile = params["sslPEMKeyFile"].as(); + } + + if (params.count("sslPEMKeyPassword")) { + cmdLine.sslPEMKeyPassword = params["sslPEMKeyPassword"].as(); + } + + if (params.count("sslClusterFile")) { + cmdLine.sslClusterFile = params["sslClusterFile"].as(); + } + + if (params.count("sslClusterPassword")) { + cmdLine.sslClusterPassword = params["sslClusterPassword"].as(); + } + + if (params.count("sslCAFile")) { + cmdLine.sslCAFile = params["sslCAFile"].as(); + } + + if (params.count("sslCRLFile")) { + cmdLine.sslCRLFile = params["sslCRLFile"].as(); + } + if (params.count("sslWeakCertificateValidation")) { cmdLine.sslWeakCertificateValidation = true; } diff --git a/src/mongo/db/db.cpp b/src/mongo/db/db.cpp index 938ac920e9c..b3f11d5b7dc 100644 --- a/src/mongo/db/db.cpp +++ b/src/mongo/db/db.cpp @@ -860,9 +860,9 @@ static void buildOptionsDescriptions(po::options_description *pVisible, #if defined(__linux__) ("shutdown", "kill a running server (for init scripts)") #endif - ("slowms",po::value(&cmdLine.slowMS)->default_value(100), "value of slow for profile and console log" ) + ("slowms",po::value()->default_value(100), "value of slow for profile and console log" ) ("smallfiles", "use a smaller default file size") - ("syncdelay",po::value(&cmdLine.syncdelay)->default_value(60), "seconds between disk syncs (0=never, but not recommended)") + ("syncdelay",po::value()->default_value(60), "seconds between disk syncs (0=never, but not recommended)") ("sysinfo", "print some diagnostic system information") ("upgrade", "upgrade db if needed") ; @@ -979,6 +979,13 @@ static void processCommandLineOptions(const std::vector& argv) { dbpath = dbpath.erase(dbpath.size()-1); } #endif + if ( params.count("slowms")) { + cmdLine.slowMS = params["slowms"].as(); + } + + if ( params.count("syncdelay")) { + cmdLine.syncdelay = params["syncdelay"].as(); + } if ( params.count("directoryperdb")) { directoryperdb = true; -- cgit v1.2.1