Hi,

I was playing around with the libmemcached API this weekend to learn a
little about using memcached as I don't have any experience with it
and so decided to create a plugin for the memcached UDF's in drizzle.
Many of the memcached UDF's have been ported and are available in a
branch at:

lp:~posulliv/drizzle/memcached-udf

For example, some UDF's that work are:

posul...@aghadoe$ ../client/drizzle --port=9306
Welcome to the Drizzle client..  Commands end with ; or \g.
Your Drizzle connection id is 2
Server version: 2009.07.1094 Source distribution (memcached-udf)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

drizzle> select memc_libmemcached_version();
+-----------------------------+
| memc_libmemcached_version() |
+-----------------------------+
| 0.30                        |
+-----------------------------+
1 row in set (0 sec)

drizzle> select memc_servers_set('localhost:11211');
+-------------------------------------+
| memc_servers_set('localhost:11211') |
+-------------------------------------+
| SUCCESS                             |
+-------------------------------------+
1 row in set (0 sec)

drizzle> select memc_set('norrin','radd');
+---------------------------+
| memc_set('norrin','radd') |
+---------------------------+
| SUCCESS                   |
+---------------------------+
1 row in set (0 sec)

drizzle> select memc_get('norrin');
+--------------------+
| memc_get('norrin') |
+--------------------+
| radd               |
+--------------------+
1 row in set (0 sec)

drizzle> select memc_delete('norrin');
+-----------------------+
| memc_delete('norrin') |
+-----------------------+
| SUCCESS               |
+-----------------------+
1 row in set (0 sec)

drizzle> select memc_get('norrin');
+--------------------+
| memc_get('norrin') |
+--------------------+
| FAILURE            |
+--------------------+
1 row in set (0 sec)

drizzle>

If interested, have a look at the file
plugin/memcached-udf/memcached_udf.cc to see all the UDF's that
currently work.

The plugin uses the libmemcached C API for the moment. I'm hoping to
do a little bit of work on the libmemcached C++ API this week and then
use that for the memcached UDF plugin. Since I'm new to the
libmemcached API, my usage of it may not be optimal. If someone with
some more experience with the libmemcached API could have a look at my
branch and provide some feedback, that would be much appreciated.

I know that Patrick and Ronald were working on this but I havn't seen
anything about it lately so I hope you guys don't mind that I hacked
on this tonight (you are still listed as the authors of the plugin). I
can continue work on this during the week if you guys like (I should
be able to port all the UDF's over within the week) or other people
can work on adding the remaining UDF's if they wish. I'm happy to let
someone take what I did and finish or improve on it if they wish.

-Padraig

_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help   : https://help.launchpad.net/ListHelp

Reply via email to