<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
You want to use the Riptano repository as these guys have all the latest artifacts very fast. Here is a snippet of my new yaml based Cassandra configuration - yammi:
- name: "javasplitter"
- name: author
Straightforward, no advanced use cases. Some Java code involving Thrift that works.
TTransport framedTransport = new TFramedTransport(new TSocket("localhost", 9160));
TProtocol framedProtocol = new TBinaryProtocol(framedTransport);
Cassandra.Client client = new Cassandra.Client(framedProtocol);
String columnFamily = "author";
ColumnParent cp = new ColumnParent(columnFamily);
byte userIDKey = "nadine".getBytes();
One new thing is the use of framed transports. Make sure your cassandra.yaml has this line (which it does by default):
# Frame size for thrift (maximum field length).
# 0 disables TFramedTransport in favor of TSocket. This option
# is deprecated; we strongly recommend using Framed mode.
Make really sure you are using the above code against a 0.7 Cassandra installation otherwise you will get a lot of weird errors which are not really self explaining. For instance running the Java code above against Cassandra 0.6.8 would just freeze on the line containing framedTransport.open(). It is still possible to use plain TSocket transport or even to mix. Cassandra.Client has a constructor that takes two TProtocol instances (in and out).
Another thing that has changed is the use of java.nio.ByteBuffer from the Thrift based Cassandra.Client. Everything expects a ByteBuffer now (I think it took byte before) so the the code becomes a bit more verbose. Also make sure you are running with libthrift 0.5 (see pom.xml) otherwise you will get errors like:
I think 0.7 beta 2 used another version of libthrift (959516) so be careful. Anyway, you should probably use Hector from production code anyway. Should work well with 0.7 of Cassandra. I was however interested in Thrift since apparently Cassandra is moving away from Thrift to Avro. No idea yet, why Avro is better. It can't be the performance.