curator-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vadim Keylis <vkeylis2...@gmail.com>
Subject Re: How to create znode with curator
Date Thu, 15 May 2014 21:27:35 GMT
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(KeeperException.java:111)
at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
at org.apache.zookeeper.ZooKeeper.create(ZooKeeper.java:783)
at
org.apache.curator.framework.imps.CreateBuilderImpl$11.call(CreateBuilderImpl.java:676)


On Thu, May 15, 2014 at 2:23 PM, Vadim Keylis <vkeylis2009@gmail.com> 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){
>     curatorFramework.create().forPath(path)
> }
>
> will that code snippet create znode?
>
>
> Thanks,
> Vadim
>

Mime
View raw message