diff options
-rw-r--r-- | src/mongo/SConscript | 6 | ||||
-rw-r--r-- | src/mongo/s/mongos_options.cpp | 45 | ||||
-rw-r--r-- | src/mongo/s/mongos_options.idl | 77 |
3 files changed, 82 insertions, 46 deletions
diff --git a/src/mongo/SConscript b/src/mongo/SConscript index ea7cb46d148..6166b43f294 100644 --- a/src/mongo/SConscript +++ b/src/mongo/SConscript @@ -476,6 +476,7 @@ mongos = env.Program( 's/cluster_cursor_stats.cpp', 's/mongos_options.cpp', 's/mongos_options_init.cpp', + env.Idlc('s/mongos_options.idl')[0], 's/s_sharding_server_status.cpp', 's/server.cpp', 's/service_entry_point_mongos.cpp', @@ -511,9 +512,12 @@ mongos = env.Program( 'util/fail_point', 'util/net/ssl_options_server' if get_option('ssl') == 'on' else '', 'util/ntservice', - 'util/options_parser/options_parser_init', 'util/version_impl', ], + LIBDEPS_PRIVATE=[ + 'util/options_parser/options_parser_init', + 'util/options_parser/options_parser', + ], INSTALL_ALIAS=[ 'servers', ], diff --git a/src/mongo/s/mongos_options.cpp b/src/mongo/s/mongos_options.cpp index 4a5b02b8d1e..d900b3e5cc6 100644 --- a/src/mongo/s/mongos_options.cpp +++ b/src/mongo/s/mongos_options.cpp @@ -73,52 +73,12 @@ Status addMongosOptions(moe::OptionSection* options) { } #endif - moe::OptionSection sharding_options("Sharding options"); - - sharding_options.addOptionChaining("sharding.configDB", - "configdb", - moe::String, - "Connection string for communicating with config servers:\n" - "<config replset name>/<host1:port>,<host2:port>,[...]"); - - sharding_options.addOptionChaining( - "replication.localPingThresholdMs", - "localThreshold", - moe::Int, - "ping time (in ms) for a node to be considered local (default 15ms)"); - - sharding_options.addOptionChaining("test", "test", moe::Switch, "just run unit tests") - .setSources(moe::SourceAllLegacy); - - /** Javascript Options - * As a general rule, js enable/disable options are ignored for mongos. - * However, we define and hide these options so that if someone - * were to use these args in a set of options meant for both - * mongos and mongod runs, the mongos won't fail on an unknown argument. - * - * These options have no affect on how the mongos runs. - * Setting either or both to *any* value will provoke a warning message - * and nothing more. - */ - sharding_options - .addOptionChaining("noscripting", "noscripting", moe::Switch, "disable scripting engine") - .hidden() - .setSources(moe::SourceAllLegacy); - - general_options - .addOptionChaining( - "security.javascriptEnabled", "", moe::Bool, "Enable javascript execution") - .hidden() - .setSources(moe::SourceYAMLConfig); - options->addSection(general_options).transitional_ignore(); #if defined(_WIN32) options->addSection(windows_scm_options).transitional_ignore(); #endif - options->addSection(sharding_options).transitional_ignore(); - return Status::OK(); } @@ -177,11 +137,6 @@ Status storeMongosOptions(const moe::Environment& params) { } } - if (params.count("replication.localPingThresholdMs")) { - serverGlobalParams.defaultLocalThresholdMillis = - params["replication.localPingThresholdMs"].as<int>(); - } - if (params.count("noscripting") || params.count("security.javascriptEnabled")) { warning() << "The Javascript enabled/disabled options are not supported for mongos. " "(\"noscripting\" and/or \"security.javascriptEnabled\" are set.)"; diff --git a/src/mongo/s/mongos_options.idl b/src/mongo/s/mongos_options.idl new file mode 100644 index 00000000000..f92d2474fad --- /dev/null +++ b/src/mongo/s/mongos_options.idl @@ -0,0 +1,77 @@ + +# Copyright (C) 2019-present MongoDB, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the Server Side Public License, version 1, +# as published by MongoDB, Inc. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# Server Side Public License for more details. +# +# You should have received a copy of the Server Side Public License +# along with this program. If not, see +# <http://www.mongodb.com/licensing/server-side-public-license>. +# +# As a special exception, the copyright holders give permission to link the +# code of portions of this program with the OpenSSL library under certain +# conditions as described in each individual source file and distribute +# linked combinations including the program with the OpenSSL library. You +# must comply with the Server Side Public License in all respects for +# all of the code used other than as permitted herein. If you modify file(s) +# with this exception, you may extend this exception to your version of the +# file(s), but you are not obligated to do so. If you do not wish to do so, +# delete this exception statement from your version. If you delete this +# exception statement from all source files in the program, then also delete +# it in the license file. +# + +global: + cpp_namespace: "mongo" + cpp_includes: + - "mongo/s/mongos_options.h" + configs: + section: "Sharding options" + source: [ yaml, cli, ini ] + +configs: + "sharding.configDB": + description: >- + Connection string for communicating with config servers: + <config replset name>/<host1:port>,<host2:port>,[...] + short_name: configdb + arg_vartype: String + "replication.localPingThresholdMs": + description: "ping time (in ms) for a node to be considered local (default 15ms)" + short_name: "localThreshold" + cpp_varname: "serverGlobalParams.defaultLocalThresholdMillis" + arg_vartype: Int + "test": + description: "just run unit tests" + short_name: "test" + arg_vartype: Switch + source: [ cli, ini ] +# +# Javascript Options +# As a general rule, js enable/disable options are ignored for mongos. +# However, we define and hide these options so that if someone +# were to use these args in a set of options meant for both +# mongos and mongod runs, the mongos won't fail on an unknown argument. +# +# These options have no affect on how the mongos runs. +# Setting either or both to *any* value will provoke a warning message +# and nothing more. +# + "security.javascriptEnabled": + section: "General options" + description: "Enable javascript execution" + arg_vartype: Bool + source: [ yaml ] + hidden: true + "noscripting": + description: "disable scripting engine" + short_name: "noscripting" + arg_vartype: Switch + source: [ cli, ini ] + hidden: true |