curator-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jordan Zimmerman <>
Subject Re: How to create znode with curator
Date Fri, 16 May 2014 22:19:50 GMT
Use creatingParentsIfNeeded(). ZooKeeper does not automatically create parent nodes.


From: Vadim Keylis
Date: May 16, 2014 at 5:18:45 PM
Subject:  Re: How to create znode with curator  

When I run the code I get exception:

org.apache.zookeeper.KeeperException$NoNodeException: KeeperErrorCode = NoNode for /name/offset/event-capture/topic
at org.apache.zookeeper.KeeperException.create(
at org.apache.zookeeper.KeeperException.create(
at org.apache.zookeeper.ZooKeeper.create(
at org.apache.curator.framework.imps.CreateBuilderImpl$

On Thu, May 15, 2014 at 2:23 PM, Vadim Keylis <> wrote:
How do you create a path if it does not exist.
CuratorFramework    client = CuratorFrameworkFactory.newClient("dzoo01:2181/kafka", new
ExponentialBackoffRetry(1000, 3));

path= '/name/offset/event-capture/topic';

I check if path exists
if(curatorFramework.checkExists().forPath(path) == null){

will that code snippet create znode?


View raw message