This page is no longer maintained — Please continue to the home page at

Skeletor => Scala wrapper of Hector for Cassandra

No replies
Joseph Stein
Joined: 2010-05-03,
User offline. Last seen 42 years 45 weeks ago.
Hey folks, I pushed my Scala wrapper of Hector for Cassandra
It not only gets Cassandra hooked into your Scala projects quick and simple but does so in a functional way.  
It is not a new library interface for Cassandra because Hector is a great library as is.  Instead, Skeletor implements Hector so you always have the best of breed under the hood for using Cassandra while also leveraging all of the benefits that Scala offers over Java (ok that was so many buzz words in one sentence that I just vomited in my mouth a little bit, but it is all true).
Right now the examples are in the test specs for reading & writing (both Counter & UTF8 type column families).
Basically it is a DSL:
//for writing val TestColumnFamily = "FixtureTestSkeletor" \ "TestColumnFamily" //define your Keyspace \ ColumnFamilyvar cv = (TestColumnFamily -> "rowKey" has "columnName" of "columnValue") //create a column value for a row for this column family var rows:Rows = Rows(cv) //add the row to the rows objectrows add  (TestColumnFamily -> "rowKey" has "anotherColumnName" of "anotherColumnValue") //and add another row Cassandra << rows //takes care of all the batch mutate for ya
//and for readingdef processRow(r:String, c:String, v:String) = { println("r=" + r + " & c=" + c + " with "+ v) //whatever you want to do  }
def sets(mgsq: MultigetSliceQuery[String, String, String]) { mgsq.setKeys("columnName") //we want to pull out the row key we just put into Cassandra mgsq.setColumnNames("columnValue") //and just this column}
TestColumnFamily >> (sets, processRow) //get data out of Cassandra and process it functionally
I will put more up on the wiki and also post more examples of where/how I have been using it and will evolve it as I go.  
Again, for now, the test specs are the place to start
Thanx =) Joestein
Joe Stein
Twitter: @allthingshadoop

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland