Add runtime schemarouter reconfiguration
The schemarouter now also uses versioned configurations implemented by shared pointers to configuration objects. Moved all the configuration management into the Config class. Removed router options from schemarouter.
This commit is contained in:
@ -13,9 +13,33 @@
|
||||
|
||||
#include "schemarouter.hh"
|
||||
|
||||
#include <maxscale/utils.hh>
|
||||
|
||||
namespace schemarouter
|
||||
{
|
||||
|
||||
Config::Config(MXS_CONFIG_PARAMETER* conf):
|
||||
refresh_min_interval(config_get_integer(conf, "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)),
|
||||
ignore_match_data(ignore_regex ? pcre2_match_data_create_from_pattern(ignore_regex, NULL) : NULL),
|
||||
preferred_server(config_get_server(conf, "preferred_server"))
|
||||
{
|
||||
ignored_dbs.insert("mysql");
|
||||
ignored_dbs.insert("information_schema");
|
||||
ignored_dbs.insert("performance_schema");
|
||||
|
||||
// TODO: Don't process this in the router
|
||||
if (MXS_CONFIG_PARAMETER* p = config_get_param(conf, "ignore_databases"))
|
||||
{
|
||||
for (auto&& a: mxs::strtok(p->value, ", \t"))
|
||||
{
|
||||
ignored_dbs.insert(a);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SRBackend::set_mapped(bool value)
|
||||
{
|
||||
m_mapped = value;
|
||||
|
Reference in New Issue
Block a user