Add [process|thread] [init|finish] functions to modules
The MXS_MODULDE object now contains optinal pointers for functions to be called att process and thread startup and shutdown. Since the functions were added to the end, strictly speaking, all structures would not have needed to have been modified, but better to be explicit. In a subsequent change, these will be called. C++ does not support flexible arrays, so for the time being C++ modules are restricted to 10 parameters. Better approach is to factor out the parameters to a separate array and then just store a pointer to that array in MXS_MODULE.
This commit is contained in:
@ -161,6 +161,10 @@ MXS_MODULE* MXS_CREATE_MODULE()
|
||||
"Binlogrouter",
|
||||
"V1.0.0",
|
||||
&MyObject,
|
||||
NULL, /* Process init. */
|
||||
NULL, /* Process finish. */
|
||||
NULL, /* Thread init. */
|
||||
NULL, /* Thread finish. */
|
||||
{
|
||||
{
|
||||
"binlogdir",
|
||||
|
@ -161,7 +161,14 @@ MXS_MODULE* MXS_CREATE_MODULE()
|
||||
ROUTER_VERSION,
|
||||
"Binlogrouter",
|
||||
"V2.1.0",
|
||||
&MyObject
|
||||
&MyObject,
|
||||
NULL, /* Process init. */
|
||||
NULL, /* Process finish. */
|
||||
NULL, /* Thread init. */
|
||||
NULL, /* Thread finish. */
|
||||
{
|
||||
{MXS_END_MODULE_PARAMS}
|
||||
}
|
||||
};
|
||||
|
||||
return &info;
|
||||
|
@ -89,7 +89,14 @@ MXS_MODULE* MXS_CREATE_MODULE()
|
||||
ROUTER_VERSION,
|
||||
"The admin user interface",
|
||||
"V1.0.0",
|
||||
&MyObject
|
||||
&MyObject,
|
||||
NULL, /* Process init. */
|
||||
NULL, /* Process finish. */
|
||||
NULL, /* Thread init. */
|
||||
NULL, /* Thread finish. */
|
||||
{
|
||||
{MXS_END_MODULE_PARAMS}
|
||||
}
|
||||
};
|
||||
|
||||
return &info;
|
||||
|
@ -88,7 +88,14 @@ MXS_MODULE* MXS_CREATE_MODULE()
|
||||
ROUTER_VERSION,
|
||||
"The debug user interface",
|
||||
"V1.1.1",
|
||||
&MyObject
|
||||
&MyObject,
|
||||
NULL, /* Process init. */
|
||||
NULL, /* Process finish. */
|
||||
NULL, /* Thread init. */
|
||||
NULL, /* Thread finish. */
|
||||
{
|
||||
{MXS_END_MODULE_PARAMS}
|
||||
}
|
||||
};
|
||||
|
||||
return &info;
|
||||
|
@ -112,7 +112,14 @@ MXS_MODULE* MXS_CREATE_MODULE()
|
||||
ROUTER_VERSION,
|
||||
"The MaxScale Information Schema",
|
||||
"V1.0.0",
|
||||
&MyObject
|
||||
&MyObject,
|
||||
NULL, /* Process init. */
|
||||
NULL, /* Process finish. */
|
||||
NULL, /* Thread init. */
|
||||
NULL, /* Thread finish. */
|
||||
{
|
||||
{MXS_END_MODULE_PARAMS}
|
||||
}
|
||||
};
|
||||
|
||||
return &info;
|
||||
|
@ -145,7 +145,14 @@ MXS_MODULE* MXS_CREATE_MODULE()
|
||||
ROUTER_VERSION,
|
||||
"A connection based router to load balance based on connections",
|
||||
"V1.1.0",
|
||||
&MyObject
|
||||
&MyObject,
|
||||
NULL, /* Process init. */
|
||||
NULL, /* Process finish. */
|
||||
NULL, /* Thread init. */
|
||||
NULL, /* Thread finish. */
|
||||
{
|
||||
{MXS_END_MODULE_PARAMS}
|
||||
}
|
||||
};
|
||||
|
||||
return &info;
|
||||
|
@ -134,7 +134,14 @@ MXS_MODULE *MXS_CREATE_MODULE()
|
||||
MXS_MODULE_API_ROUTER, MXS_MODULE_GA, ROUTER_VERSION,
|
||||
"A Read/Write splitting router for enhancement read scalability",
|
||||
"V1.1.0",
|
||||
&MyObject
|
||||
&MyObject,
|
||||
NULL, /* Process init. */
|
||||
NULL, /* Process finish. */
|
||||
NULL, /* Thread init. */
|
||||
NULL, /* Thread finish. */
|
||||
{
|
||||
{MXS_END_MODULE_PARAMS}
|
||||
}
|
||||
};
|
||||
|
||||
MXS_NOTICE("Initializing statement-based read/write split router module.");
|
||||
|
@ -618,7 +618,14 @@ MXS_MODULE* MXS_CREATE_MODULE()
|
||||
ROUTER_VERSION,
|
||||
"A database sharding router for simple sharding",
|
||||
"V1.0.0",
|
||||
&MyObject
|
||||
&MyObject,
|
||||
NULL, /* Process init. */
|
||||
NULL, /* Process finish. */
|
||||
NULL, /* Thread init. */
|
||||
NULL, /* Thread finish. */
|
||||
{
|
||||
{MXS_END_MODULE_PARAMS}
|
||||
}
|
||||
};
|
||||
|
||||
return &info;
|
||||
|
@ -69,7 +69,14 @@ MXS_MODULE* MXS_CREATE_MODULE()
|
||||
ROUTER_VERSION,
|
||||
"A test router - not for use in real systems",
|
||||
"V1.0.0",
|
||||
&MyObject
|
||||
&MyObject,
|
||||
NULL, /* Process init. */
|
||||
NULL, /* Process finish. */
|
||||
NULL, /* Thread init. */
|
||||
NULL, /* Thread finish. */
|
||||
{
|
||||
{MXS_END_MODULE_PARAMS}
|
||||
}
|
||||
};
|
||||
|
||||
return &info;
|
||||
|
Reference in New Issue
Block a user