MXS-1624 Add configuration parameter

With the global configuration parameter 'query_classifier_cache'
the query classification cache can be turned on. At the moment it
does not matter what value it has; its presence simply enables the
caching.

Eventually you will be able to specify how much memory the cache
is allowed to consume.
This commit is contained in:
Johan Wikman
2018-07-06 11:09:44 +03:00
parent e7913cc022
commit f2b8487577
4 changed files with 22 additions and 2 deletions

View File

@ -120,6 +120,7 @@ const char CN_PORT[] = "port";
const char CN_PROTOCOL[] = "protocol";
const char CN_QUERY_CLASSIFIER[] = "query_classifier";
const char CN_QUERY_CLASSIFIER_ARGS[] = "query_classifier_args";
const char CN_QUERY_CLASSIFIER_CACHE[] = "query_classifier_cache";
const char CN_QUERY_RETRIES[] = "query_retries";
const char CN_QUERY_RETRY_TIMEOUT[] = "query_retry_timeout";
const char CN_RELATIONSHIPS[] = "relationships";
@ -1723,6 +1724,12 @@ handle_global_item(const char *name, const char *value)
{
gateway.qc_args = MXS_STRDUP_A(value);
}
else if (strcmp(name, CN_QUERY_CLASSIFIER_CACHE) == 0)
{
static QC_CACHE_PROPERTIES cache_properties;
gateway.qc_cache_properties = &cache_properties;
}
else if (strcmp(name, "sql_mode") == 0)
{
if (strcasecmp(value, "default") == 0)