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 Cassandra, 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
Related
I have a program written in C and want to include gRPC in it. However, the API for gRPC is written in C++.
I've looked here and got the foo_client and foo_server working.
https://github.com/Juniper/grpc-c/tree/master/examples
However, the C client is not compatible with my gRPC C++ server. They will not talk to each other. I believe it is because I am using the lates gRPC which uses protocbuf version 3.2.0. And Juniper's grpc-c is using an older version of gRPC that uses protocbuf version 3.0.0.
So the Juniper version in C doesn't seem to work with the new gRPC. I know the gRPC low level C API is supposed to be here: https://github.com/grpc/grpc/blob/master/include/grpc/grpc.h
But I'm having difficulty implementing it. Can anyone help me make sense of it?
I haven't programmed in C in awhile so I'm a little rusty.
If you are using the gRPC core library directly, then you will need to perform your own serialization, and deal with low level operations documented in https://github.com/grpc/grpc/blob/master/include/grpc/impl/codegen/grpc_types.h.
If you have any specific questions, we will be happy to help, but if this is just a one-time thing it might be easier to just solve the version incompatibility problem, or maybe simply wrap the C++ implementation with a C interface.
I am trying to use SQS on aws (on a linux box) using generic C. Not using any sdk (not that there is one for C). I can not find an example I can relate to. Sorry, I don't relate to these newfangled languages. I am proficient in Cobol, fortran, pascal and C. Not python, c++, c# or java. There are "steps" on amazon site, but honestly they expect proficiency on aws and an object oriented language. I just want to create my own https get command for accessing SQS/SNS, can anyone provide a 'C' snipet that creates a complete url with the version 4 signature? Or point me in the correct direction?
Have a look at https://docs.aws.amazon.com/general/latest/gr/sigv4-signed-request-examples.html
If you're proficient with any programming language, you should be able to understand all of that code. It's just string operations and some hashing for which you'll have to use another library. There's also lots of comments to help you with the details.
You can use libcurl for the call:
Use CURLOPT_AWS_SIGV4 argument for the signature https://curl.se/libcurl/c/CURLOPT_AWS_SIGV4.html
You can take a look at CURLOPT_WRITEFUNCTION if you want to store the result into a variable: https://curl.se/libcurl/c/CURLOPT_WRITEFUNCTION.html
And for debugging purpose CURLOPT_VERBOSE can be useful too: https://curl.se/libcurl/c/CURLOPT_VERBOSE.html
Note that you need a version of libcurl superior to 7.75.
I am looking for a NIO type of library for C. I want to implement a multi threaded UDP network server that will have a lot of clients connecting to it.
Instead of attempting to code my own program to handle packets and 'connections'. I thought I would have a look if there is not already an existing library that has been tested and build for scalability and high performance.
I have found a few for Java but none for C. such as Apache Mina.
I am hoping that some one out there knows of a good one that may assist me.
Thaks
It sounds like you want something to abstract select(), poll(), or whatever the most efficient mechanism is for your platform.
Have you looked at libevent and libev? There is a nice writeup here.
First of all, C has no classes. Secondly, C provides you with everything you need to implement a scalable and high performance solution. It's more low level than java's NIO, but there are good tutorials out there in google.
And if you want a library - try boosts' asio. It is C++, but perhaps you can use it.
If you are using Linux I strongly recommend you to use the POSIX API. It gives you resources for multithreading and networking acrosss any Linux box.
GNU C library
gcc 4.4.4 c89
Does any one know any sdp parses. That I can link to my application. Currently we are developing a SIP project. However, we need to parse the SDP for incoming/answering.
However, we don't have much time to implement. So just wondering if there are some simple ones out there they are easy and quick to work with.
Our application is written in c.
Many thanks for any advice,
Check out FreeSDP. But it is distributed under GPL
My company, RADVISION, offers a full commercial SIP stack written in C that includes an SDP parser. It might not be exactly what you're looking for, but it might reduce your development effort even further: http://www.radvision.com/Products/Developer/VoIP-Developer-Tools/SIP-Developer-Suite/
I haven't looked into open source stacks, but I would suspect that most SIP stacks would include an SDP parser. They are pretty closely tied together.
I thought I wanted to use GSS-API, but now am not so sure, since I'm having a hard time finding good sample code for a trivial client/server pair. Sun has documentation including sample code, but it's written specifically for their GSS API implementation, using a few proprietary functions not in e.g. the GNU GSS-API (and for which it's not immediately clear to me how to re-implement them against the GNU implementation). Plus, it's written in pre-ANSI C, with K&R function declarations and so on (I had no problem converting the declarations, but it did make me think the Sun example code may be so old as to be irrelevant).
Have you used the GSS-API in an application in, say, the last decade? Do you know of some self-contained tutorial with example programs that's worth reading?
Alternatively, maybe I'm on the wrong track and should try SASL instead. The GNU GSS-API author himself suggests as much.
For what it's worth, I'm using GCC on Linux, and have Kerberos set up already for other purposes.
Yes, you should absolutely be using SASL instead of GSSAPI. It is a much better supported protocol, and the libraries are pretty good. At the very least, you can think of it as a sanity-improving wrapper over GSSAPI, since that is one of the typical plugins implemented for SASL. The only reason you should consider using GSSAPI directly is to implement a SASL library. But don't do that. :)
SASL also has wide use. It is specified as part of IMAP and XMPP.
Are you implementing some custom protocol over TCP?
Sun uses the GSSAPI in their Java code. You can find a bit more information about it here:
Equivalent of 'gss_import_name' and 'gss_init_sec_context' methods in java?
Also you may want to look at the code implementation done by the folks at OpenJDK:
http://www.docjar.org/docs/api/sun/security/jgss/GSSContextImpl.html
They have published a full working example of GSSAPI written in Java.
Grant