Gridgain, Grails, GORM and Cassandra

I have grails working to submit jobs to gridgain nodes. The grid tasks execute and send out jobs that run on the grid nodes just fine. The grid jobs are able to make use of a cassandra service (provided by the cassandra plugin I wrote) just fine, thanks to Hector reconnecting blindly on the grid job. Interesting tidbit is that GridTasks (which execute on the node that submits the task) are able to make use of standard GORM methods like list(). But GridJobs cannot make use of these methods. Odds are this is due to how the method list() is added to the GORM object… the method simply isn’t added on the grid node when it loads up the class.

I should also note that this is using the GAR deployment.

Advertisements

5 thoughts on “Gridgain, Grails, GORM and Cassandra

  1. Praveen says:

    Can you please elaborate how do you use CassandraService provided by grails-plugin.reply promtly

    • wolpert says:

      I need to modify the README for it and build the grails plugin from the latest source. If you got the grails plugin by doing ‘grails install-plugin’ then its for the 0.6 version of Cassandra. Since 0.7 has been released, the one on github needs to be pushed to public. So it highly depends on which version of Cassandra you are using. You can view the 0.7 README here.

      Once I release 0.7 today, you can start using it right away should a Cassandra node be running on your development box. You can configure it by declaring the following beans in your resources.groovy file: (These are defaults)

      cassandraService(codehead.CassandraService){
      servers="localhost:9160"
      keyspaceName="Keyspace1"
      clusterName="Main"
      hideNotFoundExceptions=true
      }

      If you follow the test cases, you can see how I use hector directly, and how those were changed to make use of a ‘groovy’ way.

    • wolpert says:

      The plugin version in the grails plugin repository is being uploaded now for Cassandra 0.7 compatibility.

  2. sam says:

    Created a grails 1.3.7 app , installed your plugin using grails-install-plugin for the app . Upon grails-runapp, i see an exception

    Caused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (3) are:
    PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property ‘servers’ threw exception; nested exception is groovy.lang.MissingPropertyException: No such property: log for class: codehead.CassandraService
    PropertyAccessException 2: org.springframework.beans.MethodInvocationException: Property ‘keyspaceName’ threw exception; nested exception is groovy.lang.MissingPropertyException: No such property: log for class: codehead.CassandraService
    PropertyAccessException 3: org.springframework.beans.MethodInvocationException: Property ‘clusterName’ threw exception; nested exception is groovy.lang.MissingPropertyException: No such property: log for class: codehead.CassandraService

    Looks like some issue with the CassandraService , or am I missing something in my grails app ?

    Also am a newbie to grails / cassandra, is it possible to highlight the steps to running your Test cases:
    https://github.com/wolpert/grails-cassandra/blob/master/test/unit/codehead/CassandraServiceTests.groovy

    Thanks,
    Sam

    • wolpert says:

      With the ‘log’ not able to be found, its seems that the service isn’t being loaded via spring injection. How are you calling it? In your own service or controller, you should just have ‘def cassandraService’ as a local variable. Make sure you not instantiating your own service.

      As far as running the tests, you need to be running your own cassandra service. (Any 0.7 version) locally. Towards the bottom of the github page (https://github.com/wolpert/grails-cassandra) are notes on how to get the tests working. The ‘notes’ section mentions how to setup Cassandra from the default install, and the ‘installation’ section gives a reasonable setting in your grails configuration files.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s