Working with ZooKeeper in Grails

Discussions

News: Working with ZooKeeper in Grails

  1. Working with ZooKeeper in Grails (2 messages)

    Until now, Grails users have had to interact with ZooKeeper using the direct Java API which tends toward verbose and is not friendly to Groovy code because it can't handle Closures, GStrings, and the like.

    Ported from the new, Apache 2.0-licensed Virtual Private Cloud Utilities comes a Grails plugin to make working with ZooKeeper more Groovy.

    This Grails plugin creates a helper object that can be automatically injected into your Controllers, Services, and whatnot and overloads most of the ZooKeeper API calls a half-dozen times to make it easier to work with. You can now include Groovy variable references in your ZooKeeper paths, pass Closures as callbacks, and several other Groovy/Grails-friendly niceties.

    The plugin is currently hosted on GitHub and authored by J. Brisbin, the author of numerous OpenSource cloud utilities:

    http://github.com/jbrisbin/grails-zookeeper-plugin

    Threaded Messages (2)

  2. talk about complexity[ Go to top ]

    whats wrong with people doing all this obverloading, adding groovy variables etc ...

    where is simplicity in all this ? You seem to love the - write once and maintain forever strategy

  3. whats wrong with people doing all this obverloading, adding groovy variables etc ...

    where is simplicity in all this ? You seem to love the - write once and maintain forever strategy

    The general idea behind abstraction is to help the developer more easily integrate with other things. The library writer (in this case, me) takes on the complexity of working with the library so the end user doesn't have to.

    If you were to write code directly against the plain ZooKeeper API using only Groovy, you'd see how messy it can get because the ZooKeeper APIs were not coded with Groovy in mind. The methods take java.lang.String as a parameter, which means you can't use Groovy strings. There's no concept of using Closures as callbacks. Adding this functionality on top of the ZooKeeper APIs does take a little bit of complexity insofar as Java code goes. But that's a complexity hit the library writer takes, not the developer. The code the developer writes against this helper is significantly less complicated than the code written without it.