NamedServerFilter: Add HINT_ROUTE_TO_ALL support

This was already supported by HintRouter. The tag for the MaxScale
config file is "->all". Also add note to Documentation and reformat
it a bit.
This commit is contained in:
Esa Korhonen 2017-04-03 11:24:43 +03:00
parent 259b0673a0
commit 1fb8cde5d8
3 changed files with 15 additions and 6 deletions

View File

@ -66,10 +66,14 @@ match01=^SELECT
This is the hint which will be attached to the queries matching the regex. If a
compatible router is used in the service the query will be routed accordingly.
The target can be a server name, a list of server names (comma-separated),
`->master` or `->slave`. The server names add the names as hints (one name per
hint). `->master` adds a *route-to-master*- hint and `->slave` adds a
*route-to-slave*-hint.
The target can be one of the following:
* a server name (adds a `HINT_ROUTE_TO_NAMED_SERVER` hint)
* a list of server names, comma-separated (adds several
`HINT_ROUTE_TO_NAMED_SERVER` hints)
* `->master` (adds a `HINT_ROUTE_TO_MASTER` hint)
* `->slave` (adds a `HINT_ROUTE_TO_SLAVE` hint)
* `->all` (adds a `HINT_ROUTE_TO_ALL` hint)
```
target01=MyServer2

View File

@ -29,8 +29,8 @@ typedef enum
HINT_ROUTE_TO_MASTER = 1,
HINT_ROUTE_TO_SLAVE,
HINT_ROUTE_TO_NAMED_SERVER,
HINT_ROUTE_TO_UPTODATE_SERVER,
HINT_ROUTE_TO_ALL, /*< not implemented yet */
HINT_ROUTE_TO_UPTODATE_SERVER, /*< not supported by RWSplit and HintRouter */
HINT_ROUTE_TO_ALL, /*< not supported by RWSplit, supported by HintRouter */
HINT_PARAMETER
} HINT_TYPE;

View File

@ -432,6 +432,11 @@ int RegexToServers::add_servers(string server_names, bool legacy_mode)
m_targets.push_back(names_arr[0]);
m_htype = HINT_ROUTE_TO_SLAVE;
}
else if (strcmp(names_arr[0], "->all") == 0)
{
m_targets.push_back(names_arr[0]);
m_htype = HINT_ROUTE_TO_ALL;
}
else
{
error = true;