I wish I could use Cassandra for a project where only C language is used.
I tried to find a mature C client library for Cass开发者_如何学Candra, with no luck.
Shall I try a C++ one instead, like http://github.com/posulliv/libcassandra, or does one exist?
At least in Thrift trunk, there is C glib support, which means it's possible to make a C client for Cassandra. It's probably not well tested yet.
posulliv/libcassandra was never completed and only supports Cassandra 0.6. It lacks several features like super column support, for example.
I also started a C++ client that supports Cassandra 0.7, but it's still half-baked at the moment. Most of the Cassandra API is supported. At the very least, it can be a good example of working with the Thrift API. Of course, if you're capable of contributing to the project or starting a C client, I think many people would appreciate that.
I've created a very basic proof-of-concept C client for Cassandra and put it up on github. It relies on the barely-documented C language support in Thrift (as mentioned in previous answers). This client is not mature by any means, but demonstrates how to use the C files generated by Thrift, and offers some basic functionality; it might be a useful stepping stone towards a more serious C client.
I managed generating C code from the Cassandra trunk Thrift file. I obtained the following files :
- cassandra.c
- cassandra.h
- cassandra_types.c
- cassandra_types.h
No main() function there, I guess these should be linked and used as a library, but I found no API documentation or whatsoever.
The samples in thrift/lib/c_glib/test do not show any client test source... Will look into this more deeply !
I came across this and hopefully this helps - http://datastax.github.io/cpp-driver/
There is already a C++ cassandra API called libQtCassandra http://snapwebsites.org/project/libqtcassandra#Download
精彩评论