CARVIEW |
fauna / cassandra
- Source
- Commits
- Network (18)
- Issues (2)
- Downloads (0)
- Wiki (1)
- Graphs
-
Branch:
master
click here to add a description
click here to add a homepage
name | age | message | |
---|---|---|---|
![]() |
.gitignore | Fri Feb 19 12:17:55 -0800 2010 | one more packaging try [ryanking] |
![]() |
CHANGELOG | Mon Mar 01 10:14:54 -0800 2010 | update changelog for 0.7.6 release [ryanking] |
![]() |
LICENSE | Tue Jun 30 10:06:07 -0700 2009 | License. [Evan Weaver] |
![]() |
Manifest | Fri Feb 19 12:12:53 -0800 2010 | update manifest [ryanking] |
![]() |
README.rdoc | Mon Jan 25 14:25:55 -0800 2010 | change readme to rdoc [ryanking] |
![]() |
Rakefile | Wed Mar 24 12:34:29 -0700 2010 | fix problem with `rake cassandra` not finding t... [ryanking] |
![]() |
bin/ | Tue Aug 18 13:17:37 -0700 2009 | Handy script to install the server. [Evan Weaver] |
![]() |
conf/ | Tue Mar 09 14:14:44 -0800 2010 | download and build 0.6.beta2 [ryanking] |
![]() |
lib/ | Tue Mar 23 16:18:16 -0700 2010 | Merge remote branch 'tritonrc/master' [ryanking] |
![]() |
test/ | Wed Mar 24 11:20:48 -0700 2010 | Merge remote branch 'mperham/master' [ryanking] |
![]() |
vendor/ | Tue Mar 09 14:18:10 -0800 2010 | newly regenerated thrift bindings [ryanking] |
cassandra
A Ruby client for the Cassandra distributed database.
License
Copyright 2009 Twitter, Inc. See included LICENSE file. Portions copyright 2004-2009 David Heinemeier Hansson, and used with permission.
Features
- clean encapsulation of the Thrift API
- compatible UUID and Long classes, for GUID generation
- Ruby 1.9 compatibility
The Github source repository is here. Patches and contributions are very welcome.
Installation
You need Ruby 1.8 or 1.9. If you have those, just run:
sudo gem install cassandra
Cassandra itself is a rapidly moving target. In order to get a working server, use the `bin/cassandra_helper` script:
cassandra_helper cassandra
A server will be installed in `$HOME/cassandra/server`, and started in debug mode.
WARNING: Don’t use the test folder for your data, as it will get overwritten when you update the gem.
Usage
Now, start IRb and require the library:
require 'cassandra'
Connect to a server and keyspace:
client = Cassandra.new('Twitter', '127.0.0.1:9160')
Insert into a column family. You can insert a `Cassandra::OrderedHash`, or a regular Hash, if order doesn’t matter:
client.insert(:Users, "5", {'screen_name' => "buttonscat"})
Insert into a super column family:
client.insert(:UserRelationships, "5", {"user_timeline" => {UUID.new => "1"}})
Query a super column:
timeline = client.get(:UserRelationships, "5", "user_timeline")
The returned result will always be a Cassandra::OrderedHash.
See Cassandra for more methods.
Configuration
By default, cassandra is setup to listen on localhost. If you want to move your clients to another host, you’re going to need to change which interface it binds to in the storage-conf.xml. You should also change the seed address.
Node Auto-Discovery
The list of hosts you pass to the client is only used to auto-discover all the nodes in your cluster. You don’t need to give the client a list of all of your nodes.
Further reading
Reporting problems
The Github issue tracker is here. If you have problems with this library or Cassandra itself, please use the cassandra-user mailing list.