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

@ -345,13 +345,13 @@ bool CacheFilter::process_params(MXS_CONFIG_PARAMETER* ppParams, CACHE_CONFIG& c
{
bool error = false;
config.debug = config_get_integer(ppParams, "debug");
config.hard_ttl = config_get_integer(ppParams, "hard_ttl");
config.soft_ttl = config_get_integer(ppParams, "soft_ttl");
config.debug = ppParams->get_integer("debug");
config.hard_ttl = ppParams->get_integer("hard_ttl");
config.soft_ttl = ppParams->get_integer("soft_ttl");
config.max_size = config_get_size(ppParams, "max_size");
config.max_count = config_get_integer(ppParams, "max_count");
config.max_count = ppParams->get_integer("max_count");
config.storage = MXS_STRDUP(config_get_string(ppParams, "storage"));
config.max_resultset_rows = config_get_integer(ppParams, "max_resultset_rows");
config.max_resultset_rows = ppParams->get_integer("max_resultset_rows");
config.max_resultset_size = config_get_size(ppParams, "max_resultset_size");
config.thread_model = static_cast<cache_thread_model_t>(config_get_enum(ppParams,
"cached_data",

View File

@ -89,8 +89,8 @@ public:
CCRFilter* new_instance = new(std::nothrow) CCRFilter;
if (new_instance)
{
new_instance->m_count = config_get_integer(params, "count");
new_instance->m_time = config_get_integer(params, "time");
new_instance->m_count = params->get_integer("count");
new_instance->m_time = params->get_integer("time");
new_instance->m_match = config_get_string(params, PARAM_MATCH);
new_instance->m_nomatch = config_get_string(params, PARAM_IGNORE);

View File

@ -233,15 +233,14 @@ static MXS_FILTER* createInstance(const char* name, MXS_CONFIG_PARAMETER* params
if (cinstance)
{
cinstance->name = name;
cinstance->config.max_resultset_rows = config_get_integer(params,
"max_resultset_rows");
cinstance->config.max_resultset_rows = params->get_integer("max_resultset_rows");
cinstance->config.max_resultset_size = config_get_size(params,
"max_resultset_size");
cinstance->config.m_return =
static_cast<maxrows_return_mode>(config_get_enum(params,
"max_resultset_return",
return_option_values));
cinstance->config.debug = config_get_integer(params, "debug");
cinstance->config.debug = params->get_integer("debug");
}
return (MXS_FILTER*)cinstance;

View File

@ -583,7 +583,7 @@ static MXS_FILTER* createInstance(const char* name, MXS_CONFIG_PARAMETER* params
my_instance->conn_stat = AMQP_STATUS_OK;
my_instance->rconn_intv = 1;
my_instance->port = config_get_integer(params, "port");
my_instance->port = params->get_integer("port");
my_instance->trgtype =
static_cast<log_trigger_t>(config_get_enum(params, "logging_trigger", trigger_values));
my_instance->log_all = config_get_bool(params, "logging_log_all");

View File

@ -63,10 +63,10 @@ ThrottleFilter::ThrottleFilter(const ThrottleConfig& config) : m_config(config)
ThrottleFilter* ThrottleFilter::create(const char* zName, MXS_CONFIG_PARAMETER* pParams)
{
int max_qps = config_get_integer(pParams, MAX_QPS_CFG);
int sample_msecs = config_get_integer(pParams, SAMPLING_DURATION_CFG);
int throttle_msecs = config_get_integer(pParams, THROTTLE_DURATION_CFG);
int cont_msecs = config_get_integer(pParams, CONTINUOUS_DURATION_CFG);
int max_qps = pParams->get_integer(MAX_QPS_CFG);
int sample_msecs = pParams->get_integer(SAMPLING_DURATION_CFG);
int throttle_msecs = pParams->get_integer(THROTTLE_DURATION_CFG);
int cont_msecs = pParams->get_integer(CONTINUOUS_DURATION_CFG);
bool config_ok = true;
if (max_qps < 2)

View File

@ -212,7 +212,7 @@ static MXS_FILTER* createInstance(const char* name, MXS_CONFIG_PARAMETER* params
if (my_instance)
{
my_instance->sessions = 0;
my_instance->topN = config_get_integer(params, "count");
my_instance->topN = params->get_integer("count");
my_instance->match = config_copy_string(params, "match");
my_instance->exclude = config_copy_string(params, "exclude");
my_instance->source = config_copy_string(params, "source");