Remove router_options

Relaced router_options with configuration parameters in the createInstance
router entry point. The same needs to be done for the filter API as barely
any filters use the feature.

Some routers (binlogrouter) still support router_options but using it is
deprecated. This had to be done as their use wasn't deprecated in 2.2.
This commit is contained in:
Markus Mäkelä
2018-07-10 05:42:01 +03:00
parent f11f8980b2
commit cbb8c68770
24 changed files with 49 additions and 216 deletions

View File

@ -90,11 +90,11 @@ typedef struct mxs_router_object
* other API functions.
*
* @param service The service where the instance is created
* @param options Router options
* @param params Parameters for the router
*
* @return New router instance on NULL on error
*/
MXS_ROUTER *(*createInstance)(SERVICE *service, char **options);
MXS_ROUTER *(*createInstance)(SERVICE* service, MXS_CONFIG_PARAMETER* params);
/**
* Called to create a new user session within the router
@ -240,7 +240,7 @@ typedef struct mxs_router_object
* must update these versions numbers in accordance with the rules in
* modinfo.h.
*/
#define MXS_ROUTER_VERSION { 3, 1, 0 }
#define MXS_ROUTER_VERSION { 4, 0, 0 }
/**
* Specifies capabilities specific for routers. Common capabilities

View File

@ -98,7 +98,7 @@ protected:
* class MyRouter : public maxscale::Router<MyRouter, MyRouterSession>
* {
* public:
* static MyRouter* create(SERVICE* pService, char** pzOptions);
* static MyRouter* create(SERVICE* pService, MXS_CONFIG_PARAMETER* params);
*
* MyRouterSession* newSession(MXS_SESSION* pSession);
*
@ -137,11 +137,11 @@ public:
return false;
}
static MXS_ROUTER* createInstance(SERVICE* pService, char** pzOptions)
static MXS_ROUTER* createInstance(SERVICE* pService, MXS_CONFIG_PARAMETER* params)
{
RouterType* pRouter = NULL;
MXS_EXCEPTION_GUARD(pRouter = RouterType::create(pService, pzOptions));
MXS_EXCEPTION_GUARD(pRouter = RouterType::create(pService, params));
return pRouter;
}

View File

@ -129,7 +129,6 @@ typedef struct service
SERV_LISTENER *ports; /**< Linked list of ports and protocols
* that this service will listen on */
char *routerModule; /**< Name of router module to use */
char **routerOptions; /**< Router specific option strings */
struct mxs_router_object *router; /**< The router we are using */
struct mxs_router *router_instance;/**< The router instance for this service */
char version_string[MAX_SERVICE_VERSION_LEN]; /**< version string for this service listeners */