Update MXS_ROUTER_OBJECT APIs
Now the type MXS_ROUTER_SESSION is used in MXS_ROUTER_OBJECT. All routers updated accordingly.
This commit is contained in:
@ -80,19 +80,19 @@ typedef enum error_action
|
|||||||
typedef struct mxs_router_object
|
typedef struct mxs_router_object
|
||||||
{
|
{
|
||||||
MXS_ROUTER *(*createInstance)(SERVICE *service, char **options);
|
MXS_ROUTER *(*createInstance)(SERVICE *service, char **options);
|
||||||
void *(*newSession)(MXS_ROUTER *instance, MXS_SESSION *session);
|
MXS_ROUTER_SESSION *(*newSession)(MXS_ROUTER *instance, MXS_SESSION *session);
|
||||||
void (*closeSession)(MXS_ROUTER *instance, void *router_session);
|
void (*closeSession)(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session);
|
||||||
void (*freeSession)(MXS_ROUTER *instance, void *router_session);
|
void (*freeSession)(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session);
|
||||||
int32_t (*routeQuery)(MXS_ROUTER *instance, void *router_session, GWBUF *queue);
|
int32_t (*routeQuery)(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session, GWBUF *queue);
|
||||||
void (*diagnostics)(MXS_ROUTER *instance, DCB *dcb);
|
void (*diagnostics)(MXS_ROUTER *instance, DCB *dcb);
|
||||||
void (*clientReply)(MXS_ROUTER* instance, void* router_session, GWBUF* queue,
|
void (*clientReply)(MXS_ROUTER* instance, MXS_ROUTER_SESSION *router_session, GWBUF *queue,
|
||||||
DCB *backend_dcb);
|
DCB *backend_dcb);
|
||||||
void (*handleError)(MXS_ROUTER* instance,
|
void (*handleError)(MXS_ROUTER *instance,
|
||||||
void* router_session,
|
MXS_ROUTER_SESSION *router_session,
|
||||||
GWBUF* errmsgbuf,
|
GWBUF *errmsgbuf,
|
||||||
DCB* backend_dcb,
|
DCB *backend_dcb,
|
||||||
mxs_error_action_t action,
|
mxs_error_action_t action,
|
||||||
bool* succp);
|
bool* succp);
|
||||||
uint64_t (*getCapabilities)(MXS_ROUTER *instance);
|
uint64_t (*getCapabilities)(MXS_ROUTER *instance);
|
||||||
void (*destroyInstance)(MXS_ROUTER *instance);
|
void (*destroyInstance)(MXS_ROUTER *instance);
|
||||||
} MXS_ROUTER_OBJECT;
|
} MXS_ROUTER_OBJECT;
|
||||||
|
|||||||
@ -72,14 +72,14 @@ static const char* alter_table_regex =
|
|||||||
|
|
||||||
/* The router entry points */
|
/* The router entry points */
|
||||||
static MXS_ROUTER *createInstance(SERVICE *service, char **options);
|
static MXS_ROUTER *createInstance(SERVICE *service, char **options);
|
||||||
static void *newSession(MXS_ROUTER *instance, MXS_SESSION *session);
|
static MXS_ROUTER_SESSION *newSession(MXS_ROUTER *instance, MXS_SESSION *session);
|
||||||
static void closeSession(MXS_ROUTER *instance, void *router_session);
|
static void closeSession(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session);
|
||||||
static void freeSession(MXS_ROUTER *instance, void *router_session);
|
static void freeSession(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session);
|
||||||
static int routeQuery(MXS_ROUTER *instance, void *router_session, GWBUF *queue);
|
static int routeQuery(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session, GWBUF *queue);
|
||||||
static void diagnostics(MXS_ROUTER *instance, DCB *dcb);
|
static void diagnostics(MXS_ROUTER *instance, DCB *dcb);
|
||||||
static void clientReply(MXS_ROUTER *instance, void *router_session, GWBUF *queue,
|
static void clientReply(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session, GWBUF *queue,
|
||||||
DCB *backend_dcb);
|
DCB *backend_dcb);
|
||||||
static void errorReply(MXS_ROUTER *instance, void *router_session, GWBUF *message,
|
static void errorReply(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session, GWBUF *message,
|
||||||
DCB *backend_dcb, mxs_error_action_t action, bool *succp);
|
DCB *backend_dcb, mxs_error_action_t action, bool *succp);
|
||||||
static uint64_t getCapabilities(MXS_ROUTER* instance);
|
static uint64_t getCapabilities(MXS_ROUTER* instance);
|
||||||
extern int MaxScaleUptime();
|
extern int MaxScaleUptime();
|
||||||
@ -619,7 +619,7 @@ createInstance(SERVICE *service, char **options)
|
|||||||
* @param session The session itself
|
* @param session The session itself
|
||||||
* @return Session specific data for this session
|
* @return Session specific data for this session
|
||||||
*/
|
*/
|
||||||
static void *
|
static MXS_ROUTER_SESSION *
|
||||||
newSession(MXS_ROUTER *instance, MXS_SESSION *session)
|
newSession(MXS_ROUTER *instance, MXS_SESSION *session)
|
||||||
{
|
{
|
||||||
AVRO_INSTANCE *inst = (AVRO_INSTANCE *) instance;
|
AVRO_INSTANCE *inst = (AVRO_INSTANCE *) instance;
|
||||||
@ -692,7 +692,7 @@ newSession(MXS_ROUTER *instance, MXS_SESSION *session)
|
|||||||
* @param router_cli_ses The particular session to free
|
* @param router_cli_ses The particular session to free
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static void freeSession(MXS_ROUTER* router_instance, void* router_client_ses)
|
static void freeSession(MXS_ROUTER* router_instance, MXS_ROUTER_SESSION* router_client_ses)
|
||||||
{
|
{
|
||||||
AVRO_INSTANCE *router = (AVRO_INSTANCE *) router_instance;
|
AVRO_INSTANCE *router = (AVRO_INSTANCE *) router_instance;
|
||||||
AVRO_CLIENT *client = (AVRO_CLIENT *) router_client_ses;
|
AVRO_CLIENT *client = (AVRO_CLIENT *) router_client_ses;
|
||||||
@ -741,7 +741,7 @@ static void freeSession(MXS_ROUTER* router_instance, void* router_client_ses)
|
|||||||
* @param instance The router instance data
|
* @param instance The router instance data
|
||||||
* @param router_session The session being closed
|
* @param router_session The session being closed
|
||||||
*/
|
*/
|
||||||
static void closeSession(MXS_ROUTER *instance, void *router_session)
|
static void closeSession(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session)
|
||||||
{
|
{
|
||||||
AVRO_INSTANCE *router = (AVRO_INSTANCE *) instance;
|
AVRO_INSTANCE *router = (AVRO_INSTANCE *) instance;
|
||||||
AVRO_CLIENT *client = (AVRO_CLIENT *) router_session;
|
AVRO_CLIENT *client = (AVRO_CLIENT *) router_session;
|
||||||
@ -773,7 +773,7 @@ static void closeSession(MXS_ROUTER *instance, void *router_session)
|
|||||||
* @return 1 on success, 0 on error
|
* @return 1 on success, 0 on error
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
routeQuery(MXS_ROUTER *instance, void *router_session, GWBUF *queue)
|
routeQuery(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session, GWBUF *queue)
|
||||||
{
|
{
|
||||||
AVRO_INSTANCE *router = (AVRO_INSTANCE *) instance;
|
AVRO_INSTANCE *router = (AVRO_INSTANCE *) instance;
|
||||||
AVRO_CLIENT *client = (AVRO_CLIENT *) router_session;
|
AVRO_CLIENT *client = (AVRO_CLIENT *) router_session;
|
||||||
@ -949,7 +949,7 @@ diagnostics(MXS_ROUTER *router, DCB *dcb)
|
|||||||
* @param queue The GWBUF with reply data
|
* @param queue The GWBUF with reply data
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
clientReply(MXS_ROUTER *instance, void *router_session, GWBUF *queue, DCB *backend_dcb)
|
clientReply(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session, GWBUF *queue, DCB *backend_dcb)
|
||||||
{
|
{
|
||||||
/** We should never end up here */
|
/** We should never end up here */
|
||||||
ss_dassert(false);
|
ss_dassert(false);
|
||||||
@ -991,7 +991,7 @@ extract_message(GWBUF *errpkt)
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
errorReply(MXS_ROUTER *instance, void *router_session, GWBUF *message, DCB *backend_dcb,
|
errorReply(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session, GWBUF *message, DCB *backend_dcb,
|
||||||
mxs_error_action_t action,
|
mxs_error_action_t action,
|
||||||
bool *succp)
|
bool *succp)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -90,21 +90,21 @@
|
|||||||
/* The router entry points */
|
/* The router entry points */
|
||||||
static MXS_ROUTER *createInstance(SERVICE *service, char **options);
|
static MXS_ROUTER *createInstance(SERVICE *service, char **options);
|
||||||
static void free_instance(ROUTER_INSTANCE *instance);
|
static void free_instance(ROUTER_INSTANCE *instance);
|
||||||
static void *newSession(MXS_ROUTER *instance, MXS_SESSION *session);
|
static MXS_ROUTER_SESSION *newSession(MXS_ROUTER *instance, MXS_SESSION *session);
|
||||||
static void closeSession(MXS_ROUTER *instance, void *router_session);
|
static void closeSession(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session);
|
||||||
static void freeSession(MXS_ROUTER *instance, void *router_session);
|
static void freeSession(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session);
|
||||||
static int routeQuery(MXS_ROUTER *instance, void *router_session, GWBUF *queue);
|
static int routeQuery(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session, GWBUF *queue);
|
||||||
static void diagnostics(MXS_ROUTER *instance, DCB *dcb);
|
static void diagnostics(MXS_ROUTER *instance, DCB *dcb);
|
||||||
static void clientReply(MXS_ROUTER *instance,
|
static void clientReply(MXS_ROUTER *instance,
|
||||||
void *router_session,
|
MXS_ROUTER_SESSION *router_session,
|
||||||
GWBUF *queue,
|
GWBUF *queue,
|
||||||
DCB *backend_dcb);
|
DCB *backend_dcb);
|
||||||
static void errorReply(MXS_ROUTER *instance,
|
static void errorReply(MXS_ROUTER *instance,
|
||||||
void *router_session,
|
MXS_ROUTER_SESSION *router_session,
|
||||||
GWBUF *message,
|
GWBUF *message,
|
||||||
DCB *backend_dcb,
|
DCB *backend_dcb,
|
||||||
mxs_error_action_t action,
|
mxs_error_action_t action,
|
||||||
bool *succp);
|
bool *succp);
|
||||||
|
|
||||||
static uint64_t getCapabilities(MXS_ROUTER* instance);
|
static uint64_t getCapabilities(MXS_ROUTER* instance);
|
||||||
static int blr_handler_config(void *userdata, const char *section, const char *name, const char *value);
|
static int blr_handler_config(void *userdata, const char *section, const char *name, const char *value);
|
||||||
@ -960,7 +960,7 @@ free_instance(ROUTER_INSTANCE *instance)
|
|||||||
* @param session The session itself
|
* @param session The session itself
|
||||||
* @return Session specific data for this session
|
* @return Session specific data for this session
|
||||||
*/
|
*/
|
||||||
static void *
|
static MXS_ROUTER_SESSION *
|
||||||
newSession(MXS_ROUTER *instance, MXS_SESSION *session)
|
newSession(MXS_ROUTER *instance, MXS_SESSION *session)
|
||||||
{
|
{
|
||||||
ROUTER_INSTANCE *inst = (ROUTER_INSTANCE *)instance;
|
ROUTER_INSTANCE *inst = (ROUTER_INSTANCE *)instance;
|
||||||
@ -1030,7 +1030,7 @@ newSession(MXS_ROUTER *instance, MXS_SESSION *session)
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static void freeSession(MXS_ROUTER* router_instance,
|
static void freeSession(MXS_ROUTER* router_instance,
|
||||||
void* router_client_ses)
|
MXS_ROUTER_SESSION* router_client_ses)
|
||||||
{
|
{
|
||||||
ROUTER_INSTANCE *router = (ROUTER_INSTANCE *)router_instance;
|
ROUTER_INSTANCE *router = (ROUTER_INSTANCE *)router_instance;
|
||||||
ROUTER_SLAVE *slave = (ROUTER_SLAVE *)router_client_ses;
|
ROUTER_SLAVE *slave = (ROUTER_SLAVE *)router_client_ses;
|
||||||
@ -1098,7 +1098,7 @@ static void freeSession(MXS_ROUTER* router_instance,
|
|||||||
* @param router_session The session being closed
|
* @param router_session The session being closed
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
closeSession(MXS_ROUTER *instance, void *router_session)
|
closeSession(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session)
|
||||||
{
|
{
|
||||||
ROUTER_INSTANCE *router = (ROUTER_INSTANCE *)instance;
|
ROUTER_INSTANCE *router = (ROUTER_INSTANCE *)instance;
|
||||||
ROUTER_SLAVE *slave = (ROUTER_SLAVE *)router_session;
|
ROUTER_SLAVE *slave = (ROUTER_SLAVE *)router_session;
|
||||||
@ -1184,7 +1184,7 @@ closeSession(MXS_ROUTER *instance, void *router_session)
|
|||||||
* @return The number of bytes sent
|
* @return The number of bytes sent
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
routeQuery(MXS_ROUTER *instance, void *router_session, GWBUF *queue)
|
routeQuery(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session, GWBUF *queue)
|
||||||
{
|
{
|
||||||
ROUTER_INSTANCE *router = (ROUTER_INSTANCE *)instance;
|
ROUTER_INSTANCE *router = (ROUTER_INSTANCE *)instance;
|
||||||
ROUTER_SLAVE *slave = (ROUTER_SLAVE *)router_session;
|
ROUTER_SLAVE *slave = (ROUTER_SLAVE *)router_session;
|
||||||
@ -1683,7 +1683,7 @@ diagnostics(MXS_ROUTER *router, DCB *dcb)
|
|||||||
* @param queue The GWBUF with reply data
|
* @param queue The GWBUF with reply data
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
clientReply(MXS_ROUTER *instance, void *router_session, GWBUF *queue, DCB *backend_dcb)
|
clientReply(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session, GWBUF *queue, DCB *backend_dcb)
|
||||||
{
|
{
|
||||||
ROUTER_INSTANCE *router = (ROUTER_INSTANCE *)instance;
|
ROUTER_INSTANCE *router = (ROUTER_INSTANCE *)instance;
|
||||||
|
|
||||||
@ -1729,7 +1729,7 @@ extract_message(GWBUF *errpkt)
|
|||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
errorReply(MXS_ROUTER *instance,
|
errorReply(MXS_ROUTER *instance,
|
||||||
void *router_session,
|
MXS_ROUTER_SESSION *router_session,
|
||||||
GWBUF *message,
|
GWBUF *message,
|
||||||
DCB *backend_dcb,
|
DCB *backend_dcb,
|
||||||
mxs_error_action_t action,
|
mxs_error_action_t action,
|
||||||
|
|||||||
@ -44,11 +44,11 @@
|
|||||||
|
|
||||||
/* The router entry points */
|
/* The router entry points */
|
||||||
static MXS_ROUTER *createInstance(SERVICE *service, char **options);
|
static MXS_ROUTER *createInstance(SERVICE *service, char **options);
|
||||||
static void *newSession(MXS_ROUTER *instance, MXS_SESSION *session);
|
static MXS_ROUTER_SESSION *newSession(MXS_ROUTER *instance, MXS_SESSION *session);
|
||||||
static void closeSession(MXS_ROUTER *instance, void *router_session);
|
static void closeSession(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session);
|
||||||
static void freeSession(MXS_ROUTER *instance, void *router_session);
|
static void freeSession(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session);
|
||||||
static int execute(MXS_ROUTER *instance, void *router_session, GWBUF *queue);
|
static int execute(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session, GWBUF *queue);
|
||||||
static void diagnostics(MXS_ROUTER *instance, DCB *dcb);
|
static void diagnostics(MXS_ROUTER *instance, DCB *dcb);
|
||||||
static uint64_t getCapabilities(MXS_ROUTER* instance);
|
static uint64_t getCapabilities(MXS_ROUTER* instance);
|
||||||
|
|
||||||
extern int execute_cmd(CLI_SESSION *cli);
|
extern int execute_cmd(CLI_SESSION *cli);
|
||||||
@ -156,7 +156,7 @@ createInstance(SERVICE *service, char **options)
|
|||||||
* @param session The session itself
|
* @param session The session itself
|
||||||
* @return Session specific data for this session
|
* @return Session specific data for this session
|
||||||
*/
|
*/
|
||||||
static void *
|
static MXS_ROUTER_SESSION *
|
||||||
newSession(MXS_ROUTER *instance, MXS_SESSION *session)
|
newSession(MXS_ROUTER *instance, MXS_SESSION *session)
|
||||||
{
|
{
|
||||||
CLI_INSTANCE *inst = (CLI_INSTANCE *)instance;
|
CLI_INSTANCE *inst = (CLI_INSTANCE *)instance;
|
||||||
@ -188,7 +188,7 @@ newSession(MXS_ROUTER *instance, MXS_SESSION *session)
|
|||||||
* @param router_session The session being closed
|
* @param router_session The session being closed
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
closeSession(MXS_ROUTER *instance, void *router_session)
|
closeSession(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session)
|
||||||
{
|
{
|
||||||
CLI_INSTANCE *inst = (CLI_INSTANCE *)instance;
|
CLI_INSTANCE *inst = (CLI_INSTANCE *)instance;
|
||||||
CLI_SESSION *session = (CLI_SESSION *)router_session;
|
CLI_SESSION *session = (CLI_SESSION *)router_session;
|
||||||
@ -224,9 +224,8 @@ closeSession(MXS_ROUTER *instance, void *router_session)
|
|||||||
* @param router_instance The router session
|
* @param router_instance The router session
|
||||||
* @param router_client_session The router session as returned from newSession
|
* @param router_client_session The router session as returned from newSession
|
||||||
*/
|
*/
|
||||||
static void freeSession(
|
static void freeSession(MXS_ROUTER* router_instance,
|
||||||
MXS_ROUTER* router_instance,
|
MXS_ROUTER_SESSION* router_client_session)
|
||||||
void* router_client_session)
|
|
||||||
{
|
{
|
||||||
MXS_FREE(router_client_session);
|
MXS_FREE(router_client_session);
|
||||||
return;
|
return;
|
||||||
@ -243,7 +242,7 @@ static void freeSession(
|
|||||||
* @return The number of bytes sent
|
* @return The number of bytes sent
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
execute(MXS_ROUTER *instance, void *router_session, GWBUF *queue)
|
execute(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session, GWBUF *queue)
|
||||||
{
|
{
|
||||||
CLI_SESSION *session = (CLI_SESSION *)router_session;
|
CLI_SESSION *session = (CLI_SESSION *)router_session;
|
||||||
|
|
||||||
|
|||||||
@ -43,11 +43,11 @@
|
|||||||
|
|
||||||
/* The router entry points */
|
/* The router entry points */
|
||||||
static MXS_ROUTER *createInstance(SERVICE *service, char **options);
|
static MXS_ROUTER *createInstance(SERVICE *service, char **options);
|
||||||
static void *newSession(MXS_ROUTER *instance, MXS_SESSION *session);
|
static MXS_ROUTER_SESSION *newSession(MXS_ROUTER *instance, MXS_SESSION *session);
|
||||||
static void closeSession(MXS_ROUTER *instance, void *router_session);
|
static void closeSession(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session);
|
||||||
static void freeSession(MXS_ROUTER *instance, void *router_session);
|
static void freeSession(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session);
|
||||||
static int execute(MXS_ROUTER *instance, void *router_session, GWBUF *queue);
|
static int execute(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session, GWBUF *queue);
|
||||||
static void diagnostics(MXS_ROUTER *instance, DCB *dcb);
|
static void diagnostics(MXS_ROUTER *instance, DCB *dcb);
|
||||||
static uint64_t getCapabilities(MXS_ROUTER* instance);
|
static uint64_t getCapabilities(MXS_ROUTER* instance);
|
||||||
|
|
||||||
extern int execute_cmd(CLI_SESSION *cli);
|
extern int execute_cmd(CLI_SESSION *cli);
|
||||||
@ -147,7 +147,7 @@ createInstance(SERVICE *service, char **options)
|
|||||||
* @param session The session itself
|
* @param session The session itself
|
||||||
* @return Session specific data for this session
|
* @return Session specific data for this session
|
||||||
*/
|
*/
|
||||||
static void *
|
static MXS_ROUTER_SESSION *
|
||||||
newSession(MXS_ROUTER *instance, MXS_SESSION *session)
|
newSession(MXS_ROUTER *instance, MXS_SESSION *session)
|
||||||
{
|
{
|
||||||
CLI_INSTANCE *inst = (CLI_INSTANCE *)instance;
|
CLI_INSTANCE *inst = (CLI_INSTANCE *)instance;
|
||||||
@ -182,7 +182,7 @@ newSession(MXS_ROUTER *instance, MXS_SESSION *session)
|
|||||||
* @param router_session The session being closed
|
* @param router_session The session being closed
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
closeSession(MXS_ROUTER *instance, void *router_session)
|
closeSession(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session)
|
||||||
{
|
{
|
||||||
CLI_INSTANCE *inst = (CLI_INSTANCE *)instance;
|
CLI_INSTANCE *inst = (CLI_INSTANCE *)instance;
|
||||||
CLI_SESSION *session = (CLI_SESSION *)router_session;
|
CLI_SESSION *session = (CLI_SESSION *)router_session;
|
||||||
@ -218,9 +218,8 @@ closeSession(MXS_ROUTER *instance, void *router_session)
|
|||||||
* @param router_instance The router session
|
* @param router_instance The router session
|
||||||
* @param router_client_session The router session as returned from newSession
|
* @param router_client_session The router session as returned from newSession
|
||||||
*/
|
*/
|
||||||
static void freeSession(
|
static void freeSession(MXS_ROUTER* router_instance,
|
||||||
MXS_ROUTER* router_instance,
|
MXS_ROUTER_SESSION* router_client_session)
|
||||||
void* router_client_session)
|
|
||||||
{
|
{
|
||||||
MXS_FREE(router_client_session);
|
MXS_FREE(router_client_session);
|
||||||
return;
|
return;
|
||||||
@ -237,7 +236,7 @@ static void freeSession(
|
|||||||
* @return The number of bytes sent
|
* @return The number of bytes sent
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
execute(MXS_ROUTER *instance, void *router_session, GWBUF *queue)
|
execute(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session, GWBUF *queue)
|
||||||
{
|
{
|
||||||
CLI_SESSION *session = (CLI_SESSION *)router_session;
|
CLI_SESSION *session = (CLI_SESSION *)router_session;
|
||||||
|
|
||||||
|
|||||||
@ -65,18 +65,18 @@ static int handle_url(INFO_INSTANCE *instance, INFO_SESSION *router_session, GWB
|
|||||||
|
|
||||||
/* The router entry points */
|
/* The router entry points */
|
||||||
static MXS_ROUTER *createInstance(SERVICE *service, char **options);
|
static MXS_ROUTER *createInstance(SERVICE *service, char **options);
|
||||||
static void *newSession(MXS_ROUTER *instance, MXS_SESSION *session);
|
static MXS_ROUTER_SESSION *newSession(MXS_ROUTER *instance, MXS_SESSION *session);
|
||||||
static void closeSession(MXS_ROUTER *instance, void *router_session);
|
static void closeSession(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session);
|
||||||
static void freeSession(MXS_ROUTER *instance, void *router_session);
|
static void freeSession(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session);
|
||||||
static int execute(MXS_ROUTER *instance, void *router_session, GWBUF *queue);
|
static int execute(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session, GWBUF *queue);
|
||||||
static void diagnostics(MXS_ROUTER *instance, DCB *dcb);
|
static void diagnostics(MXS_ROUTER *instance, DCB *dcb);
|
||||||
static uint64_t getCapabilities(MXS_ROUTER* instance);
|
static uint64_t getCapabilities(MXS_ROUTER* instance);
|
||||||
static void handleError(MXS_ROUTER *instance,
|
static void handleError(MXS_ROUTER *instance,
|
||||||
void *router_session,
|
MXS_ROUTER_SESSION *router_session,
|
||||||
GWBUF *errbuf,
|
GWBUF *errbuf,
|
||||||
DCB *backend_dcb,
|
DCB *backend_dcb,
|
||||||
mxs_error_action_t action,
|
mxs_error_action_t action,
|
||||||
bool *succp);
|
bool *succp);
|
||||||
|
|
||||||
static SPINLOCK instlock;
|
static SPINLOCK instlock;
|
||||||
static INFO_INSTANCE *instances;
|
static INFO_INSTANCE *instances;
|
||||||
@ -180,7 +180,7 @@ createInstance(SERVICE *service, char **options)
|
|||||||
* @param session The session itself
|
* @param session The session itself
|
||||||
* @return Session specific data for this session
|
* @return Session specific data for this session
|
||||||
*/
|
*/
|
||||||
static void *
|
static MXS_ROUTER_SESSION *
|
||||||
newSession(MXS_ROUTER *instance, MXS_SESSION *session)
|
newSession(MXS_ROUTER *instance, MXS_SESSION *session)
|
||||||
{
|
{
|
||||||
INFO_INSTANCE *inst = (INFO_INSTANCE *)instance;
|
INFO_INSTANCE *inst = (INFO_INSTANCE *)instance;
|
||||||
@ -212,7 +212,7 @@ newSession(MXS_ROUTER *instance, MXS_SESSION *session)
|
|||||||
* @param router_session The session being closed
|
* @param router_session The session being closed
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
closeSession(MXS_ROUTER *instance, void *router_session)
|
closeSession(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session)
|
||||||
{
|
{
|
||||||
INFO_INSTANCE *inst = (INFO_INSTANCE *)instance;
|
INFO_INSTANCE *inst = (INFO_INSTANCE *)instance;
|
||||||
INFO_SESSION *session = (INFO_SESSION *)router_session;
|
INFO_SESSION *session = (INFO_SESSION *)router_session;
|
||||||
@ -249,7 +249,7 @@ closeSession(MXS_ROUTER *instance, void *router_session)
|
|||||||
* @param router_client_session The router session as returned from newSession
|
* @param router_client_session The router session as returned from newSession
|
||||||
*/
|
*/
|
||||||
static void freeSession(MXS_ROUTER* router_instance,
|
static void freeSession(MXS_ROUTER* router_instance,
|
||||||
void* router_client_session)
|
MXS_ROUTER_SESSION* router_client_session)
|
||||||
{
|
{
|
||||||
MXS_FREE(router_client_session);
|
MXS_FREE(router_client_session);
|
||||||
return;
|
return;
|
||||||
@ -268,12 +268,12 @@ static void freeSession(MXS_ROUTER* router_instance,
|
|||||||
* @param succp Result of action: true iff router can continue
|
* @param succp Result of action: true iff router can continue
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static void handleError(MXS_ROUTER *instance,
|
static void handleError(MXS_ROUTER *instance,
|
||||||
void *router_session,
|
MXS_ROUTER_SESSION *router_session,
|
||||||
GWBUF *errbuf,
|
GWBUF *errbuf,
|
||||||
DCB *backend_dcb,
|
DCB *backend_dcb,
|
||||||
mxs_error_action_t action,
|
mxs_error_action_t action,
|
||||||
bool *succp)
|
bool *succp)
|
||||||
|
|
||||||
{
|
{
|
||||||
DCB *client_dcb;
|
DCB *client_dcb;
|
||||||
@ -316,7 +316,7 @@ static void handleError(MXS_ROUTER *instance,
|
|||||||
* @return The number of bytes sent
|
* @return The number of bytes sent
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
execute(MXS_ROUTER *rinstance, void *router_session, GWBUF *queue)
|
execute(MXS_ROUTER *rinstance, MXS_ROUTER_SESSION *router_session, GWBUF *queue)
|
||||||
{
|
{
|
||||||
INFO_INSTANCE *instance = (INFO_INSTANCE *)rinstance;
|
INFO_INSTANCE *instance = (INFO_INSTANCE *)rinstance;
|
||||||
INFO_SESSION *session = (INFO_SESSION *)router_session;
|
INFO_SESSION *session = (INFO_SESSION *)router_session;
|
||||||
|
|||||||
@ -89,14 +89,14 @@
|
|||||||
|
|
||||||
/* The router entry points */
|
/* The router entry points */
|
||||||
static MXS_ROUTER *createInstance(SERVICE *service, char **options);
|
static MXS_ROUTER *createInstance(SERVICE *service, char **options);
|
||||||
static void *newSession(MXS_ROUTER *instance, MXS_SESSION *session);
|
static MXS_ROUTER_SESSION *newSession(MXS_ROUTER *instance, MXS_SESSION *session);
|
||||||
static void closeSession(MXS_ROUTER *instance, void *router_session);
|
static void closeSession(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session);
|
||||||
static void freeSession(MXS_ROUTER *instance, void *router_session);
|
static void freeSession(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session);
|
||||||
static int routeQuery(MXS_ROUTER *instance, void *router_session, GWBUF *queue);
|
static int routeQuery(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session, GWBUF *queue);
|
||||||
static void diagnostics(MXS_ROUTER *instance, DCB *dcb);
|
static void diagnostics(MXS_ROUTER *instance, DCB *dcb);
|
||||||
static void clientReply(MXS_ROUTER *instance, void *router_session, GWBUF *queue,
|
static void clientReply(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session, GWBUF *queue,
|
||||||
DCB *backend_dcb);
|
DCB *backend_dcb);
|
||||||
static void handleError(MXS_ROUTER *instance, void *router_session, GWBUF *errbuf,
|
static void handleError(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session, GWBUF *errbuf,
|
||||||
DCB *problem_dcb, mxs_error_action_t action, bool *succp);
|
DCB *problem_dcb, mxs_error_action_t action, bool *succp);
|
||||||
static uint64_t getCapabilities(MXS_ROUTER* instance);
|
static uint64_t getCapabilities(MXS_ROUTER* instance);
|
||||||
static bool rses_begin_locked_router_action(ROUTER_CLIENT_SES* rses);
|
static bool rses_begin_locked_router_action(ROUTER_CLIENT_SES* rses);
|
||||||
@ -257,7 +257,7 @@ createInstance(SERVICE *service, char **options)
|
|||||||
* @param session The session itself
|
* @param session The session itself
|
||||||
* @return Session specific data for this session
|
* @return Session specific data for this session
|
||||||
*/
|
*/
|
||||||
static void *
|
static MXS_ROUTER_SESSION *
|
||||||
newSession(MXS_ROUTER *instance, MXS_SESSION *session)
|
newSession(MXS_ROUTER *instance, MXS_SESSION *session)
|
||||||
{
|
{
|
||||||
ROUTER_INSTANCE *inst = (ROUTER_INSTANCE *) instance;
|
ROUTER_INSTANCE *inst = (ROUTER_INSTANCE *) instance;
|
||||||
@ -455,7 +455,7 @@ newSession(MXS_ROUTER *instance, MXS_SESSION *session)
|
|||||||
* @details (write detailed description here)
|
* @details (write detailed description here)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static void freeSession(MXS_ROUTER* router_instance, void* router_client_ses)
|
static void freeSession(MXS_ROUTER* router_instance, MXS_ROUTER_SESSION* router_client_ses)
|
||||||
{
|
{
|
||||||
ROUTER_INSTANCE* router = (ROUTER_INSTANCE *) router_instance;
|
ROUTER_INSTANCE* router = (ROUTER_INSTANCE *) router_instance;
|
||||||
ROUTER_CLIENT_SES* router_cli_ses = (ROUTER_CLIENT_SES *) router_client_ses;
|
ROUTER_CLIENT_SES* router_cli_ses = (ROUTER_CLIENT_SES *) router_client_ses;
|
||||||
@ -474,7 +474,7 @@ static void freeSession(MXS_ROUTER* router_instance, void* router_client_ses)
|
|||||||
* @param router_session The session being closed
|
* @param router_session The session being closed
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
closeSession(MXS_ROUTER *instance, void *router_session)
|
closeSession(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session)
|
||||||
{
|
{
|
||||||
ROUTER_CLIENT_SES *router_cli_ses = (ROUTER_CLIENT_SES *) router_session;
|
ROUTER_CLIENT_SES *router_cli_ses = (ROUTER_CLIENT_SES *) router_session;
|
||||||
DCB* backend_dcb;
|
DCB* backend_dcb;
|
||||||
@ -542,7 +542,7 @@ static void log_closed_session(mysql_server_cmd_t mysql_command, bool is_closed,
|
|||||||
* @return if succeed 1, otherwise 0
|
* @return if succeed 1, otherwise 0
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
routeQuery(MXS_ROUTER *instance, void *router_session, GWBUF *queue)
|
routeQuery(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session, GWBUF *queue)
|
||||||
{
|
{
|
||||||
ROUTER_INSTANCE *inst = (ROUTER_INSTANCE *) instance;
|
ROUTER_INSTANCE *inst = (ROUTER_INSTANCE *) instance;
|
||||||
ROUTER_CLIENT_SES *router_cli_ses = (ROUTER_CLIENT_SES *) router_session;
|
ROUTER_CLIENT_SES *router_cli_ses = (ROUTER_CLIENT_SES *) router_session;
|
||||||
@ -661,7 +661,7 @@ diagnostics(MXS_ROUTER *router, DCB *dcb)
|
|||||||
* @param queue The GWBUF with reply data
|
* @param queue The GWBUF with reply data
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
clientReply(MXS_ROUTER *instance, void *router_session, GWBUF *queue, DCB *backend_dcb)
|
clientReply(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session, GWBUF *queue, DCB *backend_dcb)
|
||||||
{
|
{
|
||||||
ss_dassert(backend_dcb->session->client_dcb != NULL);
|
ss_dassert(backend_dcb->session->client_dcb != NULL);
|
||||||
MXS_SESSION_ROUTE_REPLY(backend_dcb->session, queue);
|
MXS_SESSION_ROUTE_REPLY(backend_dcb->session, queue);
|
||||||
@ -680,7 +680,7 @@ clientReply(MXS_ROUTER *instance, void *router_session, GWBUF *queue, DCB *backe
|
|||||||
* @param succp Result of action: true if router can continue
|
* @param succp Result of action: true if router can continue
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static void handleError(MXS_ROUTER *instance, void *router_session, GWBUF *errbuf,
|
static void handleError(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session, GWBUF *errbuf,
|
||||||
DCB *problem_dcb, mxs_error_action_t action, bool *succp)
|
DCB *problem_dcb, mxs_error_action_t action, bool *succp)
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|||||||
@ -69,14 +69,14 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static MXS_ROUTER *createInstance(SERVICE *service, char **options);
|
static MXS_ROUTER *createInstance(SERVICE *service, char **options);
|
||||||
static void *newSession(MXS_ROUTER *instance, MXS_SESSION *session);
|
static MXS_ROUTER_SESSION *newSession(MXS_ROUTER *instance, MXS_SESSION *session);
|
||||||
static void closeSession(MXS_ROUTER *instance, void *session);
|
static void closeSession(MXS_ROUTER *instance, MXS_ROUTER_SESSION *session);
|
||||||
static void freeSession(MXS_ROUTER *instance, void *session);
|
static void freeSession(MXS_ROUTER *instance, MXS_ROUTER_SESSION *session);
|
||||||
static int routeQuery(MXS_ROUTER *instance, void *session, GWBUF *queue);
|
static int routeQuery(MXS_ROUTER *instance, MXS_ROUTER_SESSION *session, GWBUF *queue);
|
||||||
static void diagnostics(MXS_ROUTER *instance, DCB *dcb);
|
static void diagnostics(MXS_ROUTER *instance, DCB *dcb);
|
||||||
static void clientReply(MXS_ROUTER *instance, void *router_session, GWBUF *queue,
|
static void clientReply(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session, GWBUF *queue,
|
||||||
DCB *backend_dcb);
|
DCB *backend_dcb);
|
||||||
static void handleError(MXS_ROUTER *instance, void *router_session,
|
static void handleError(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session,
|
||||||
GWBUF *errmsgbuf, DCB *backend_dcb,
|
GWBUF *errmsgbuf, DCB *backend_dcb,
|
||||||
mxs_error_action_t action, bool *succp);
|
mxs_error_action_t action, bool *succp);
|
||||||
static uint64_t getCapabilities(MXS_ROUTER* instance);
|
static uint64_t getCapabilities(MXS_ROUTER* instance);
|
||||||
@ -313,7 +313,7 @@ static MXS_ROUTER *createInstance(SERVICE *service, char **options)
|
|||||||
* @param session The MaxScale session (generic connection data)
|
* @param session The MaxScale session (generic connection data)
|
||||||
* @return Session specific data for this session, i.e. a router session
|
* @return Session specific data for this session, i.e. a router session
|
||||||
*/
|
*/
|
||||||
static void *newSession(MXS_ROUTER *router_inst, MXS_SESSION *session)
|
static MXS_ROUTER_SESSION *newSession(MXS_ROUTER *router_inst, MXS_SESSION *session)
|
||||||
{
|
{
|
||||||
ROUTER_INSTANCE *router = (ROUTER_INSTANCE *)router_inst;
|
ROUTER_INSTANCE *router = (ROUTER_INSTANCE *)router_inst;
|
||||||
ROUTER_CLIENT_SES *client_rses = (ROUTER_CLIENT_SES *)MXS_CALLOC(1, sizeof(ROUTER_CLIENT_SES));
|
ROUTER_CLIENT_SES *client_rses = (ROUTER_CLIENT_SES *)MXS_CALLOC(1, sizeof(ROUTER_CLIENT_SES));
|
||||||
@ -404,7 +404,7 @@ static void *newSession(MXS_ROUTER *router_inst, MXS_SESSION *session)
|
|||||||
* @param instance The router instance data
|
* @param instance The router instance data
|
||||||
* @param session The router session being closed
|
* @param session The router session being closed
|
||||||
*/
|
*/
|
||||||
static void closeSession(MXS_ROUTER *instance, void *router_session)
|
static void closeSession(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session)
|
||||||
{
|
{
|
||||||
ROUTER_CLIENT_SES *router_cli_ses = (ROUTER_CLIENT_SES *)router_session;
|
ROUTER_CLIENT_SES *router_cli_ses = (ROUTER_CLIENT_SES *)router_session;
|
||||||
CHK_CLIENT_RSES(router_cli_ses);
|
CHK_CLIENT_RSES(router_cli_ses);
|
||||||
@ -480,7 +480,7 @@ static void closeSession(MXS_ROUTER *instance, void *router_session)
|
|||||||
* @param router_client_session Client session
|
* @param router_client_session Client session
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static void freeSession(MXS_ROUTER *router_instance, void *router_client_session)
|
static void freeSession(MXS_ROUTER *router_instance, MXS_ROUTER_SESSION *router_client_session)
|
||||||
{
|
{
|
||||||
ROUTER_CLIENT_SES *router_cli_ses = (ROUTER_CLIENT_SES *)router_client_session;
|
ROUTER_CLIENT_SES *router_cli_ses = (ROUTER_CLIENT_SES *)router_client_session;
|
||||||
|
|
||||||
@ -553,7 +553,7 @@ void close_failed_bref(backend_ref_t *bref, bool fatal)
|
|||||||
* @param querybuf Buffer containing the query
|
* @param querybuf Buffer containing the query
|
||||||
* @return 1 on success, 0 on error
|
* @return 1 on success, 0 on error
|
||||||
*/
|
*/
|
||||||
static int routeQuery(MXS_ROUTER *instance, void *router_session, GWBUF *querybuf)
|
static int routeQuery(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session, GWBUF *querybuf)
|
||||||
{
|
{
|
||||||
ROUTER_INSTANCE *inst = (ROUTER_INSTANCE *) instance;
|
ROUTER_INSTANCE *inst = (ROUTER_INSTANCE *) instance;
|
||||||
ROUTER_CLIENT_SES *rses = (ROUTER_CLIENT_SES *) router_session;
|
ROUTER_CLIENT_SES *rses = (ROUTER_CLIENT_SES *) router_session;
|
||||||
@ -665,7 +665,9 @@ static void diagnostics(MXS_ROUTER *instance, DCB *dcb)
|
|||||||
* @param backend_dcb The backend DCB
|
* @param backend_dcb The backend DCB
|
||||||
* @param queue The GWBUF with reply data
|
* @param queue The GWBUF with reply data
|
||||||
*/
|
*/
|
||||||
static void clientReply(MXS_ROUTER *instance, void *router_session, GWBUF *writebuf,
|
static void clientReply(MXS_ROUTER *instance,
|
||||||
|
MXS_ROUTER_SESSION *router_session,
|
||||||
|
GWBUF *writebuf,
|
||||||
DCB *backend_dcb)
|
DCB *backend_dcb)
|
||||||
{
|
{
|
||||||
DCB *client_dcb;
|
DCB *client_dcb;
|
||||||
@ -1351,9 +1353,12 @@ static bool rwsplit_process_router_options(ROUTER_INSTANCE *router,
|
|||||||
* Even if succp == true connecting to new slave may have failed. succp is to
|
* Even if succp == true connecting to new slave may have failed. succp is to
|
||||||
* tell whether router has enough master/slave connections to continue work.
|
* tell whether router has enough master/slave connections to continue work.
|
||||||
*/
|
*/
|
||||||
static void handleError(MXS_ROUTER *instance, void *router_session,
|
static void handleError(MXS_ROUTER *instance,
|
||||||
GWBUF *errmsgbuf, DCB *problem_dcb,
|
MXS_ROUTER_SESSION *router_session,
|
||||||
mxs_error_action_t action, bool *succp)
|
GWBUF *errmsgbuf,
|
||||||
|
DCB *problem_dcb,
|
||||||
|
mxs_error_action_t action,
|
||||||
|
bool *succp)
|
||||||
{
|
{
|
||||||
MXS_SESSION *session;
|
MXS_SESSION *session;
|
||||||
ROUTER_INSTANCE *inst = (ROUTER_INSTANCE *)instance;
|
ROUTER_INSTANCE *inst = (ROUTER_INSTANCE *)instance;
|
||||||
|
|||||||
@ -58,23 +58,23 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static MXS_ROUTER* createInstance(SERVICE *service, char **options);
|
static MXS_ROUTER* createInstance(SERVICE *service, char **options);
|
||||||
static void* newSession(MXS_ROUTER *instance, MXS_SESSION *session);
|
static MXS_ROUTER_SESSION* newSession(MXS_ROUTER *instance, MXS_SESSION *session);
|
||||||
static void closeSession(MXS_ROUTER *instance, void *session);
|
static void closeSession(MXS_ROUTER *instance, MXS_ROUTER_SESSION *session);
|
||||||
static void freeSession(MXS_ROUTER *instance, void *session);
|
static void freeSession(MXS_ROUTER *instance, MXS_ROUTER_SESSION *session);
|
||||||
static int routeQuery(MXS_ROUTER *instance, void *session, GWBUF *queue);
|
static int routeQuery(MXS_ROUTER *instance, MXS_ROUTER_SESSION *session, GWBUF *queue);
|
||||||
static void diagnostic(MXS_ROUTER *instance, DCB *dcb);
|
static void diagnostic(MXS_ROUTER *instance, DCB *dcb);
|
||||||
|
|
||||||
static void clientReply(MXS_ROUTER* instance,
|
static void clientReply(MXS_ROUTER* instance,
|
||||||
void* router_session,
|
MXS_ROUTER_SESSION* router_session,
|
||||||
GWBUF* queue,
|
GWBUF* queue,
|
||||||
DCB* backend_dcb);
|
DCB* backend_dcb);
|
||||||
|
|
||||||
static void handleError(MXS_ROUTER* instance,
|
static void handleError(MXS_ROUTER* instance,
|
||||||
void* router_session,
|
MXS_ROUTER_SESSION* router_session,
|
||||||
GWBUF* errmsgbuf,
|
GWBUF* errmsgbuf,
|
||||||
DCB* backend_dcb,
|
DCB* backend_dcb,
|
||||||
mxs_error_action_t action,
|
mxs_error_action_t action,
|
||||||
bool* succp);
|
bool* succp);
|
||||||
static backend_ref_t* get_bref_from_dcb(ROUTER_CLIENT_SES* rses, DCB* dcb);
|
static backend_ref_t* get_bref_from_dcb(ROUTER_CLIENT_SES* rses, DCB* dcb);
|
||||||
|
|
||||||
static route_target_t get_shard_route_target(qc_query_type_t qtype,
|
static route_target_t get_shard_route_target(qc_query_type_t qtype,
|
||||||
@ -847,7 +847,7 @@ enum shard_map_state shard_map_update_state(shard_map_t *self, ROUTER_INSTANCE*
|
|||||||
* @param session The session itself
|
* @param session The session itself
|
||||||
* @return Session specific data for this session
|
* @return Session specific data for this session
|
||||||
*/
|
*/
|
||||||
static void* newSession(MXS_ROUTER* router_inst, MXS_SESSION* session)
|
static MXS_ROUTER_SESSION* newSession(MXS_ROUTER* router_inst, MXS_SESSION* session)
|
||||||
{
|
{
|
||||||
backend_ref_t* backend_ref; /*< array of backend references (DCB, BACKEND, cursor) */
|
backend_ref_t* backend_ref; /*< array of backend references (DCB, BACKEND, cursor) */
|
||||||
ROUTER_CLIENT_SES* client_rses = NULL;
|
ROUTER_CLIENT_SES* client_rses = NULL;
|
||||||
@ -1040,7 +1040,7 @@ static void* newSession(MXS_ROUTER* router_inst, MXS_SESSION* session)
|
|||||||
* @param instance The router instance data
|
* @param instance The router instance data
|
||||||
* @param session The session being closed
|
* @param session The session being closed
|
||||||
*/
|
*/
|
||||||
static void closeSession(MXS_ROUTER* instance, void* router_session)
|
static void closeSession(MXS_ROUTER* instance, MXS_ROUTER_SESSION* router_session)
|
||||||
{
|
{
|
||||||
ROUTER_CLIENT_SES* router_cli_ses;
|
ROUTER_CLIENT_SES* router_cli_ses;
|
||||||
ROUTER_INSTANCE* inst;
|
ROUTER_INSTANCE* inst;
|
||||||
@ -1135,7 +1135,7 @@ static void closeSession(MXS_ROUTER* instance, void* router_session)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void freeSession(MXS_ROUTER* router_instance, void* router_client_session)
|
static void freeSession(MXS_ROUTER* router_instance, MXS_ROUTER_SESSION* router_client_session)
|
||||||
{
|
{
|
||||||
ROUTER_CLIENT_SES* router_cli_ses = (ROUTER_CLIENT_SES *)router_client_session;
|
ROUTER_CLIENT_SES* router_cli_ses = (ROUTER_CLIENT_SES *)router_client_session;
|
||||||
|
|
||||||
@ -1612,7 +1612,7 @@ bool send_database_list(ROUTER_INSTANCE* router, ROUTER_CLIENT_SES* client)
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static int routeQuery(MXS_ROUTER* instance,
|
static int routeQuery(MXS_ROUTER* instance,
|
||||||
void* router_session,
|
MXS_ROUTER_SESSION* router_session,
|
||||||
GWBUF* qbuf)
|
GWBUF* qbuf)
|
||||||
{
|
{
|
||||||
qc_query_type_t qtype = QUERY_TYPE_UNKNOWN;
|
qc_query_type_t qtype = QUERY_TYPE_UNKNOWN;
|
||||||
@ -2238,7 +2238,7 @@ static void diagnostic(MXS_ROUTER *instance, DCB *dcb)
|
|||||||
* @param queue The GWBUF with reply data
|
* @param queue The GWBUF with reply data
|
||||||
*/
|
*/
|
||||||
static void clientReply(MXS_ROUTER* instance,
|
static void clientReply(MXS_ROUTER* instance,
|
||||||
void* router_session,
|
MXS_ROUTER_SESSION* router_session,
|
||||||
GWBUF* buffer,
|
GWBUF* buffer,
|
||||||
DCB* backend_dcb)
|
DCB* backend_dcb)
|
||||||
{
|
{
|
||||||
@ -3555,12 +3555,12 @@ return_succp:
|
|||||||
* Even if succp == true connecting to new slave may have failed. succp is to
|
* Even if succp == true connecting to new slave may have failed. succp is to
|
||||||
* tell whether router has enough master/slave connections to continue work.
|
* tell whether router has enough master/slave connections to continue work.
|
||||||
*/
|
*/
|
||||||
static void handleError(MXS_ROUTER* instance,
|
static void handleError(MXS_ROUTER* instance,
|
||||||
void* router_session,
|
MXS_ROUTER_SESSION* router_session,
|
||||||
GWBUF* errmsgbuf,
|
GWBUF* errmsgbuf,
|
||||||
DCB* problem_dcb,
|
DCB* problem_dcb,
|
||||||
mxs_error_action_t action,
|
mxs_error_action_t action,
|
||||||
bool* succp)
|
bool* succp)
|
||||||
{
|
{
|
||||||
MXS_SESSION* session;
|
MXS_SESSION* session;
|
||||||
ROUTER_INSTANCE* inst = (ROUTER_INSTANCE *)instance;
|
ROUTER_INSTANCE* inst = (ROUTER_INSTANCE *)instance;
|
||||||
|
|||||||
@ -15,20 +15,20 @@
|
|||||||
#include <maxscale/router.h>
|
#include <maxscale/router.h>
|
||||||
#include <maxscale/modinfo.h>
|
#include <maxscale/modinfo.h>
|
||||||
|
|
||||||
static MXS_ROUTER *createInstance(SERVICE *service, char **options);
|
static MXS_ROUTER *createInstance(SERVICE *service, char **options);
|
||||||
static void *newSession(MXS_ROUTER *instance, MXS_SESSION *session);
|
static MXS_ROUTER_SESSION *newSession(MXS_ROUTER *instance, MXS_SESSION *session);
|
||||||
static void closeSession(MXS_ROUTER *instance, void *session);
|
static void closeSession(MXS_ROUTER *instance, MXS_ROUTER_SESSION *session);
|
||||||
static void freeSession(MXS_ROUTER *instance, void *session);
|
static void freeSession(MXS_ROUTER *instance, MXS_ROUTER_SESSION *session);
|
||||||
static int routeQuery(MXS_ROUTER *instance, void *session, GWBUF *queue);
|
static int routeQuery(MXS_ROUTER *instance, MXS_ROUTER_SESSION *session, GWBUF *queue);
|
||||||
static void clientReply(MXS_ROUTER *instance, void *session, GWBUF *queue, DCB*);
|
static void clientReply(MXS_ROUTER *instance, MXS_ROUTER_SESSION *session, GWBUF *queue, DCB*);
|
||||||
static void diagnostic(MXS_ROUTER *instance, DCB *dcb);
|
static void diagnostic(MXS_ROUTER *instance, DCB *dcb);
|
||||||
static uint64_t getCapabilities(MXS_ROUTER* instance);
|
static uint64_t getCapabilities(MXS_ROUTER* instance);
|
||||||
static void handleError(MXS_ROUTER *instance,
|
static void handleError(MXS_ROUTER *instance,
|
||||||
void *router_session,
|
MXS_ROUTER_SESSION *router_session,
|
||||||
GWBUF *errbuf,
|
GWBUF *errbuf,
|
||||||
DCB *backend_dcb,
|
DCB *backend_dcb,
|
||||||
mxs_error_action_t action,
|
mxs_error_action_t action,
|
||||||
bool *succp);
|
bool *succp);
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
@ -104,10 +104,10 @@ createInstance(SERVICE *service, char **options)
|
|||||||
* @param session The session itself
|
* @param session The session itself
|
||||||
* @return Session specific data for this session
|
* @return Session specific data for this session
|
||||||
*/
|
*/
|
||||||
static void *
|
static MXS_ROUTER_SESSION *
|
||||||
newSession(MXS_ROUTER *instance, MXS_SESSION *session)
|
newSession(MXS_ROUTER *instance, MXS_SESSION *session)
|
||||||
{
|
{
|
||||||
return (MXS_SESSION*)MXS_MALLOC(sizeof(TESTSESSION));
|
return (MXS_ROUTER_SESSION*)MXS_MALLOC(sizeof(TESTSESSION));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -118,24 +118,23 @@ newSession(MXS_ROUTER *instance, MXS_SESSION *session)
|
|||||||
* @param session The session being closed
|
* @param session The session being closed
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
closeSession(MXS_ROUTER *instance, void *session)
|
closeSession(MXS_ROUTER *instance, MXS_ROUTER_SESSION *session)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static void freeSession(
|
static void freeSession(MXS_ROUTER* router_instance,
|
||||||
MXS_ROUTER* router_instance,
|
MXS_ROUTER_SESSION* router_client_session)
|
||||||
void* router_client_session)
|
|
||||||
{
|
{
|
||||||
MXS_FREE(router_client_session);
|
MXS_FREE(router_client_session);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
routeQuery(MXS_ROUTER *instance, void *session, GWBUF *queue)
|
routeQuery(MXS_ROUTER *instance, MXS_ROUTER_SESSION *session, GWBUF *queue)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void clientReply(MXS_ROUTER* instance, void* session, GWBUF* queue, DCB* dcb)
|
void clientReply(MXS_ROUTER* instance, MXS_ROUTER_SESSION* session, GWBUF* queue, DCB* dcb)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -156,12 +155,11 @@ static uint64_t getCapabilities(MXS_ROUTER* instance)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void handleError(
|
static void handleError(MXS_ROUTER *instance,
|
||||||
MXS_ROUTER *instance,
|
MXS_ROUTER_SESSION *router_session,
|
||||||
void *router_session,
|
GWBUF *errbuf,
|
||||||
GWBUF *errbuf,
|
DCB *backend_dcb,
|
||||||
DCB *backend_dcb,
|
mxs_error_action_t action,
|
||||||
mxs_error_action_t action,
|
bool *succp)
|
||||||
bool *succp)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user