Skip to end of metadata
Go to start of metadata


The Voldemort plugin enables lightweight access to Voldemort datastores. This plugin does NOT provide domain classes nor dynamic finders like GORM does.


The current version of griffon-voldemort is 0.1
To install just issue the following command


Upon installation the plugin will generate the following artifact in $appdir/griffon-app/conf:

  • VoldemortConfig.groovy - contains the datasource definitions.
  • BootstrapVoldemort.groovy - defines init/destroy hooks for data to be manipulated during app startup/shutdown.

A pair of dynamic methods (withVoldemort and withVoldemortStore) will be injected into all controllers, giving you access to a voldemort.client.StoreClientFactory and voldemort.client.StoreFactory objects repesctively, with which you'll be able to make calls to the database. Remember to make all calls to the database off the EDT otherwise your application may appear unresponsive when doing long computations inside the EDT.
These methods are aware of multiple datasources. If no datasourceName is specified when calling it then the default dataSource will be selected. Here are two example usages, the first queries against the default datasource while the second queries a datasource whose name has been configured as 'internal'

These methods are also accessible to any component through the singleton griffon.plugins.voldemort.VoldemortConnector. You can inject these methods to non-artifacts via metaclasses. Simply grab hold of a particular metaclass and call VoldemortConnector.enhance(metaClassInstance).


Dynamic method injection

Dynamic methods will be added to controllers by default. You can change this setting by adding a configuration flag in Config.groovy


The following events will be triggered by this addon

  • VoldemortConnectStart[config, dataSourceName] - triggered before connecting to the datastore
  • VoldemortConnectEnd[dataSourceName, storeClientFactory] - triggered after connecting to the datastore
  • VoldemortDisconnectStart[config, dataSourceName, storeClientFactory] - triggered before disconnecting from the datastore
  • VoldemortDisconnectEnd[config, dataSourceName] - triggered after disconnecting from the datastore

Multiple DataSources

The config file VoldemortConfig.groovy defines a default dataSource block. As the name implies this is the dataSource used by default, however you can configure named dataSources by adding a new config block. For example connecting to a dataSource whose name is 'internal' can be done in this way

This block can be used inside the environments() block in the same way as the default client block is used.


A trivial sample application can be found at







Initial release

  • No labels