MXS-2304 Config string handling cleanup
Using correct functions in most cases.
This commit is contained in:
@ -75,7 +75,7 @@ void Avro::read_source_service_options(SERVICE* source)
|
||||
}
|
||||
}
|
||||
|
||||
for (const auto& opt : mxs::strtok(config_get_string(params, "router_options"), ", \t"))
|
||||
for (const auto& opt : mxs::strtok(params->get_string("router_options"), ", \t"))
|
||||
{
|
||||
auto kv = mxs::strtok(opt, "=");
|
||||
|
||||
@ -129,9 +129,9 @@ Avro* Avro::create(SERVICE* service, SRowEventHandler handler)
|
||||
|
||||
Avro::Avro(SERVICE* service, MXS_CONFIG_PARAMETER* params, SERVICE* source, SRowEventHandler handler)
|
||||
: service(service)
|
||||
, filestem(config_get_string(params, "filestem"))
|
||||
, binlogdir(config_get_string(params, "binlogdir"))
|
||||
, avrodir(config_get_string(params, "avrodir"))
|
||||
, filestem(params->get_string("filestem"))
|
||||
, binlogdir(params->get_string("binlogdir"))
|
||||
, avrodir(params->get_string("avrodir"))
|
||||
, current_pos(4)
|
||||
, binlog_fd(-1)
|
||||
, trx_count(0)
|
||||
|
@ -63,7 +63,7 @@ MXS_ROUTER* createInstance(SERVICE* service, MXS_CONFIG_PARAMETER* params)
|
||||
uint64_t block_size = service->svc_config_param->get_size("block_size");
|
||||
mxs_avro_codec_type codec = static_cast<mxs_avro_codec_type>(
|
||||
service->svc_config_param->get_enum("codec", codec_values));
|
||||
std::string avrodir = config_get_string(service->svc_config_param, "avrodir");
|
||||
std::string avrodir = service->svc_config_param->get_string("avrodir");
|
||||
SRowEventHandler handler(new AvroConverter(avrodir, block_size, codec));
|
||||
|
||||
Avro* router = Avro::create(service, handler);
|
||||
|
@ -430,7 +430,7 @@ static MXS_ROUTER* createInstance(SERVICE* service, MXS_CONFIG_PARAMETER* params
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<std::string> options = mxs::strtok(config_get_string(params, "router_options"), ", \t");
|
||||
std::vector<std::string> options = mxs::strtok(params->get_string("router_options"), ", \t");
|
||||
|
||||
/*
|
||||
* Process the options.
|
||||
|
@ -61,7 +61,7 @@ HintRouter* HintRouter::create(SERVICE* pService, MXS_CONFIG_PARAMETER* params)
|
||||
HR_ENTRY();
|
||||
|
||||
HINT_TYPE default_action = (HINT_TYPE)params->get_enum(DEFAULT_ACTION, default_action_values);
|
||||
string default_server(config_get_string(params, DEFAULT_SERVER));
|
||||
string default_server = params->get_string(DEFAULT_SERVER);
|
||||
int max_slaves = params->get_integer(MAX_SLAVES);
|
||||
return new HintRouter(pService, default_action, default_server, max_slaves);
|
||||
}
|
||||
|
@ -104,7 +104,7 @@ bool RCR::configure(MXS_CONFIG_PARAMETER* params)
|
||||
uint64_t bitvalue = 0;
|
||||
bool ok = true;
|
||||
|
||||
for (const auto& opt : mxs::strtok(config_get_string(params, "router_options"), ", \t"))
|
||||
for (const auto& opt : mxs::strtok(params->get_string("router_options"), ", \t"))
|
||||
{
|
||||
if (!strcasecmp(opt.c_str(), "master"))
|
||||
{
|
||||
|
@ -152,7 +152,7 @@ struct Config
|
||||
, rw_max_slave_conn_percent(0)
|
||||
, max_slave_connections(0)
|
||||
, causal_reads(params->get_bool("causal_reads"))
|
||||
, causal_reads_timeout(config_get_string(params, "causal_reads_timeout"))
|
||||
, causal_reads_timeout(params->get_string("causal_reads_timeout"))
|
||||
, master_reconnection(params->get_bool("master_reconnection"))
|
||||
, delayed_retry(params->get_bool("delayed_retry"))
|
||||
, delayed_retry_timeout(params->get_integer("delayed_retry_timeout"))
|
||||
|
Reference in New Issue
Block a user