Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
67 lines (48 sloc) 2.32 KB
EOL NOTICE:
This plugin is not being worked on anymore. Instead, I recommend using Hector
as a dependency in your grails project, and use it directly. There is no
advantage to this plugin anymore.
http://www.opensource.org/licenses/apache2.0.php
Cassandra Version: 0.7.0
Hector Version: 0.7.0-23
Grails: 1.2.2 or higher
(For cassandra version 0.6, please use version 0.5.4 of this plugin)
NOTE:
This is INCOMPATIBLE with cassandra 0.6 or earlier. It will also be incompatible
with earlier versions of this own plugin. You'll have to re-do the api calls
when upgrading to this version of grails-cassandra.
If you are testing this, it assumes a stock Cassandra 0.7 server is running on
your localhost. Test cases require that you invoked the JMX method
StorageService.loadSchemaFromYAML after channing the partitioner to
org.apache.cassandra.dht.OrderPreservingPartitioner. This is due to the default
assumptions made by the hector tests.
INSTALLATION:
grails install-plugin cassandra
edit grails-app/conf/spring/resources.groovy:
beans = {
cassandraService(codehead.CassandraService){
servers="localhost:9160"
keyspaceName="Keyspace1"
clusterName="Main"
hideNotFoundExceptions=true
}
}
ABOUT
This grails plugins provides a service to enable easy access to Cassandra
from within grails. It is not intended to be a GORM mapping layer.
It specifically wraps the Hector (http://github.com/rantav/hector) API which
makes it easy to connect to Cassandra without dealing with the thrift layer.
Hector also provides for connection pooling, etc. Hector has gone through
a new API version, so this plugin has to as well.
You can use hector directly, or make use of the helper methods I added to
take advantage of 'groovy-way' to do things. Look at
https://github.com/wolpert/grails-cassandra/blob/master/test/unit/codehead/CassandraServiceTests.groovy
for examples of using both.
Goals:
Primary goals of this project is to have a service that provides easy access
to Cassandra. This includes simplify lookup and setting of Cassandra values,
and optionally hiding 'NotFound' exceptions. (The ruby Cassandra plugin
returns an empty hash if a searched for value does not exist. Java plugin
throws an exception.)
THANKS
Thanks to iMemories for allowing me to open-source this code.
Something went wrong with that request. Please try again.