Skip to content

Instantly share code, notes, and snippets.

@samklr
Created December 6, 2012 16:52
Show Gist options
  • Save samklr/4225989 to your computer and use it in GitHub Desktop.
Save samklr/4225989 to your computer and use it in GitHub Desktop.
Cassandra stuff
// Instanciate cluster then connect
Cluster cluster =new Cluster.Builder()
.addContactPoints( addr1, addr2)
.build()
Session session = cluster.connect()
session.execute(query)
//read
ResultSet rs = session.execute(readQuery) // select *****
List<CQLRow> rw = rs.fetchAll
val userList = rw map ( row : CQLROW => User(row.getString( stringName), ....)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment