diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2015-06-20 00:22:50 -0400 |
---|---|---|
committer | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2015-06-20 10:56:02 -0400 |
commit | 9c2ed42daa8fbbef4a919c21ec564e2db55e8d60 (patch) | |
tree | 3814f79c10d7b490948d8cb7b112ac1dd41ceff1 /src/mongo/db/server_options.h | |
parent | 01965cf52bce6976637ecb8f4a622aeb05ab256a (diff) | |
download | mongo-9c2ed42daa8fbbef4a919c21ec564e2db55e8d60.tar.gz |
SERVER-18579: Clang-Format - reformat code, no comment reflow
Diffstat (limited to 'src/mongo/db/server_options.h')
-rw-r--r-- | src/mongo/db/server_options.h | 214 |
1 files changed, 111 insertions, 103 deletions
diff --git a/src/mongo/db/server_options.h b/src/mongo/db/server_options.h index 46579e2484a..eb51098823c 100644 --- a/src/mongo/db/server_options.h +++ b/src/mongo/db/server_options.h @@ -29,121 +29,129 @@ #include "mongo/db/jsobj.h" #include "mongo/platform/process_id.h" -#include "mongo/util/net/listen.h" // For DEFAULT_MAX_CONN +#include "mongo/util/net/listen.h" // For DEFAULT_MAX_CONN namespace mongo { - const int DEFAULT_UNIX_PERMS = 0700; +const int DEFAULT_UNIX_PERMS = 0700; + +struct ServerGlobalParams { + ServerGlobalParams() + : port(DefaultDBPort), + rest(false), + jsonp(false), + indexBuildRetry(true), + quiet(false), + configsvr(false), + cpu(false), + objcheck(true), + defaultProfile(0), + slowMS(100), + defaultLocalThresholdMillis(15), + moveParanoia(true), + noUnixSocket(false), + doFork(0), + socket("/tmp"), + maxConns(DEFAULT_MAX_CONN), + unixSocketPermissions(DEFAULT_UNIX_PERMS), + logAppend(false), + logRenameOnRotate(true), + logWithSyslog(false), + isHttpInterfaceEnabled(false) { + started = time(0); + } + + std::string binaryName; // mongod or mongos + std::string cwd; // cwd of when process started + + int port; // --port + enum { DefaultDBPort = 27017, ConfigServerPort = 27019, ShardServerPort = 27018 }; + bool isDefaultPort() const { + return port == DefaultDBPort; + } + + std::string bind_ip; // --bind_ip + bool rest; // --rest + bool jsonp; // --jsonp + + bool indexBuildRetry; // --noIndexBuildRetry + + bool quiet; // --quiet + + bool configsvr; // --configsvr + + bool cpu; // --cpu show cpu time periodically + + bool objcheck; // --objcheck + + int defaultProfile; // --profile + int slowMS; // --time in ms that is "slow" + int defaultLocalThresholdMillis; // --localThreshold in ms to consider a node local + bool moveParanoia; // for move chunk paranoia + + bool noUnixSocket; // --nounixsocket + bool doFork; // --fork + std::string socket; // UNIX domain socket directory + + int maxConns; // Maximum number of simultaneous open connections. + + int unixSocketPermissions; // permissions for the UNIX domain socket + + std::string keyFile; // Path to keyfile, or empty if none. + std::string pidFile; // Path to pid file, or empty if none. + + std::string logpath; // Path to log file, if logging to a file; otherwise, empty. + bool logAppend; // True if logging to a file in append mode. + bool logRenameOnRotate; // True if logging should rename log files on rotate + bool logWithSyslog; // True if logging to syslog; must not be set if logpath is set. + int syslogFacility; // Facility used when appending messages to the syslog. + + bool isHttpInterfaceEnabled; // True if the dbwebserver should be enabled. - struct ServerGlobalParams { - - ServerGlobalParams() : - port(DefaultDBPort), rest(false), jsonp(false), indexBuildRetry(true), quiet(false), - configsvr(false), cpu(false), objcheck(true), defaultProfile(0), - slowMS(100), defaultLocalThresholdMillis(15), moveParanoia(true), - noUnixSocket(false), doFork(0), socket("/tmp"), maxConns(DEFAULT_MAX_CONN), - unixSocketPermissions(DEFAULT_UNIX_PERMS), logAppend(false), logRenameOnRotate(true), - logWithSyslog(false), isHttpInterfaceEnabled(false) - { - started = time(0); - } - - std::string binaryName; // mongod or mongos - std::string cwd; // cwd of when process started - - int port; // --port - enum { - DefaultDBPort = 27017, - ConfigServerPort = 27019, - ShardServerPort = 27018 - }; - bool isDefaultPort() const { return port == DefaultDBPort; } - - std::string bind_ip; // --bind_ip - bool rest; // --rest - bool jsonp; // --jsonp - - bool indexBuildRetry; // --noIndexBuildRetry - - bool quiet; // --quiet - - bool configsvr; // --configsvr - - bool cpu; // --cpu show cpu time periodically - - bool objcheck; // --objcheck - - int defaultProfile; // --profile - int slowMS; // --time in ms that is "slow" - int defaultLocalThresholdMillis; // --localThreshold in ms to consider a node local - bool moveParanoia; // for move chunk paranoia - - bool noUnixSocket; // --nounixsocket - bool doFork; // --fork - std::string socket; // UNIX domain socket directory +#ifndef _WIN32 + ProcessId parentProc; // --fork pid of initial process + ProcessId leaderProc; // --fork pid of leader process +#endif - int maxConns; // Maximum number of simultaneous open connections. + /** + * Switches to enable experimental (unsupported) features. + */ + struct ExperimentalFeatures { + ExperimentalFeatures() : indexStatsCmdEnabled(false), storageDetailsCmdEnabled(false) {} + bool indexStatsCmdEnabled; // -- enableExperimentalIndexStatsCmd + bool storageDetailsCmdEnabled; // -- enableExperimentalStorageDetailsCmd + } experimental; - int unixSocketPermissions; // permissions for the UNIX domain socket + time_t started; - std::string keyFile; // Path to keyfile, or empty if none. - std::string pidFile; // Path to pid file, or empty if none. + BSONArray argvArray; + BSONObj parsedOpts; + bool isAuthEnabled = false; + AtomicInt32 clusterAuthMode; // --clusterAuthMode, the internal cluster auth mode - std::string logpath; // Path to log file, if logging to a file; otherwise, empty. - bool logAppend; // True if logging to a file in append mode. - bool logRenameOnRotate;// True if logging should rename log files on rotate - bool logWithSyslog; // True if logging to syslog; must not be set if logpath is set. - int syslogFacility; // Facility used when appending messages to the syslog. + enum ClusterAuthModes { + ClusterAuthMode_undefined, + /** + * Authenticate using keyfile, accept only keyfiles + */ + ClusterAuthMode_keyFile, - bool isHttpInterfaceEnabled; // True if the dbwebserver should be enabled. + /** + * Authenticate using keyfile, accept both keyfiles and X.509 + */ + ClusterAuthMode_sendKeyFile, -#ifndef _WIN32 - ProcessId parentProc; // --fork pid of initial process - ProcessId leaderProc; // --fork pid of leader process -#endif + /** + * Authenticate using X.509, accept both keyfiles and X.509 + */ + ClusterAuthMode_sendX509, /** - * Switches to enable experimental (unsupported) features. - */ - struct ExperimentalFeatures { - ExperimentalFeatures() - : indexStatsCmdEnabled(false) - , storageDetailsCmdEnabled(false) - {} - bool indexStatsCmdEnabled; // -- enableExperimentalIndexStatsCmd - bool storageDetailsCmdEnabled; // -- enableExperimentalStorageDetailsCmd - } experimental; - - time_t started; - - BSONArray argvArray; - BSONObj parsedOpts; - bool isAuthEnabled = false; - AtomicInt32 clusterAuthMode; // --clusterAuthMode, the internal cluster auth mode - - enum ClusterAuthModes { - ClusterAuthMode_undefined, - /** - * Authenticate using keyfile, accept only keyfiles - */ - ClusterAuthMode_keyFile, - - /** - * Authenticate using keyfile, accept both keyfiles and X.509 - */ - ClusterAuthMode_sendKeyFile, - - /** - * Authenticate using X.509, accept both keyfiles and X.509 - */ - ClusterAuthMode_sendX509, - - /** - * Authenticate using X.509, accept only X.509 - */ - ClusterAuthMode_x509 - }; + * Authenticate using X.509, accept only X.509 + */ + ClusterAuthMode_x509 }; +}; - extern ServerGlobalParams serverGlobalParams; +extern ServerGlobalParams serverGlobalParams; } |