MXS-2304 Store config parameter container as value in monitor and service

This commit is contained in:
Esa Korhonen
2019-02-19 19:29:13 +02:00
parent 3fa4a85a1e
commit 2a63fb0776
15 changed files with 42 additions and 48 deletions

View File

@ -64,7 +64,7 @@ bool MariaDBMonitor::manual_switchover(SERVER* promotion_server, SERVER* demotio
{
string msg = string_printf(SWITCHOVER_FAIL,
op->demotion.target->name(), op->promotion.target->name());
bool failover_setting = parameters->get_bool(CN_AUTO_FAILOVER);
bool failover_setting = parameters.get_bool(CN_AUTO_FAILOVER);
if (failover_setting)
{
disable_setting(CN_AUTO_FAILOVER);

View File

@ -698,7 +698,7 @@ void MariaDBMonitor::assign_new_master(MariaDBServer* new_master)
*/
void MariaDBMonitor::disable_setting(const std::string& setting)
{
parameters->set(setting, "false");
parameters.set(setting, "false");
}
/**

View File

@ -61,12 +61,12 @@ using namespace maxscale;
*/
void Avro::read_source_service_options(SERVICE* source)
{
MXS_CONFIG_PARAMETER* params = source->svc_config_param;
binlogdir = params->get_string("binlogdir");
filestem = params->get_string("filestem");
MXS_CONFIG_PARAMETER& params = source->svc_config_param;
binlogdir = params.get_string("binlogdir");
filestem = params.get_string("filestem");
mxb_assert(!binlogdir.empty() && !filestem.empty());
for (const auto& opt : mxs::strtok(params->get_string("router_options"), ", \t"))
for (const auto& opt : mxs::strtok(params.get_string("router_options"), ", \t"))
{
auto kv = mxs::strtok(opt, "=");
@ -85,7 +85,7 @@ void Avro::read_source_service_options(SERVICE* source)
Avro* Avro::create(SERVICE* service, SRowEventHandler handler)
{
SERVICE* source_service = NULL;
std::string source_name = service->svc_config_param->get_string("source");
std::string source_name = service->svc_config_param.get_string("source");
if (!source_name.empty())
{
@ -115,7 +115,7 @@ Avro* Avro::create(SERVICE* service, SRowEventHandler handler)
}
}
return new(std::nothrow) Avro(service, service->svc_config_param, source_service, handler);
return new(std::nothrow) Avro(service, &service->svc_config_param, source_service, handler);
}
Avro::Avro(SERVICE* service, MXS_CONFIG_PARAMETER* params, SERVICE* source, SRowEventHandler handler)

View File

@ -60,10 +60,10 @@ static bool conversion_task_ctl(Avro* inst, bool start);
*/
MXS_ROUTER* createInstance(SERVICE* service, MXS_CONFIG_PARAMETER* params)
{
uint64_t block_size = service->svc_config_param->get_size("block_size");
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 = service->svc_config_param->get_string("avrodir");
service->svc_config_param.get_enum("codec", codec_values));
std::string avrodir = service->svc_config_param.get_string("avrodir");
SRowEventHandler handler(new AvroConverter(avrodir, block_size, codec));
Avro* router = Avro::create(service, handler);

View File

@ -2727,7 +2727,7 @@ static void shutdown_monitor(DCB* dcb, Monitor* monitor)
*/
static void restart_monitor(DCB* dcb, Monitor* monitor)
{
MonitorManager::monitor_start(monitor, monitor->parameters);
MonitorManager::monitor_start(monitor, &monitor->parameters);
}
/**

View File

@ -615,7 +615,7 @@ void exec_restart_monitor(DCB* dcb, MAXINFO_TREE* tree)
Monitor* monitor = monitor_find(tree->value);
if (monitor)
{
MonitorManager::monitor_start(monitor, monitor->parameters);
MonitorManager::monitor_start(monitor, &monitor->parameters);
maxinfo_send_ok(dcb);
}
else