Remove router_options

Relaced router_options with configuration parameters in the createInstance
router entry point. The same needs to be done for the filter API as barely
any filters use the feature.

Some routers (binlogrouter) still support router_options but using it is
deprecated. This had to be done as their use wasn't deprecated in 2.2.
This commit is contained in:
Markus Mäkelä
2018-07-10 05:42:01 +03:00
parent f11f8980b2
commit cbb8c68770
24 changed files with 49 additions and 216 deletions

View File

@ -62,7 +62,6 @@ using namespace maxscale;
*/
void Avro::read_source_service_options(SERVICE* source)
{
char** options = source->routerOptions;
MXS_CONFIG_PARAMETER* params = source->svc_config_param;
for (MXS_CONFIG_PARAMETER* p = params; p; p = p->next)
@ -77,28 +76,17 @@ void Avro::read_source_service_options(SERVICE* source)
}
}
if (options)
for (auto&& opt: mxs::strtok(config_get_string(params, "router_options"), ", \t"))
{
for (int i = 0; options[i]; i++)
auto&& kv = mxs::strtok(opt, "=");
if (kv[0] == "binlogdir")
{
char option[strlen(options[i]) + 1];
strcpy(option, options[i]);
char *value = strchr(option, '=');
if (value)
{
*value++ = '\0';
value = trim(value);
if (strcmp(option, "binlogdir") == 0)
{
binlogdir = value;
}
else if (strcmp(option, "filestem") == 0)
{
filestem = value;
}
}
binlogdir = kv[1];
}
else if (kv[0] == "filestem")
{
filestem = kv[1];
}
}
}

View File

@ -59,7 +59,7 @@ static bool conversion_task_ctl(Avro *inst, bool start);
*
* @return The instance data for this new instance
*/
MXS_ROUTER* createInstance(SERVICE *service, char **options)
MXS_ROUTER* createInstance(SERVICE *service, MXS_CONFIG_PARAMETER* params)
{
uint64_t block_size = config_get_size(service->svc_config_param, "block_size");
mxs_avro_codec_type codec = static_cast<mxs_avro_codec_type>(config_get_enum(service->svc_config_param,