Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Zookeeper >> mail # user >> znode defaults

Copy link to this message
Re: znode defaults
ZK doesn't do this out of the box, but it is very easy to wrap up ZK
primitives to get this behavior.

On Wed, Feb 22, 2012 at 12:45 AM, Shelley, Ryan <[EMAIL PROTECTED]>wrote:

> Hi folks. Very new to ZooKeeper and evaluating it for a project. The ZK
> directory-like layout is perfect for what I'm working on, for record
> storage, with one caveat. I'm curious if there's a way to set it up to
> return default records in the event a specific record isn't available (I'm
> attempting to reduce the number of round-trips to retrieve some data).
> For example:
> I create a node named "foo" with the data "lorem_ipsum":
> create /foo lorem_ipsum
> Then I create a node named "bar" under "foo" with the data "baz":
> create /foo/bar baz
> If I get "/foo/bar" obviously I'll get "baz", however, if I try to get
> "/foo/blah" I'd like to get "lorem_ipsum." I know this is highly suspect as
> a design pattern, but there's a method to the madness. We want to create
> records that can be overridden by sub-records (like "/foo/bar"), but in the
> event that sub-record doesn't exist, I'd get back the next concrete record.
> Any thoughts? Thanks!
> -Ryan