MXS-2304 Use get_integer() instead of config_get_integer()

This commit is contained in:
Esa Korhonen
2019-01-30 18:14:18 +02:00
parent 63b5eab89e
commit c8a84cebd0
20 changed files with 70 additions and 81 deletions

View File

@ -135,9 +135,9 @@ Avro::Avro(SERVICE* service, MXS_CONFIG_PARAMETER* params, SERVICE* source, SRow
, current_pos(4)
, binlog_fd(-1)
, trx_count(0)
, trx_target(config_get_integer(params, "group_trx"))
, trx_target(params->get_integer("group_trx"))
, row_count(0)
, row_target(config_get_integer(params, "group_rows"))
, row_target(params->get_integer("group_rows"))
, task_handle(0)
, handler(service, handler, config_get_compiled_regex(params, "match", 0, NULL),
config_get_compiled_regex(params, "exclude", 0, NULL))
@ -152,7 +152,7 @@ Avro::Avro(SERVICE* service, MXS_CONFIG_PARAMETER* params, SERVICE* source, SRow
sizeof(filename),
BINLOG_NAMEFMT,
filestem.c_str(),
config_get_integer(params, "start_index"));
static_cast<int>(params->get_integer("start_index")));
binlog_name = filename;
MXS_NOTICE("Reading MySQL binlog files from %s", binlogdir.c_str());

View File

@ -339,29 +339,29 @@ static MXS_ROUTER* createInstance(SERVICE* service, MXS_CONFIG_PARAMETER* params
strcpy(inst->binlog_name, "");
strcpy(inst->prevbinlog, "");
inst->initbinlog = config_get_integer(params, "file");
inst->initbinlog = params->get_integer("file");
inst->short_burst = config_get_integer(params, "shortburst");
inst->long_burst = config_get_integer(params, "longburst");
inst->short_burst = params->get_integer("shortburst");
inst->long_burst = params->get_integer("longburst");
inst->burst_size = config_get_size(params, "burstsize");
inst->binlogdir = config_copy_string(params, "binlogdir");
inst->heartbeat = config_get_integer(params, "heartbeat");
inst->retry_interval = config_get_integer(params, "connect_retry");
inst->retry_limit = config_get_integer(params, "master_retry_count");
inst->ssl_cert_verification_depth = config_get_integer(params, "ssl_cert_verification_depth");
inst->heartbeat = params->get_integer("heartbeat");
inst->retry_interval = params->get_integer("connect_retry");
inst->retry_limit = params->get_integer("master_retry_count");
inst->ssl_cert_verification_depth = params->get_integer("ssl_cert_verification_depth");
inst->mariadb10_compat = config_get_bool(params, "mariadb10-compatibility");
inst->maxwell_compat = config_get_bool(params, "maxwell-compatibility");
inst->trx_safe = config_get_bool(params, "transaction_safety");
inst->fileroot = config_copy_string(params, "filestem");
/* Server id */
inst->serverid = config_get_integer(params, "server_id");
inst->serverid = params->get_integer("server_id");
/* Identity options */
inst->set_master_version = config_copy_string(params, "master_version");
inst->set_master_hostname = config_copy_string(params, "master_hostname");
inst->set_slave_hostname = config_copy_string(params, "slave_hostname");
inst->masterid = config_get_integer(params, "master_id");
inst->masterid = params->get_integer("master_id");
inst->set_master_server_id = inst->masterid != 0;
inst->master_uuid = config_copy_string(params, "master_uuid");
inst->set_master_uuid = inst->master_uuid != NULL;

View File

@ -64,7 +64,7 @@ HintRouter* HintRouter::create(SERVICE* pService, MXS_CONFIG_PARAMETER* params)
DEFAULT_ACTION,
default_action_values);
string default_server(config_get_string(params, DEFAULT_SERVER));
int max_slaves = config_get_integer(params, MAX_SLAVES);
int max_slaves = params->get_integer(MAX_SLAVES);
return new HintRouter(pService, default_action, default_server, max_slaves);
}

View File

@ -143,21 +143,21 @@ struct Config
, master_failure_mode(
(enum failure_mode)config_get_enum(
params, "master_failure_mode", master_failure_mode_values))
, max_sescmd_history(config_get_integer(params, "max_sescmd_history"))
, max_sescmd_history(params->get_integer("max_sescmd_history"))
, disable_sescmd_history(config_get_bool(params, "disable_sescmd_history"))
, master_accept_reads(config_get_bool(params, "master_accept_reads"))
, strict_multi_stmt(config_get_bool(params, "strict_multi_stmt"))
, strict_sp_calls(config_get_bool(params, "strict_sp_calls"))
, retry_failed_reads(config_get_bool(params, "retry_failed_reads"))
, connection_keepalive(config_get_integer(params, "connection_keepalive"))
, max_slave_replication_lag(config_get_integer(params, "max_slave_replication_lag"))
, connection_keepalive(params->get_integer("connection_keepalive"))
, max_slave_replication_lag(params->get_integer("max_slave_replication_lag"))
, rw_max_slave_conn_percent(0)
, max_slave_connections(0)
, causal_reads(config_get_bool(params, "causal_reads"))
, causal_reads_timeout(config_get_string(params, "causal_reads_timeout"))
, master_reconnection(config_get_bool(params, "master_reconnection"))
, delayed_retry(config_get_bool(params, "delayed_retry"))
, delayed_retry_timeout(config_get_integer(params, "delayed_retry_timeout"))
, delayed_retry_timeout(params->get_integer("delayed_retry_timeout"))
, transaction_replay(config_get_bool(params, "transaction_replay"))
, trx_max_size(config_get_size(params, "transaction_replay_max_size"))
, optimistic_trx(config_get_bool(params, "optimistic_trx"))

View File

@ -19,7 +19,7 @@ namespace schemarouter
{
Config::Config(MXS_CONFIG_PARAMETER* conf)
: refresh_min_interval(config_get_integer(conf, "refresh_interval"))
: refresh_min_interval(conf->get_integer("refresh_interval"))
, refresh_databases(config_get_bool(conf, "refresh_databases"))
, debug(config_get_bool(conf, "debug"))
, ignore_regex(config_get_compiled_regex(conf, "ignore_databases_regex", 0, NULL))