Move module object inside MODULE_INFO
This allows modules to only expose one entry point with a consistent signature. In the future, this could be used to implement declarations of module parameters.
This commit is contained in:
24
server/modules/filter/cache/cachefilter.cc
vendored
24
server/modules/filter/cache/cachefilter.cc
vendored
@ -193,16 +193,7 @@ bool config_get_uint64(const FILTER_PARAMETER& param, uint64_t* pValue)
|
||||
// Global symbols of the Module
|
||||
//
|
||||
|
||||
MODULE_INFO info =
|
||||
{
|
||||
MODULE_API_FILTER,
|
||||
MODULE_IN_DEVELOPMENT,
|
||||
FILTER_VERSION,
|
||||
"A caching filter that is capable of caching and returning cached data.",
|
||||
VERSION_STRING
|
||||
};
|
||||
|
||||
extern "C" FILTER_OBJECT *GetModuleObject()
|
||||
extern "C" MODULE_INFO* GetModuleObject()
|
||||
{
|
||||
static modulecmd_arg_type_t show_argv[] =
|
||||
{
|
||||
@ -214,7 +205,18 @@ extern "C" FILTER_OBJECT *GetModuleObject()
|
||||
MXS_ARRAY_NELEMS(show_argv), show_argv);
|
||||
|
||||
MXS_NOTICE("Initialized cache module %s.\n", VERSION_STRING);
|
||||
return &CacheFilter::s_object;
|
||||
|
||||
static MODULE_INFO info =
|
||||
{
|
||||
MODULE_API_FILTER,
|
||||
MODULE_IN_DEVELOPMENT,
|
||||
FILTER_VERSION,
|
||||
"A caching filter that is capable of caching and returning cached data.",
|
||||
VERSION_STRING,
|
||||
&CacheFilter::s_object
|
||||
};
|
||||
|
||||
return &info;
|
||||
};
|
||||
|
||||
//
|
||||
|
@ -46,15 +46,6 @@
|
||||
* @endverbatim
|
||||
*/
|
||||
|
||||
MODULE_INFO info =
|
||||
{
|
||||
MODULE_API_FILTER,
|
||||
MODULE_GA,
|
||||
FILTER_VERSION,
|
||||
"A routing hint filter that send queries to the master after data modification",
|
||||
"V1.1.0"
|
||||
};
|
||||
|
||||
static FILTER *createInstance(const char *name, char **options, FILTER_PARAMETER **params);
|
||||
static void *newSession(FILTER *instance, SESSION *session);
|
||||
static void closeSession(FILTER *instance, void *session);
|
||||
@ -64,22 +55,6 @@ static int routeQuery(FILTER *instance, void *fsession, GWBUF *queue);
|
||||
static void diagnostic(FILTER *instance, void *fsession, DCB *dcb);
|
||||
static uint64_t getCapabilities(void);
|
||||
|
||||
|
||||
static FILTER_OBJECT MyObject =
|
||||
{
|
||||
createInstance,
|
||||
newSession,
|
||||
closeSession,
|
||||
freeSession,
|
||||
setDownstream,
|
||||
NULL, // No Upstream requirement
|
||||
routeQuery,
|
||||
NULL, // No clientReply
|
||||
diagnostic,
|
||||
getCapabilities,
|
||||
NULL, // No destroyInstance
|
||||
};
|
||||
|
||||
#define CCR_DEFAULT_TIME 60
|
||||
|
||||
typedef struct lagstats
|
||||
@ -124,10 +99,34 @@ typedef struct
|
||||
*
|
||||
* @return The module object
|
||||
*/
|
||||
FILTER_OBJECT *
|
||||
GetModuleObject()
|
||||
MODULE_INFO* GetModuleObject()
|
||||
{
|
||||
return &MyObject;
|
||||
static FILTER_OBJECT MyObject =
|
||||
{
|
||||
createInstance,
|
||||
newSession,
|
||||
closeSession,
|
||||
freeSession,
|
||||
setDownstream,
|
||||
NULL, // No Upstream requirement
|
||||
routeQuery,
|
||||
NULL, // No clientReply
|
||||
diagnostic,
|
||||
getCapabilities,
|
||||
NULL, // No destroyInstance
|
||||
};
|
||||
|
||||
static MODULE_INFO info =
|
||||
{
|
||||
MODULE_API_FILTER,
|
||||
MODULE_GA,
|
||||
FILTER_VERSION,
|
||||
"A routing hint filter that send queries to the master after data modification",
|
||||
"V1.1.0",
|
||||
&MyObject
|
||||
};
|
||||
|
||||
return &info;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -91,15 +91,6 @@
|
||||
int dbfw_yyparse(void*);
|
||||
#endif
|
||||
|
||||
MODULE_INFO info =
|
||||
{
|
||||
MODULE_API_FILTER,
|
||||
MODULE_GA,
|
||||
FILTER_VERSION,
|
||||
"Firewall Filter",
|
||||
"V1.2.0"
|
||||
};
|
||||
|
||||
/*
|
||||
* The filter entry points
|
||||
*/
|
||||
@ -112,21 +103,6 @@ static int routeQuery(FILTER *instance, void *fsession, GWBUF *queue);
|
||||
static void diagnostic(FILTER *instance, void *fsession, DCB *dcb);
|
||||
static uint64_t getCapabilities(void);
|
||||
|
||||
static FILTER_OBJECT MyObject =
|
||||
{
|
||||
createInstance,
|
||||
newSession,
|
||||
closeSession,
|
||||
freeSession,
|
||||
setDownstream,
|
||||
NULL, // No setUpStream
|
||||
routeQuery,
|
||||
NULL, // No clientReply
|
||||
diagnostic,
|
||||
getCapabilities,
|
||||
NULL, // No destroyInstance
|
||||
};
|
||||
|
||||
/**
|
||||
* Rule types
|
||||
*/
|
||||
@ -801,7 +777,7 @@ bool dbfw_show_rules(const MODULECMD_ARG *argv)
|
||||
*
|
||||
* @return The module object
|
||||
*/
|
||||
FILTER_OBJECT * GetModuleObject()
|
||||
MODULE_INFO* GetModuleObject()
|
||||
{
|
||||
modulecmd_arg_type_t args_rules_reload[] =
|
||||
{
|
||||
@ -818,7 +794,33 @@ FILTER_OBJECT * GetModuleObject()
|
||||
};
|
||||
|
||||
modulecmd_register_command("dbfwfilter", "rules", dbfw_show_rules, 2, args_rules_show);
|
||||
return &MyObject;
|
||||
|
||||
static FILTER_OBJECT MyObject =
|
||||
{
|
||||
createInstance,
|
||||
newSession,
|
||||
closeSession,
|
||||
freeSession,
|
||||
setDownstream,
|
||||
NULL, // No setUpStream
|
||||
routeQuery,
|
||||
NULL, // No clientReply
|
||||
diagnostic,
|
||||
getCapabilities,
|
||||
NULL, // No destroyInstance
|
||||
};
|
||||
|
||||
static MODULE_INFO info =
|
||||
{
|
||||
MODULE_API_FILTER,
|
||||
MODULE_GA,
|
||||
FILTER_VERSION,
|
||||
"Firewall Filter",
|
||||
"V1.2.0",
|
||||
&MyObject
|
||||
};
|
||||
|
||||
return &info;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -23,15 +23,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
MODULE_INFO info =
|
||||
{
|
||||
MODULE_API_FILTER,
|
||||
MODULE_ALPHA_RELEASE,
|
||||
FILTER_VERSION,
|
||||
"A hint parsing filter",
|
||||
"V1.0.0"
|
||||
};
|
||||
|
||||
static FILTER *createInstance(const char* name, char **options, FILTER_PARAMETER **params);
|
||||
static void *newSession(FILTER *instance, SESSION *session);
|
||||
static void closeSession(FILTER *instance, void *session);
|
||||
@ -41,22 +32,6 @@ static int routeQuery(FILTER *instance, void *fsession, GWBUF *queue);
|
||||
static void diagnostic(FILTER *instance, void *fsession, DCB *dcb);
|
||||
static uint64_t getCapabilities(void);
|
||||
|
||||
|
||||
static FILTER_OBJECT MyObject =
|
||||
{
|
||||
createInstance,
|
||||
newSession,
|
||||
closeSession,
|
||||
freeSession,
|
||||
setDownstream,
|
||||
NULL, // No upstream requirement
|
||||
routeQuery,
|
||||
NULL, // No clientReply
|
||||
diagnostic,
|
||||
getCapabilities,
|
||||
NULL, // No destroyInstance
|
||||
};
|
||||
|
||||
/**
|
||||
* The module entry point routine. It is this routine that
|
||||
* must populate the structure that is referred to as the
|
||||
@ -65,10 +40,34 @@ static FILTER_OBJECT MyObject =
|
||||
*
|
||||
* @return The module object
|
||||
*/
|
||||
FILTER_OBJECT *
|
||||
GetModuleObject()
|
||||
MODULE_INFO* GetModuleObject()
|
||||
{
|
||||
return &MyObject;
|
||||
static FILTER_OBJECT MyObject =
|
||||
{
|
||||
createInstance,
|
||||
newSession,
|
||||
closeSession,
|
||||
freeSession,
|
||||
setDownstream,
|
||||
NULL, // No upstream requirement
|
||||
routeQuery,
|
||||
NULL, // No clientReply
|
||||
diagnostic,
|
||||
getCapabilities,
|
||||
NULL, // No destroyInstance
|
||||
};
|
||||
|
||||
static MODULE_INFO info =
|
||||
{
|
||||
MODULE_API_FILTER,
|
||||
MODULE_ALPHA_RELEASE,
|
||||
FILTER_VERSION,
|
||||
"A hint parsing filter",
|
||||
"V1.0.0",
|
||||
&MyObject
|
||||
};
|
||||
|
||||
return &info;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -50,15 +50,6 @@
|
||||
#include <maxscale/session.h>
|
||||
#include <maxscale/spinlock.h>
|
||||
|
||||
MODULE_INFO info =
|
||||
{
|
||||
MODULE_API_FILTER,
|
||||
MODULE_EXPERIMENTAL,
|
||||
FILTER_VERSION,
|
||||
"Lua Filter",
|
||||
"V1.0.0"
|
||||
};
|
||||
|
||||
/*
|
||||
* The filter entry points
|
||||
*/
|
||||
@ -73,22 +64,6 @@ static int clientReply(FILTER *instance, void *fsession, GWBUF *queue);
|
||||
static void diagnostic(FILTER *instance, void *fsession, DCB *dcb);
|
||||
static uint64_t getCapabilities(void);
|
||||
|
||||
|
||||
static FILTER_OBJECT MyObject =
|
||||
{
|
||||
createInstance,
|
||||
newSession,
|
||||
closeSession,
|
||||
freeSession,
|
||||
setDownstream,
|
||||
setUpstream,
|
||||
routeQuery,
|
||||
clientReply,
|
||||
diagnostic,
|
||||
getCapabilities,
|
||||
NULL, // No destroyInstance
|
||||
};
|
||||
|
||||
/**
|
||||
* The module entry point routine. It is this routine that
|
||||
* must populate the structure that is referred to as the
|
||||
@ -97,10 +72,34 @@ static FILTER_OBJECT MyObject =
|
||||
*
|
||||
* @return The module object
|
||||
*/
|
||||
FILTER_OBJECT *
|
||||
GetModuleObject()
|
||||
MODULE_INFO* GetModuleObject()
|
||||
{
|
||||
return &MyObject;
|
||||
static FILTER_OBJECT MyObject =
|
||||
{
|
||||
createInstance,
|
||||
newSession,
|
||||
closeSession,
|
||||
freeSession,
|
||||
setDownstream,
|
||||
setUpstream,
|
||||
routeQuery,
|
||||
clientReply,
|
||||
diagnostic,
|
||||
getCapabilities,
|
||||
NULL, // No destroyInstance
|
||||
};
|
||||
|
||||
static MODULE_INFO info =
|
||||
{
|
||||
MODULE_API_FILTER,
|
||||
MODULE_EXPERIMENTAL,
|
||||
FILTER_VERSION,
|
||||
"Lua Filter",
|
||||
"V1.0.0",
|
||||
&MyObject
|
||||
};
|
||||
|
||||
return &info;
|
||||
}
|
||||
|
||||
static int id_pool = 0;
|
||||
|
@ -18,19 +18,21 @@
|
||||
// Global symbols of the Module
|
||||
//
|
||||
|
||||
MODULE_INFO info =
|
||||
{
|
||||
MODULE_API_FILTER,
|
||||
MODULE_IN_DEVELOPMENT,
|
||||
FILTER_VERSION,
|
||||
"A masking filter that is capable of masking/obfuscating returned column values.",
|
||||
"V1.0.0"
|
||||
};
|
||||
|
||||
extern "C" FILTER_OBJECT *GetModuleObject()
|
||||
extern "C" MODULE_INFO* GetModuleObject()
|
||||
{
|
||||
MXS_NOTICE("Initialized masking module.");
|
||||
return &MaskingFilter::s_object;
|
||||
|
||||
static MODULE_INFO info =
|
||||
{
|
||||
MODULE_API_FILTER,
|
||||
MODULE_IN_DEVELOPMENT,
|
||||
FILTER_VERSION,
|
||||
"A masking filter that is capable of masking/obfuscating returned column values.",
|
||||
"V1.0.0",
|
||||
&MaskingFilter::s_object
|
||||
};
|
||||
|
||||
return &info;
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -59,38 +59,39 @@ static uint64_t getCapabilities(void);
|
||||
|
||||
/* Global symbols of the Module */
|
||||
|
||||
MODULE_INFO info =
|
||||
{
|
||||
MODULE_API_FILTER,
|
||||
MODULE_IN_DEVELOPMENT,
|
||||
FILTER_VERSION,
|
||||
"A filter that is capable of limiting the resultset number of rows.",
|
||||
"V1.0.0"
|
||||
};
|
||||
|
||||
/**
|
||||
* The module entry point function, called when the module is loaded.
|
||||
*
|
||||
* @return The module object.
|
||||
*/
|
||||
FILTER_OBJECT *GetModuleObject()
|
||||
MODULE_INFO* GetModuleObject()
|
||||
{
|
||||
static FILTER_OBJECT object =
|
||||
{
|
||||
createInstance,
|
||||
newSession,
|
||||
closeSession,
|
||||
freeSession,
|
||||
setDownstream,
|
||||
setUpstream,
|
||||
routeQuery,
|
||||
clientReply,
|
||||
diagnostics,
|
||||
getCapabilities,
|
||||
NULL, // No destroyInstance
|
||||
};
|
||||
{
|
||||
createInstance,
|
||||
newSession,
|
||||
closeSession,
|
||||
freeSession,
|
||||
setDownstream,
|
||||
setUpstream,
|
||||
routeQuery,
|
||||
clientReply,
|
||||
diagnostics,
|
||||
getCapabilities,
|
||||
NULL, // No destroyInstance
|
||||
};
|
||||
|
||||
return &object;
|
||||
static MODULE_INFO info =
|
||||
{
|
||||
MODULE_API_FILTER,
|
||||
MODULE_IN_DEVELOPMENT,
|
||||
FILTER_VERSION,
|
||||
"A filter that is capable of limiting the resultset number of rows.",
|
||||
"V1.0.0",
|
||||
&object
|
||||
};
|
||||
|
||||
return &info;
|
||||
};
|
||||
|
||||
/* Implementation */
|
||||
|
@ -78,15 +78,6 @@
|
||||
#include <maxscale/housekeeper.h>
|
||||
#include <maxscale/alloc.h>
|
||||
|
||||
MODULE_INFO info =
|
||||
{
|
||||
MODULE_API_FILTER,
|
||||
MODULE_ALPHA_RELEASE,
|
||||
FILTER_VERSION,
|
||||
"A RabbitMQ query logging filter",
|
||||
"V1.0.2"
|
||||
};
|
||||
|
||||
static int uid_gen;
|
||||
static int hktask_id = 0;
|
||||
/*
|
||||
@ -103,22 +94,6 @@ static int clientReply(FILTER *instance, void *fsession, GWBUF *queue);
|
||||
static void diagnostic(FILTER *instance, void *fsession, DCB *dcb);
|
||||
static uint64_t getCapabilities(void);
|
||||
|
||||
|
||||
static FILTER_OBJECT MyObject =
|
||||
{
|
||||
createInstance,
|
||||
newSession,
|
||||
closeSession,
|
||||
freeSession,
|
||||
setDownstream,
|
||||
setUpstream,
|
||||
routeQuery,
|
||||
clientReply,
|
||||
diagnostic,
|
||||
getCapabilities,
|
||||
NULL, // No destroyInstance
|
||||
};
|
||||
|
||||
/**
|
||||
*Structure used to store messages and their properties.
|
||||
*/
|
||||
@ -270,10 +245,34 @@ void sendMessage(void* data);
|
||||
*
|
||||
* @return The module object
|
||||
*/
|
||||
FILTER_OBJECT *
|
||||
GetModuleObject()
|
||||
MODULE_INFO* GetModuleObject()
|
||||
{
|
||||
return &MyObject;
|
||||
static FILTER_OBJECT MyObject =
|
||||
{
|
||||
createInstance,
|
||||
newSession,
|
||||
closeSession,
|
||||
freeSession,
|
||||
setDownstream,
|
||||
setUpstream,
|
||||
routeQuery,
|
||||
clientReply,
|
||||
diagnostic,
|
||||
getCapabilities,
|
||||
NULL, // No destroyInstance
|
||||
};
|
||||
|
||||
static MODULE_INFO info =
|
||||
{
|
||||
MODULE_API_FILTER,
|
||||
MODULE_ALPHA_RELEASE,
|
||||
FILTER_VERSION,
|
||||
"A RabbitMQ query logging filter",
|
||||
"V1.0.2",
|
||||
&MyObject
|
||||
};
|
||||
|
||||
return &info;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -40,15 +40,6 @@
|
||||
* @endverbatim
|
||||
*/
|
||||
|
||||
MODULE_INFO info =
|
||||
{
|
||||
MODULE_API_FILTER,
|
||||
MODULE_GA,
|
||||
FILTER_VERSION,
|
||||
"A routing hint filter that uses regular expressions to direct queries",
|
||||
"V1.1.0"
|
||||
};
|
||||
|
||||
static FILTER *createInstance(const char *name, char **options, FILTER_PARAMETER **params);
|
||||
static void *newSession(FILTER *instance, SESSION *session);
|
||||
static void closeSession(FILTER *instance, void *session);
|
||||
@ -58,22 +49,6 @@ static int routeQuery(FILTER *instance, void *fsession, GWBUF *queue);
|
||||
static void diagnostic(FILTER *instance, void *fsession, DCB *dcb);
|
||||
static uint64_t getCapabilities(void);
|
||||
|
||||
|
||||
static FILTER_OBJECT MyObject =
|
||||
{
|
||||
createInstance,
|
||||
newSession,
|
||||
closeSession,
|
||||
freeSession,
|
||||
setDownstream,
|
||||
NULL, // No Upstream requirement
|
||||
routeQuery,
|
||||
NULL, // No clientReply
|
||||
diagnostic,
|
||||
getCapabilities,
|
||||
NULL, // No destroyInstance
|
||||
};
|
||||
|
||||
/**
|
||||
* Instance structure
|
||||
*/
|
||||
@ -105,10 +80,34 @@ typedef struct
|
||||
*
|
||||
* @return The module object
|
||||
*/
|
||||
FILTER_OBJECT *
|
||||
GetModuleObject()
|
||||
MODULE_INFO* GetModuleObject()
|
||||
{
|
||||
return &MyObject;
|
||||
static FILTER_OBJECT MyObject =
|
||||
{
|
||||
createInstance,
|
||||
newSession,
|
||||
closeSession,
|
||||
freeSession,
|
||||
setDownstream,
|
||||
NULL, // No Upstream requirement
|
||||
routeQuery,
|
||||
NULL, // No clientReply
|
||||
diagnostic,
|
||||
getCapabilities,
|
||||
NULL, // No destroyInstance
|
||||
};
|
||||
|
||||
static MODULE_INFO info =
|
||||
{
|
||||
MODULE_API_FILTER,
|
||||
MODULE_GA,
|
||||
FILTER_VERSION,
|
||||
"A routing hint filter that uses regular expressions to direct queries",
|
||||
"V1.1.0",
|
||||
&MyObject
|
||||
};
|
||||
|
||||
return &info;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -50,15 +50,6 @@
|
||||
#include <maxscale/alloc.h>
|
||||
#include <maxscale/service.h>
|
||||
|
||||
MODULE_INFO info =
|
||||
{
|
||||
MODULE_API_FILTER,
|
||||
MODULE_GA,
|
||||
FILTER_VERSION,
|
||||
"A simple query logging filter",
|
||||
"V1.1.1"
|
||||
};
|
||||
|
||||
/** Date string buffer size */
|
||||
#define QLA_DATE_BUFFER_SIZE 20
|
||||
|
||||
@ -88,22 +79,6 @@ static int routeQuery(FILTER *instance, void *fsession, GWBUF *queue);
|
||||
static void diagnostic(FILTER *instance, void *fsession, DCB *dcb);
|
||||
static uint64_t getCapabilities(void);
|
||||
|
||||
|
||||
static FILTER_OBJECT MyObject =
|
||||
{
|
||||
createInstance,
|
||||
newSession,
|
||||
closeSession,
|
||||
freeSession,
|
||||
setDownstream,
|
||||
NULL, // No Upstream requirement
|
||||
routeQuery,
|
||||
NULL, // No client reply
|
||||
diagnostic,
|
||||
getCapabilities,
|
||||
NULL, // No destroyInstance
|
||||
};
|
||||
|
||||
/**
|
||||
* A instance structure, the assumption is that the option passed
|
||||
* to the filter is simply a base for the filename to which the queries
|
||||
@ -164,10 +139,34 @@ static int write_log_entry(uint32_t, FILE*, QLA_INSTANCE*, QLA_SESSION*, const c
|
||||
*
|
||||
* @return The module object
|
||||
*/
|
||||
FILTER_OBJECT *
|
||||
GetModuleObject()
|
||||
MODULE_INFO* GetModuleObject()
|
||||
{
|
||||
return &MyObject;
|
||||
static FILTER_OBJECT MyObject =
|
||||
{
|
||||
createInstance,
|
||||
newSession,
|
||||
closeSession,
|
||||
freeSession,
|
||||
setDownstream,
|
||||
NULL, // No Upstream requirement
|
||||
routeQuery,
|
||||
NULL, // No client reply
|
||||
diagnostic,
|
||||
getCapabilities,
|
||||
NULL, // No destroyInstance
|
||||
};
|
||||
|
||||
static MODULE_INFO info =
|
||||
{
|
||||
MODULE_API_FILTER,
|
||||
MODULE_GA,
|
||||
FILTER_VERSION,
|
||||
"A simple query logging filter",
|
||||
"V1.1.1",
|
||||
&MyObject
|
||||
};
|
||||
|
||||
return &info;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -40,15 +40,6 @@
|
||||
* @endverbatim
|
||||
*/
|
||||
|
||||
MODULE_INFO info =
|
||||
{
|
||||
MODULE_API_FILTER,
|
||||
MODULE_GA,
|
||||
FILTER_VERSION,
|
||||
"A query rewrite filter that uses regular expressions to rewrite queries",
|
||||
"V1.1.0"
|
||||
};
|
||||
|
||||
static FILTER *createInstance(const char *name, char **options, FILTER_PARAMETER **params);
|
||||
static void *newSession(FILTER *instance, SESSION *session);
|
||||
static void closeSession(FILTER *instance, void *session);
|
||||
@ -61,21 +52,6 @@ static uint64_t getCapabilities(void);
|
||||
static char *regex_replace(const char *sql, pcre2_code *re, pcre2_match_data *study,
|
||||
const char *replace);
|
||||
|
||||
static FILTER_OBJECT MyObject =
|
||||
{
|
||||
createInstance,
|
||||
newSession,
|
||||
closeSession,
|
||||
freeSession,
|
||||
setDownstream,
|
||||
NULL, // No Upstream requirement
|
||||
routeQuery,
|
||||
NULL, // No clientReply
|
||||
diagnostic,
|
||||
getCapabilities,
|
||||
NULL, // No destroyInstance
|
||||
};
|
||||
|
||||
/**
|
||||
* Instance structure
|
||||
*/
|
||||
@ -114,10 +90,34 @@ void log_nomatch(REGEX_INSTANCE* inst, char* re, char* old);
|
||||
*
|
||||
* @return The module object
|
||||
*/
|
||||
FILTER_OBJECT *
|
||||
GetModuleObject()
|
||||
MODULE_INFO* GetModuleObject()
|
||||
{
|
||||
return &MyObject;
|
||||
static FILTER_OBJECT MyObject =
|
||||
{
|
||||
createInstance,
|
||||
newSession,
|
||||
closeSession,
|
||||
freeSession,
|
||||
setDownstream,
|
||||
NULL, // No Upstream requirement
|
||||
routeQuery,
|
||||
NULL, // No clientReply
|
||||
diagnostic,
|
||||
getCapabilities,
|
||||
NULL, // No destroyInstance
|
||||
};
|
||||
|
||||
static MODULE_INFO info =
|
||||
{
|
||||
MODULE_API_FILTER,
|
||||
MODULE_GA,
|
||||
FILTER_VERSION,
|
||||
"A query rewrite filter that uses regular expressions to rewrite queries",
|
||||
"V1.1.0",
|
||||
&MyObject
|
||||
};
|
||||
|
||||
return &info;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -94,15 +94,6 @@ static unsigned char required_packets[] =
|
||||
0
|
||||
};
|
||||
|
||||
MODULE_INFO info =
|
||||
{
|
||||
MODULE_API_FILTER,
|
||||
MODULE_GA,
|
||||
FILTER_VERSION,
|
||||
"A tee piece in the filter plumbing",
|
||||
"V1.0.0"
|
||||
};
|
||||
|
||||
/*
|
||||
* The filter entry points
|
||||
*/
|
||||
@ -117,21 +108,6 @@ static int clientReply(FILTER *instance, void *fsession, GWBUF *queue);
|
||||
static void diagnostic(FILTER *instance, void *fsession, DCB *dcb);
|
||||
static uint64_t getCapabilities(void);
|
||||
|
||||
static FILTER_OBJECT MyObject =
|
||||
{
|
||||
createInstance,
|
||||
newSession,
|
||||
closeSession,
|
||||
freeSession,
|
||||
setDownstream,
|
||||
setUpstream,
|
||||
routeQuery,
|
||||
clientReply,
|
||||
diagnostic,
|
||||
getCapabilities,
|
||||
NULL, // No destroyInstance
|
||||
};
|
||||
|
||||
/**
|
||||
* The instance structure for the TEE filter - this holds the configuration
|
||||
* information for the filter.
|
||||
@ -313,14 +289,39 @@ orphan_free(void* data)
|
||||
*
|
||||
* @return The module object
|
||||
*/
|
||||
FILTER_OBJECT *
|
||||
GetModuleObject()
|
||||
MODULE_INFO* GetModuleObject()
|
||||
{
|
||||
spinlock_init(&orphanLock);
|
||||
#ifdef SS_DEBUG
|
||||
spinlock_init(&debug_lock);
|
||||
#endif
|
||||
return &MyObject;
|
||||
|
||||
static FILTER_OBJECT MyObject =
|
||||
{
|
||||
createInstance,
|
||||
newSession,
|
||||
closeSession,
|
||||
freeSession,
|
||||
setDownstream,
|
||||
setUpstream,
|
||||
routeQuery,
|
||||
clientReply,
|
||||
diagnostic,
|
||||
getCapabilities,
|
||||
NULL, // No destroyInstance
|
||||
};
|
||||
|
||||
static MODULE_INFO info =
|
||||
{
|
||||
MODULE_API_FILTER,
|
||||
MODULE_GA,
|
||||
FILTER_VERSION,
|
||||
"A tee piece in the filter plumbing",
|
||||
"V1.0.0",
|
||||
&MyObject
|
||||
};
|
||||
|
||||
return &info;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -29,14 +29,6 @@
|
||||
* @endverbatim
|
||||
*/
|
||||
|
||||
MODULE_INFO info =
|
||||
{
|
||||
MODULE_API_FILTER,
|
||||
MODULE_BETA_RELEASE,
|
||||
FILTER_VERSION,
|
||||
"A simple query counting filter",
|
||||
"V2.0.0"
|
||||
};
|
||||
|
||||
static FILTER *createInstance(const char *name, char **options, FILTER_PARAMETER **params);
|
||||
static void *newSession(FILTER *instance, SESSION *session);
|
||||
@ -49,20 +41,7 @@ static uint64_t getCapabilities(void);
|
||||
static void destroyInstance(FILTER *instance);
|
||||
|
||||
|
||||
static FILTER_OBJECT MyObject =
|
||||
{
|
||||
createInstance,
|
||||
newSession,
|
||||
closeSession,
|
||||
freeSession,
|
||||
setDownstream,
|
||||
NULL, // No upstream requirement
|
||||
routeQuery,
|
||||
NULL, // No clientReply
|
||||
diagnostic,
|
||||
getCapabilities,
|
||||
destroyInstance,
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* A dummy instance structure
|
||||
@ -90,10 +69,34 @@ typedef struct
|
||||
*
|
||||
* @return The module object
|
||||
*/
|
||||
FILTER_OBJECT *
|
||||
GetModuleObject()
|
||||
MODULE_INFO* GetModuleObject()
|
||||
{
|
||||
return &MyObject;
|
||||
static FILTER_OBJECT MyObject =
|
||||
{
|
||||
createInstance,
|
||||
newSession,
|
||||
closeSession,
|
||||
freeSession,
|
||||
setDownstream,
|
||||
NULL, // No upstream requirement
|
||||
routeQuery,
|
||||
NULL, // No clientReply
|
||||
diagnostic,
|
||||
getCapabilities,
|
||||
destroyInstance,
|
||||
};
|
||||
|
||||
static MODULE_INFO info =
|
||||
{
|
||||
MODULE_API_FILTER,
|
||||
MODULE_BETA_RELEASE,
|
||||
FILTER_VERSION,
|
||||
"A simple query counting filter",
|
||||
"V2.0.0",
|
||||
&MyObject
|
||||
};
|
||||
|
||||
return &info;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -45,15 +45,6 @@
|
||||
#include <maxscale/atomic.h>
|
||||
#include <maxscale/alloc.h>
|
||||
|
||||
MODULE_INFO info =
|
||||
{
|
||||
MODULE_API_FILTER,
|
||||
MODULE_GA,
|
||||
FILTER_VERSION,
|
||||
"A top N query logging filter",
|
||||
"V1.0.1"
|
||||
};
|
||||
|
||||
/*
|
||||
* The filter entry points
|
||||
*/
|
||||
@ -68,22 +59,6 @@ static int clientReply(FILTER *instance, void *fsession, GWBUF *queue);
|
||||
static void diagnostic(FILTER *instance, void *fsession, DCB *dcb);
|
||||
static uint64_t getCapabilities(void);
|
||||
|
||||
|
||||
static FILTER_OBJECT MyObject =
|
||||
{
|
||||
createInstance,
|
||||
newSession,
|
||||
closeSession,
|
||||
freeSession,
|
||||
setDownstream,
|
||||
setUpstream,
|
||||
routeQuery,
|
||||
clientReply,
|
||||
diagnostic,
|
||||
getCapabilities,
|
||||
NULL, // No destroyInstance
|
||||
};
|
||||
|
||||
/**
|
||||
* A instance structure, the assumption is that the option passed
|
||||
* to the filter is simply a base for the filename to which the queries
|
||||
@ -148,10 +123,34 @@ typedef struct
|
||||
*
|
||||
* @return The module object
|
||||
*/
|
||||
FILTER_OBJECT *
|
||||
GetModuleObject()
|
||||
MODULE_INFO* GetModuleObject()
|
||||
{
|
||||
return &MyObject;
|
||||
static FILTER_OBJECT MyObject =
|
||||
{
|
||||
createInstance,
|
||||
newSession,
|
||||
closeSession,
|
||||
freeSession,
|
||||
setDownstream,
|
||||
setUpstream,
|
||||
routeQuery,
|
||||
clientReply,
|
||||
diagnostic,
|
||||
getCapabilities,
|
||||
NULL, // No destroyInstance
|
||||
};
|
||||
|
||||
static MODULE_INFO info =
|
||||
{
|
||||
MODULE_API_FILTER,
|
||||
MODULE_GA,
|
||||
FILTER_VERSION,
|
||||
"A top N query logging filter",
|
||||
"V1.0.1",
|
||||
&MyObject
|
||||
};
|
||||
|
||||
return &info;
|
||||
}
|
||||
/**
|
||||
* Create an instance of the filter for a particular service
|
||||
|
@ -64,15 +64,6 @@
|
||||
extern int lm_enabled_logfiles_bitmask;
|
||||
extern size_t log_ses_count[];
|
||||
|
||||
MODULE_INFO info =
|
||||
{
|
||||
MODULE_API_FILTER,
|
||||
MODULE_GA,
|
||||
FILTER_VERSION,
|
||||
"Transaction Performance Monitoring filter",
|
||||
"V1.0.1"
|
||||
};
|
||||
|
||||
static size_t buf_size = 10;
|
||||
static size_t sql_size_limit = 64 * 1024 *
|
||||
1024; /* The maximum size for query statements in a transaction (64MB) */
|
||||
@ -97,21 +88,6 @@ static void diagnostic(FILTER *instance, void *fsession, DCB *dcb);
|
||||
static uint64_t getCapabilities(void);
|
||||
static void checkNamedPipe(void *args);
|
||||
|
||||
static FILTER_OBJECT MyObject =
|
||||
{
|
||||
createInstance,
|
||||
newSession,
|
||||
closeSession,
|
||||
freeSession,
|
||||
setDownstream,
|
||||
setUpstream,
|
||||
routeQuery,
|
||||
clientReply,
|
||||
diagnostic,
|
||||
getCapabilities,
|
||||
NULL, // No destroyInstance
|
||||
};
|
||||
|
||||
/**
|
||||
* A instance structure, every instance will write to a same file.
|
||||
*/
|
||||
@ -166,10 +142,34 @@ typedef struct
|
||||
*
|
||||
* @return The module object
|
||||
*/
|
||||
FILTER_OBJECT *
|
||||
GetModuleObject()
|
||||
MODULE_INFO* GetModuleObject()
|
||||
{
|
||||
return &MyObject;
|
||||
static FILTER_OBJECT MyObject =
|
||||
{
|
||||
createInstance,
|
||||
newSession,
|
||||
closeSession,
|
||||
freeSession,
|
||||
setDownstream,
|
||||
setUpstream,
|
||||
routeQuery,
|
||||
clientReply,
|
||||
diagnostic,
|
||||
getCapabilities,
|
||||
NULL, // No destroyInstance
|
||||
};
|
||||
|
||||
static MODULE_INFO info =
|
||||
{
|
||||
MODULE_API_FILTER,
|
||||
MODULE_GA,
|
||||
FILTER_VERSION,
|
||||
"Transaction Performance Monitoring filter",
|
||||
"V1.0.1",
|
||||
&MyObject
|
||||
};
|
||||
|
||||
return &info;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user