getCapabilities now get the instance as argument
Allows the capabilities to be different depending on how the filter/router has been configured.
This commit is contained in:
1
server/modules/filter/cache/cachefilter.cc
vendored
1
server/modules/filter/cache/cachefilter.cc
vendored
@ -271,7 +271,6 @@ void CacheFilter::diagnostics(DCB* pDcb)
|
||||
m_sCache->show(pDcb);
|
||||
}
|
||||
|
||||
// static
|
||||
uint64_t CacheFilter::getCapabilities()
|
||||
{
|
||||
return RCAP_TYPE_TRANSACTION_TRACKING;
|
||||
|
2
server/modules/filter/cache/cachefilter.hh
vendored
2
server/modules/filter/cache/cachefilter.hh
vendored
@ -39,7 +39,7 @@ public:
|
||||
|
||||
void diagnostics(DCB* pDcb);
|
||||
|
||||
static uint64_t getCapabilities();
|
||||
uint64_t getCapabilities();
|
||||
|
||||
private:
|
||||
CacheFilter();
|
||||
|
@ -56,7 +56,7 @@ static void freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session);
|
||||
static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_DOWNSTREAM *downstream);
|
||||
static int routeQuery(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue);
|
||||
static void diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb);
|
||||
static uint64_t getCapabilities(void);
|
||||
static uint64_t getCapabilities(MXS_FILTER* instance);
|
||||
|
||||
#define CCR_DEFAULT_TIME "60"
|
||||
|
||||
@ -386,7 +386,7 @@ diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb)
|
||||
*
|
||||
* @return The capabilities of the filter.
|
||||
*/
|
||||
static uint64_t getCapabilities(void)
|
||||
static uint64_t getCapabilities(MXS_FILTER* instance)
|
||||
{
|
||||
return RCAP_TYPE_CONTIGUOUS_INPUT;
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ static void freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session);
|
||||
static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_DOWNSTREAM *downstream);
|
||||
static int routeQuery(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue);
|
||||
static void diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb);
|
||||
static uint64_t getCapabilities(void);
|
||||
static uint64_t getCapabilities(MXS_FILTER* instance);
|
||||
|
||||
/**
|
||||
* Rule types
|
||||
@ -2505,7 +2505,7 @@ diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb)
|
||||
*
|
||||
* @return The capabilities of the filter.
|
||||
*/
|
||||
static uint64_t getCapabilities(void)
|
||||
static uint64_t getCapabilities(MXS_FILTER* instance)
|
||||
{
|
||||
return RCAP_TYPE_STMT_INPUT;
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ static void freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session);
|
||||
static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_DOWNSTREAM *downstream);
|
||||
static int routeQuery(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue);
|
||||
static void diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb);
|
||||
static uint64_t getCapabilities(void);
|
||||
static uint64_t getCapabilities(MXS_FILTER* instance);
|
||||
|
||||
/**
|
||||
* The module entry point routine. It is this routine that
|
||||
@ -238,7 +238,7 @@ diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb)
|
||||
*
|
||||
* @return The capabilities of the filter.
|
||||
*/
|
||||
static uint64_t getCapabilities(void)
|
||||
static uint64_t getCapabilities(MXS_FILTER* instance)
|
||||
{
|
||||
return RCAP_TYPE_CONTIGUOUS_INPUT;
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MX
|
||||
static void setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *session, MXS_UPSTREAM *upstream);
|
||||
static int32_t routeQuery(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue);
|
||||
static void diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb);
|
||||
static uint64_t getCapabilities(void);
|
||||
static uint64_t getCapabilities(MXS_FILTER *instance);
|
||||
static int32_t clientReply(MXS_FILTER* instance, MXS_FILTER_SESSION *session, GWBUF *reply);
|
||||
static bool extract_insert_target(GWBUF *buffer, char* target, int len);
|
||||
static GWBUF* create_load_data_command(const char *target);
|
||||
@ -517,7 +517,7 @@ static void diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *
|
||||
*
|
||||
* @return Filter capabilities
|
||||
*/
|
||||
static uint64_t getCapabilities(void)
|
||||
static uint64_t getCapabilities(MXS_FILTER* instance)
|
||||
{
|
||||
return RCAP_TYPE_TRANSACTION_TRACKING;
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ public:
|
||||
|
||||
void diagnostics(DCB* pDcb);
|
||||
|
||||
static uint64_t getCapabilities();
|
||||
uint64_t getCapabilities();
|
||||
|
||||
void reload(DCB* pOut);
|
||||
|
||||
|
@ -55,7 +55,7 @@ static void setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *sdata, MXS_
|
||||
static int routeQuery(MXS_FILTER *instance, MXS_FILTER_SESSION *sdata, GWBUF *queue);
|
||||
static int clientReply(MXS_FILTER *instance, MXS_FILTER_SESSION *sdata, GWBUF *queue);
|
||||
static void diagnostics(MXS_FILTER *instance, MXS_FILTER_SESSION *sdata, DCB *dcb);
|
||||
static uint64_t getCapabilities(void);
|
||||
static uint64_t getCapabilities(MXS_FILTER *instance);
|
||||
|
||||
/* Global symbols of the Module */
|
||||
|
||||
@ -419,7 +419,7 @@ static void diagnostics(MXS_FILTER *instance, MXS_FILTER_SESSION *sdata, DCB *dc
|
||||
*
|
||||
* @return The capabilities of the filter.
|
||||
*/
|
||||
static uint64_t getCapabilities(void)
|
||||
static uint64_t getCapabilities(MXS_FILTER* instance)
|
||||
{
|
||||
return RCAP_TYPE_STMT_INPUT | RCAP_TYPE_STMT_OUTPUT;
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ static void setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_
|
||||
static int routeQuery(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue);
|
||||
static int clientReply(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue);
|
||||
static void diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb);
|
||||
static uint64_t getCapabilities(void);
|
||||
static uint64_t getCapabilities(MXS_FILTER *instance);
|
||||
|
||||
/**
|
||||
*Structure used to store messages and their properties.
|
||||
@ -1510,7 +1510,7 @@ diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb)
|
||||
*
|
||||
* @return The capabilities of the filter.
|
||||
*/
|
||||
static uint64_t getCapabilities(void)
|
||||
static uint64_t getCapabilities(MXS_FILTER* instance)
|
||||
{
|
||||
return RCAP_TYPE_CONTIGUOUS_INPUT;
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ static void freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session);
|
||||
static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_DOWNSTREAM *downstream);
|
||||
static int routeQuery(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue);
|
||||
static void diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb);
|
||||
static uint64_t getCapabilities(void);
|
||||
static uint64_t getCapabilities(MXS_FILTER* instance);
|
||||
|
||||
typedef struct source_host
|
||||
{
|
||||
@ -378,7 +378,7 @@ diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb)
|
||||
*
|
||||
* @return The capabilities of the filter.
|
||||
*/
|
||||
static uint64_t getCapabilities(void)
|
||||
static uint64_t getCapabilities(MXS_FILTER* instance)
|
||||
{
|
||||
return RCAP_TYPE_CONTIGUOUS_INPUT;
|
||||
}
|
||||
|
@ -121,7 +121,6 @@ void NullFilter::diagnostics(DCB* pDcb)
|
||||
dcb_printf(pDcb, "Hello, World!\n");
|
||||
}
|
||||
|
||||
// static
|
||||
uint64_t NullFilter::getCapabilities()
|
||||
{
|
||||
if (!this_unit.capabilities_set)
|
||||
|
@ -26,7 +26,7 @@ public:
|
||||
|
||||
void diagnostics(DCB* pDcb);
|
||||
|
||||
static uint64_t getCapabilities();
|
||||
uint64_t getCapabilities();
|
||||
|
||||
private:
|
||||
NullFilter(const char* zName);
|
||||
|
@ -82,7 +82,7 @@ static void freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session);
|
||||
static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_DOWNSTREAM *downstream);
|
||||
static int routeQuery(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue);
|
||||
static void diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb);
|
||||
static uint64_t getCapabilities(void);
|
||||
static uint64_t getCapabilities(MXS_FILTER* instance);
|
||||
|
||||
/**
|
||||
* A instance structure, the assumption is that the option passed
|
||||
@ -619,7 +619,7 @@ diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb)
|
||||
*
|
||||
* @return The capabilities of the filter.
|
||||
*/
|
||||
static uint64_t getCapabilities(void)
|
||||
static uint64_t getCapabilities(MXS_FILTER* instance)
|
||||
{
|
||||
return RCAP_TYPE_CONTIGUOUS_INPUT;
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ static void freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session);
|
||||
static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_DOWNSTREAM *downstream);
|
||||
static int routeQuery(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue);
|
||||
static void diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb);
|
||||
static uint64_t getCapabilities(void);
|
||||
static uint64_t getCapabilities(MXS_FILTER* instance);
|
||||
|
||||
static char *regex_replace(const char *sql, pcre2_code *re, pcre2_match_data *study,
|
||||
const char *replace);
|
||||
@ -490,7 +490,7 @@ void log_nomatch(REGEX_INSTANCE* inst, char* re, char* old)
|
||||
*
|
||||
* @return The capabilities of the filter.
|
||||
*/
|
||||
static uint64_t getCapabilities(void)
|
||||
static uint64_t getCapabilities(MXS_FILTER* instance)
|
||||
{
|
||||
return RCAP_TYPE_CONTIGUOUS_INPUT;
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ static void setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_
|
||||
static int routeQuery(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue);
|
||||
static int clientReply(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue);
|
||||
static void diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb);
|
||||
static uint64_t getCapabilities(void);
|
||||
static uint64_t getCapabilities(MXS_FILTER* instance);
|
||||
|
||||
/**
|
||||
* The instance structure for the TEE filter - this holds the configuration
|
||||
@ -753,7 +753,7 @@ diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb)
|
||||
*
|
||||
* @return The capabilities of the filter.
|
||||
*/
|
||||
static uint64_t getCapabilities(void)
|
||||
static uint64_t getCapabilities(MXS_FILTER* instance)
|
||||
{
|
||||
return RCAP_TYPE_CONTIGUOUS_INPUT;
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ static void freeSession(MXS_FILTER *instance, MXS_FILTER_SESSION *session);
|
||||
static void setDownstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_DOWNSTREAM *downstream);
|
||||
static int routeQuery(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue);
|
||||
static void diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb);
|
||||
static uint64_t getCapabilities(void);
|
||||
static uint64_t getCapabilities(MXS_FILTER* instance);
|
||||
static void destroyInstance(MXS_FILTER *instance);
|
||||
|
||||
|
||||
@ -243,7 +243,7 @@ diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb)
|
||||
*
|
||||
* @return The capabilities of the filter.
|
||||
*/
|
||||
static uint64_t getCapabilities(void)
|
||||
static uint64_t getCapabilities(MXS_FILTER* instance)
|
||||
{
|
||||
return RCAP_TYPE_NONE;
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ static void setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, MXS_
|
||||
static int routeQuery(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue);
|
||||
static int clientReply(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue);
|
||||
static void diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb);
|
||||
static uint64_t getCapabilities(void);
|
||||
static uint64_t getCapabilities(MXS_FILTER* instance);
|
||||
|
||||
/**
|
||||
* A instance structure, the assumption is that the option passed
|
||||
@ -628,7 +628,7 @@ diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb)
|
||||
*
|
||||
* @return The capabilities of the filter.
|
||||
*/
|
||||
static uint64_t getCapabilities(void)
|
||||
static uint64_t getCapabilities(MXS_FILTER* instance)
|
||||
{
|
||||
return RCAP_TYPE_CONTIGUOUS_INPUT;
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ static void setUpstream(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession,
|
||||
static int routeQuery(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue);
|
||||
static int clientReply(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, GWBUF *queue);
|
||||
static void diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb);
|
||||
static uint64_t getCapabilities(void);
|
||||
static uint64_t getCapabilities(MXS_FILTER* instance);
|
||||
static void checkNamedPipe(void *args);
|
||||
|
||||
/**
|
||||
@ -602,7 +602,7 @@ diagnostic(MXS_FILTER *instance, MXS_FILTER_SESSION *fsession, DCB *dcb)
|
||||
*
|
||||
* @return The capabilities of the filter.
|
||||
*/
|
||||
static uint64_t getCapabilities(void)
|
||||
static uint64_t getCapabilities(MXS_FILTER* instance)
|
||||
{
|
||||
return RCAP_TYPE_CONTIGUOUS_INPUT;
|
||||
}
|
||||
|
Reference in New Issue
Block a user