MXS-1066 Add query hint to route to last used server

Add new hint type and support for it in the readwritesplit router.
This commit is contained in:
Marko
2018-07-09 11:07:33 +03:00
parent e2fb0093b1
commit 2acf5f545e
8 changed files with 37 additions and 1 deletions

View File

@ -31,6 +31,7 @@ typedef enum
HINT_ROUTE_TO_NAMED_SERVER,
HINT_ROUTE_TO_UPTODATE_SERVER, /*< not supported by RWSplit and HintRouter */
HINT_ROUTE_TO_ALL, /*< not supported by RWSplit, supported by HintRouter */
HINT_ROUTE_TO_LAST_USED,
HINT_PARAMETER
} HINT_TYPE;

View File

@ -117,7 +117,8 @@ public:
TARGET_SLAVE = 0x02,
TARGET_NAMED_SERVER = 0x04,
TARGET_ALL = 0x08,
TARGET_RLAG_MAX = 0x10
TARGET_RLAG_MAX = 0x10,
TARGET_LAST_USED = 0x20
};
static bool target_is_master(uint32_t t)
@ -145,6 +146,11 @@ public:
return (t & TARGET_RLAG_MAX);
}
static bool target_is_last_used(uint32_t t)
{
return (t & TARGET_LAST_USED);
}
enum current_target_t
{
CURRENT_TARGET_UNDEFINED, /**< Current target has not been set. */