Add module level static capabilities

The static capabilities declared in getCapabilities allows certain
capabilities to be queried before instances are created. The intended use
of this capability is to remove the need for the `is_internal_service`
function.
This commit is contained in:
Markus Mäkelä 2017-03-20 10:08:56 +02:00
parent 06c40eebd7
commit 1736aca7f7
54 changed files with 63 additions and 0 deletions

View File

@ -607,6 +607,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_ROUTER_VERSION, /* Implemented module API version */
"A simple round robin router", /* Description */
"V1.1.0", /* Module version */
MXS_NO_MODULE_CAPABILITIES,
&entryPoints, /* Defined above */
process_init, /* Process init, can be null */
process_finish, /* Process finish, can be null */

View File

@ -93,6 +93,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_FILTER_VERSION,
"A simple query counting filter",
"V2.0.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -117,6 +117,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_PROTOCOL_VERSION,
"Test protocol",
"V1.1.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -69,6 +69,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_ROUTER_VERSION,
"A test router - not for use in real systems",
"V1.0.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -18,6 +18,8 @@
#include <maxscale/cdefs.h>
#include <stdint.h>
MXS_BEGIN_DECLS
/**
@ -133,6 +135,7 @@ typedef struct mxs_module
MXS_MODULE_VERSION api_version; /**< Module API version */
const char *description; /**< Module description */
const char *version; /**< Module version */
uint64_t module_capabilities; /**< Declared module capabilities */
void *module_object; /**< Module type specific API implementation */
/**
* If non-NULL, this function is called once at process startup. If the
@ -175,6 +178,13 @@ typedef struct mxs_module
*/
#define MXS_END_MODULE_PARAMS 0
/**
* This value should be given to the @c module_capabilities member if the module
* declares no capabilities. Currently only routers and filters can declare
* capabilities.
*/
#define MXS_NO_MODULE_CAPABILITIES 0
/**
* Name of the module entry point
*

View File

@ -118,6 +118,7 @@ typedef enum router_capability
RCAP_TYPE_NO_RSESSION = 0x00010000, /**< Router does not use router sessions */
RCAP_TYPE_NO_USERS_INIT = 0x00020000, /**< Prevent the loading of authenticator
users when the service is started */
RCAP_TYPE_NO_AUTH = 0x00040000, /**< No `user` or `password` parameter required */
} mxs_router_capability_t;
typedef enum

View File

@ -148,6 +148,7 @@ extern "C"
QUERY_CLASSIFIER_VERSION,
"Dummy Query Classifier",
"V1.0.0",
MXS_NO_MODULE_CAPABILITIES,
&qc,
qc_dummy_process_init,
qc_dummy_process_end,

View File

@ -2752,6 +2752,7 @@ extern "C"
QUERY_CLASSIFIER_VERSION,
"Query classifier based upon MySQL Embedded",
"V1.0.0",
MXS_NO_MODULE_CAPABILITIES,
&qc,
qc_mysql_process_init,
qc_mysql_process_end,

View File

@ -3452,6 +3452,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
QUERY_CLASSIFIER_VERSION,
"Query classifier using sqlite.",
"V1.0.0",
MXS_NO_MODULE_CAPABILITIES,
&qc,
qc_sqlite_process_init,
qc_sqlite_process_end,

View File

@ -177,6 +177,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_AUTHENTICATOR_VERSION,
"The CDC client to MaxScale authenticator implementation",
"V1.1.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -676,6 +676,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_AUTHENTICATOR_VERSION,
"GSSAPI authenticator",
"V1.0.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -288,6 +288,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_AUTHENTICATOR_VERSION,
"GSSAPI backend authenticator",
"V1.0.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -78,6 +78,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_AUTHENTICATOR_VERSION,
"The MaxScale HTTP BA authenticator",
"V1.1.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -72,6 +72,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_AUTHENTICATOR_VERSION,
"The MaxScale Admin client authenticator implementation",
"V2.1.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -95,6 +95,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_AUTHENTICATOR_VERSION,
"The MySQL client to MaxScale authenticator implementation",
"V1.1.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -181,6 +181,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_AUTHENTICATOR_VERSION,
"The MySQL MaxScale to backend server authenticator",
"V1.0.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -74,6 +74,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_AUTHENTICATOR_VERSION,
"The Null client authenticator implementation",
"V1.1.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -71,6 +71,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_AUTHENTICATOR_VERSION,
"The Null client authenticator implementation",
"V1.1.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -134,6 +134,7 @@ extern "C" MXS_MODULE* MXS_CREATE_MODULE()
MXS_FILTER_VERSION,
"A caching filter that is capable of caching and returning cached data.",
VERSION_STRING,
MXS_NO_MODULE_CAPABILITIES,
&CacheFilter::s_object,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -134,6 +134,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_FILTER_VERSION,
"A routing hint filter that send queries to the master after data modification",
"V1.1.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -827,6 +827,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_FILTER_VERSION,
"Firewall Filter",
"V1.2.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -67,6 +67,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_FILTER_VERSION,
"A hint parsing filter",
"V1.0.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -110,6 +110,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_FILTER_VERSION,
"Data streaming filter",
"1.0.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL,
NULL,

View File

@ -98,6 +98,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_FILTER_VERSION,
"Lua Filter",
"V1.0.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -78,6 +78,7 @@ extern "C" MXS_MODULE* MXS_CREATE_MODULE()
MXS_FILTER_VERSION,
"A masking filter that is capable of masking/obfuscating returned column values.",
"V1.0.0",
MXS_NO_MODULE_CAPABILITIES,
&MaskingFilter::s_object,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -88,6 +88,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_FILTER_VERSION,
"A filter that is capable of limiting the resultset number of rows.",
"V1.0.0",
MXS_NO_MODULE_CAPABILITIES,
&object,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -281,6 +281,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_FILTER_VERSION,
"A RabbitMQ query logging filter",
"V1.0.2",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -780,6 +780,7 @@ extern "C" MXS_MODULE* MXS_CREATE_MODULE()
MXS_FILTER_VERSION,
"A routing hint filter that uses regular expressions to direct queries",
"V1.1.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -53,6 +53,7 @@ extern "C" MXS_MODULE* MXS_CREATE_MODULE()
MXS_FILTER_VERSION,
"A null filter that does nothing.",
VERSION_STRING,
MXS_NO_MODULE_CAPABILITIES,
&NullFilter::s_object,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -193,6 +193,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_FILTER_VERSION,
"A simple query logging filter",
"V1.1.1",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -123,6 +123,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_FILTER_VERSION,
"A query rewrite filter that uses regular expressions to rewrite queries",
"V1.1.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -326,6 +326,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_FILTER_VERSION,
"A tee piece in the filter plumbing",
"V1.0.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -157,6 +157,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_FILTER_VERSION,
"A top N query logging filter",
"V1.0.1",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -167,6 +167,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_FILTER_VERSION,
"Transaction Performance Monitoring filter",
"V1.0.1",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -273,6 +273,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_MONITOR_VERSION,
"Aurora monitor",
"V1.0.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -90,6 +90,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_MONITOR_VERSION,
"A Galera cluster monitor",
"V2.0.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -80,6 +80,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_MONITOR_VERSION,
"A Multi-Master Multi Master monitor",
"V1.1.1",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -116,6 +116,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_MONITOR_VERSION,
"A MySQL Master/Slave replication monitor",
"V1.5.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -72,6 +72,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_MONITOR_VERSION,
"A MySQL cluster SQL node monitor",
"V2.1.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -95,6 +95,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_PROTOCOL_VERSION,
"A Change Data Capture Listener implementation for use in binlog events retrieval",
"V1.0.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -91,6 +91,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_PROTOCOL_VERSION,
"An experimental HTTPD implementation for use in administration",
"V1.2.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -112,6 +112,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_PROTOCOL_VERSION,
"The MySQL to backend server protocol",
"V2.0.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -125,6 +125,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_PROTOCOL_VERSION,
"The client to MaxScale MySQL protocol implementation",
"V1.1.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
process_init,
process_finish,

View File

@ -193,6 +193,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_PROTOCOL_VERSION,
"A maxscale protocol for the administration interface",
"V2.0.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -112,6 +112,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_PROTOCOL_VERSION,
"A telnet deamon protocol for simple administration interface",
"V1.1.1",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -170,6 +170,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_ROUTER_VERSION,
"Binlogrouter",
"V1.0.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -171,6 +171,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_ROUTER_VERSION,
"Binlogrouter",
"V2.1.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -91,6 +91,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_ROUTER_VERSION,
"The admin user interface",
"V1.0.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -90,6 +90,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_ROUTER_VERSION,
"The debug user interface",
"V1.1.1",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -95,6 +95,7 @@ extern "C" MXS_MODULE* MXS_CREATE_MODULE()
MXS_ROUTER_VERSION, /* Implemented module API version */
"A hint router", /* Description */
"V1.0.0", /* Module version */
MXS_NO_MODULE_CAPABILITIES,
&HintRouter::s_object,
NULL, /* Process init, can be null */
NULL, /* Process finish, can be null */

View File

@ -116,6 +116,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_ROUTER_VERSION,
"The MaxScale Information Schema",
"V1.0.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -136,6 +136,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_ROUTER_VERSION,
"A connection based router to load balance based on connections",
"V1.1.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -161,6 +161,7 @@ MXS_MODULE *MXS_CREATE_MODULE()
MXS_MODULE_API_ROUTER, MXS_MODULE_GA, MXS_ROUTER_VERSION,
"A Read/Write splitting router for enhancement read scalability",
"V1.1.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */

View File

@ -618,6 +618,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
MXS_ROUTER_VERSION,
"A database sharding router for simple sharding",
"V1.0.0",
MXS_NO_MODULE_CAPABILITIES,
&MyObject,
NULL, /* Process init. */
NULL, /* Process finish. */