I see.. So In general how to avoid these kind of problems? is there any other solution?
And also using Curator for Zookeeper is a good option or Java client embedded within Zookeeper is a good option? On Thu, Nov 7, 2013 at 3:34 PM, Jordan Zimmerman <[email protected] > wrote: > There's been some talk of adding APIs like that to Curator, but it doesn't > have it now. > > On Nov 7, 2013, at 2:59 PM, Techy Teck <[email protected]> wrote: > > > I am creating couple of nodes using Apache Curator like below - > > > > private static void createZnodes(CuratorFramework client) throws > Exception { > > > > > client.create().creatingParentsIfNeeded().forPath(ZookConstants.COLO_DC1_0, > "".getBytes()); > > > > // some other node here > > } > > > > Now suppose if I have ran my program for the first time, then it will > create the above nodes.. But suppose if I am running my same program again, > it will throw the exception like this - > > > > org.apache.zookeeper.KeeperException$NodeExistsException: > KeeperErrorCode = NodeExists for /tt/colo/dc1/e0 > > > > Is there any way to check if the node exists then don't create it to > avoid the exception? > > > > There should be some method which should check if the nodes exists > already, then dont create it. If it doesn't exists then create it.. Is > there anything like in Curator? > >
