From dc23736d0c5d43d551663b34e99648092286dcaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Botond=20D=C3=A9nes?= Date: Mon, 27 Jul 2020 15:35:00 +0300 Subject: [PATCH] db/config: replace ad-hoc aliases with alias mechanism We already uses aliases for some configuration items, although these are created with an ad-hoc mechanism that only registers them on the command line. Replace this with the built-in alias mechanism in the previous patch, which has the benefit of conflict resolution and also working with YAML. --- db/config.cc | 17 +++-------------- db/config.hh | 3 --- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/db/config.cc b/db/config.cc index b3af507875..6c1bfcde4e 100644 --- a/db/config.cc +++ b/db/config.cc @@ -224,7 +224,7 @@ db::config::config(std::shared_ptr exts) "The directory in which Scylla will put all its subdirectories. The location of individual subdirs can be overriden by the respective *_directory options.") , commitlog_directory(this, "commitlog_directory", value_status::Used, "", "The directory where the commit log is stored. For optimal write performance, it is recommended the commit log be on a separate disk partition (ideally, a separate physical device) from the data file directories.") - , data_file_directories(this, "data_file_directories", value_status::Used, { }, + , data_file_directories(this, "data_file_directories", "datadir", value_status::Used, { }, "The directory location where table data (SSTables) is stored") , hints_directory(this, "hints_directory", value_status::Used, "", "The directory where hints files are stored if hinted handoff is enabled.") @@ -517,7 +517,7 @@ db::config::config(std::shared_ptr exts) /* Native transport (CQL Binary Protocol) */ , start_native_transport(this, "start_native_transport", value_status::Used, true, "Enable or disable the native transport server. Uses the same address as the rpc_address, but the port is different from the rpc_port. See native_transport_port.") - , native_transport_port(this, "native_transport_port", value_status::Used, 9042, + , native_transport_port(this, "native_transport_port", "cql_port", value_status::Used, 9042, "Port on which the CQL native transport listens for clients.") , native_transport_port_ssl(this, "native_transport_port_ssl", value_status::Used, 9142, "Port on which the CQL TLS native transport listens for clients." @@ -536,7 +536,7 @@ db::config::config(std::shared_ptr exts) /* Settings for configuring and tuning client connections. */ , broadcast_rpc_address(this, "broadcast_rpc_address", value_status::Used, {/* unset */}, "RPC address to broadcast to drivers and other Scylla nodes. This cannot be set to 0.0.0.0. If blank, it is set to the value of the rpc_address or rpc_interface. If rpc_address or rpc_interfaceis set to 0.0.0.0, this property must be set.\n") - , rpc_port(this, "rpc_port", value_status::Used, 9160, + , rpc_port(this, "rpc_port", "thrift_port", value_status::Used, 9160, "Thrift port for client connections.") , start_rpc(this, "start_rpc", value_status::Used, true, "Starts the Thrift RPC server") @@ -830,17 +830,6 @@ void config_file::named_value::add_command_line_ } -boost::program_options::options_description_easy_init& -db::config::add_options(boost::program_options::options_description_easy_init& init) { - config_file::add_options(init); - - data_file_directories.add_command_line_option(init, "datadir", "alias for 'data-file-directories'"); - rpc_port.add_command_line_option(init, "thrift-port", "alias for 'rpc-port'"); - native_transport_port.add_command_line_option(init, "cql-port", "alias for 'native-transport-port'"); - - return init; -} - db::fs::path db::config::get_conf_dir() { using namespace db::fs; diff --git a/db/config.hh b/db/config.hh index d85d61ed68..86bb1d1bf6 100644 --- a/db/config.hh +++ b/db/config.hh @@ -329,9 +329,6 @@ public: seastar::logging_settings logging_settings(const boost::program_options::variables_map&) const; - boost::program_options::options_description_easy_init& - add_options(boost::program_options::options_description_easy_init&); - const db::extensions& extensions() const; static const sstring default_tls_priority;