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 23:33:54 GMT
I found solution to my problem. Please ignore.

Thanks,
Vadim


On Thu, May 15, 2014 at 2:27 PM, Vadim Keylis <vkeylis2009@gmail.com> wrote:

> 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