twitter/cassie — pull request #4 by rstrickland (2012-10-12 16:28:01+00:00)
Title: Added CompositeCodec to support reading/writing composite columns

This codec allows for operations on composite columns, which is currently not supported in Cassie. Example usage:

```scala
val cluster = new Cluster("localhost", 9160)
val keyspace = cluster.keyspace("test").connect()
val compositeTest = keyspace.columnFamily("CompositeTest", Utf8Codec, CompositeCodec(Utf8Codec), Utf8Codec)
.consistency(ReadConsistency.One)
.consistency(WriteConsistency.One)

val composite = Composite(Utf8Codec, Component("c1"), Component("c2"))
compositeTest.insert("testkey", Column(composite, "testval2"))()

println("row ==")
compositeTest.getRow("testkey")().foreach(c => printCol(c._2))

println("one col ==")
compositeTest.getRowSlice("testkey2",
Some(Composite(Utf8Codec, Component("c1", ComponentEquality.EQ))),
Some(Composite(Utf8Codec, Component("c1", ComponentEquality.GTE))),
Int.MaxValue)()
.foreach(col => printCol(col))

def printCol(c: Column[Composite[String], String]) = println(c.name.components.mkString(":") + " = " + c.value)
```