After Building Maxscale from source and setting up a MS SQL Server instance on a Windows server VM, I studied the filter API to understand the interface used to develop new filters. I equally took a look at how the API is used in implementing some of the filters that come packaged with Maxscale.
I have started work on our new filter where I have added an incantation of the filter in the source. This involves declaring the necessary structures for filter incantation and definition in the source tree. All the commits can be found here.

Methods like

static FILTER *createInstance(char **options, FILTER_PARAMETER **params);
static void *newSession(FILTER *instance, SESSION *session);
static void closeSession(FILTER *instance, void *session);
static void freeSession(FILTER *instance, void *session);
static void setDownstream(FILTER *instance, void *fsession, DOWNSTREAM *downstream);
static int routeQuery(FILTER *instance, void *fsession, GWBUF *queue);
static void diagnostic(FILTER *instance, void *fsession, DCB *dcb);

were declared and defined for our filter as specified by the filter API.

I also added the new filter to CMakeLists.txt to make sure it is build by adding the following code :

   add_library(mssqlserverfilter SHARED mssqlserverfilter.c)
   target_link_libraries(mssqlserverfilter maxscale-common)
   add_dependencies(mssqlserverfilter pcre2)
   set_target_properties(mssqlserverfilter PROPERTIES VERSION "1.0.0")
   install(TARGETS mssqlserverfilter DESTINATION ${MAXSCALE_LIBDIR})

This was build successfully locally and changes pushed to Github succeeded Travis build as well. Our next goal is to start implementing these methods  for the next milestone


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s