MXS-1220: Implement JSON diagnostics entry point in first part of filters
First part of the filters now implement the JSON version of the diagnostics function. The rest are converted in a followup commit.
This commit is contained in:

committed by
Markus Mäkelä

parent
4804c975ad
commit
12baa304e6
@ -144,10 +144,8 @@ public:
|
||||
|
||||
/**
|
||||
* Called for obtaining diagnostics about the filter session.
|
||||
*
|
||||
* @param pDcb The dcb where the diagnostics should be written.
|
||||
*/
|
||||
void diagnostics(DCB *pDcb);
|
||||
json_t* diagnostics();
|
||||
|
||||
protected:
|
||||
FilterSession(MXS_SESSION* pSession);
|
||||
@ -274,20 +272,24 @@ public:
|
||||
return rv;
|
||||
}
|
||||
|
||||
static void diagnostics(MXS_FILTER* pInstance, MXS_FILTER_SESSION* pData, DCB* pDcb)
|
||||
static json_t* diagnostics(MXS_FILTER* pInstance, MXS_FILTER_SESSION* pData)
|
||||
{
|
||||
json_t* rval = NULL;
|
||||
|
||||
if (pData)
|
||||
{
|
||||
FilterSessionType* pFilterSession = static_cast<FilterSessionType*>(pData);
|
||||
|
||||
MXS_EXCEPTION_GUARD(pFilterSession->diagnostics(pDcb));
|
||||
MXS_EXCEPTION_GUARD(rval = pFilterSession->diagnostics());
|
||||
}
|
||||
else
|
||||
{
|
||||
FilterType* pFilter = static_cast<FilterType*>(pInstance);
|
||||
|
||||
MXS_EXCEPTION_GUARD(pFilter->diagnostics(pDcb));
|
||||
MXS_EXCEPTION_GUARD(rval = pFilter->diagnostics());
|
||||
}
|
||||
|
||||
return rval;
|
||||
}
|
||||
|
||||
static uint64_t getCapabilities(MXS_FILTER* pInstance)
|
||||
|
Reference in New Issue
Block a user