On Wed, Oct 13, 2010 at 08:21, <alta...@ceid.upatras.gr> wrote: > I want to create a thrift call and would like to know how to go about it. > > I think what I should do is this: > > - add my call to cassandra.thrift (eg. string test(1:required string arg), > within 'service Cassandra') > > - run thrift -gen java cassandra.thrift > > - write a corresponding function in service/CassandraServer.java, (eg.: > > public String test(String arg) throws TException > { > logger.debug("argument is "+arg); > return "Yay!"; > > } > ) > > - run ant on the whole project > > Now I should be able to write a client that uses this command. Am I wrong?
No. It should just work. > > I have tried all this, by copying the examples from ThriftExamples on the > wiki, but 1) they seem to be working with older Cassandra versions ( I am > using 0.7 beta1), 2) I seem to be doing something wrong as I get a > org.apache.thrift.transport.TTransportException when trying even > describe_cluster_name(). Sounds like a framed/unframed mismatch. Cassandra starts up in framed mode, and your client needs to match. When you set up your transport: TTransport transport = new TFramedTransport(socket); ThriftExamples on the wiki hasn't been updated to reflect this yet. :( Gary. > > Any help will be appreciated. Please ask for any clarifications. > > Alexander >