MAX-157. Added support for hints in rwsplit router.
buffer.c: added memory release for hint of a GWBUF hint.c: added bool hint_exists() hint.h: added placeholder for hint type HINT_ROUTE_TO_ALL which doesn't have implementation yet. filter/Makefile: fixed dependency issue hintparser.c: added const char* token_get_keyword(), hint_parser:added NULL check, hint_next_token: fixed off-by-one bug readwritesplit.h: added bitfield for hints' use, which includes route targets and flag for case where user hinted to route to named backend server. readwritesplit.c: added function route_target_t get_route_target() for resolving route target based on 1) query type (from query_classifier) 2) transaction state (active/not) and 3) hints. Modified get_dcb, which is called in routeQuery to provide pointer to correct backend DCB. Now get_dcb also takes server unique name as a parameter if such a hint was found. for hints' use, which includes enter the commit message for your changes.
This commit is contained in:
@ -134,3 +134,20 @@ hint_free(HINT *hint)
|
||||
free(hint->value);
|
||||
free(hint);
|
||||
}
|
||||
|
||||
bool hint_exists(
|
||||
HINT** p_hint,
|
||||
HINT_TYPE type)
|
||||
{
|
||||
bool succp = false;
|
||||
|
||||
while (*p_hint != NULL)
|
||||
{
|
||||
if ((*p_hint)->type == type)
|
||||
{
|
||||
succp = true;
|
||||
}
|
||||
p_hint = &(*p_hint)->next;
|
||||
}
|
||||
return succp;
|
||||
}
|
Reference in New Issue
Block a user