curator-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jordan Zimmerman (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CURATOR-34) CuratorFramework.create().creatingParentsIfNeeded().forPath() throws NodeExistsException if node exists
Date Tue, 17 Sep 2013 15:49:53 GMT

    [ https://issues.apache.org/jira/browse/CURATOR-34?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13769620#comment-13769620
] 

Jordan Zimmerman edited comment on CURATOR-34 at 9/17/13 3:49 PM:
------------------------------------------------------------------

{{setDataIfExists}} would be part of the {{setData}} chain then. Something like: 

    {{client.setData().ifNodeExists().forPath()}}

Is {{ignoreIfExists}} the same as {{create.creatingParentsIfNeeded().ifNotExists()}} in my
example above? Would both of these APIs need an option to return a boolean indicating whether
the operation occurred or not?
                
      was (Author: randgalt):
    {{setDataIfExists}} would be part of the {{setData}} chain then. Something like: 

    {{client.setData().ifNodExists().forPath()}}

Is {{ignoreIfExists}} the same as {{create.creatingParentsIfNeeded().ifNotExists()}} in my
example above? Would both of these APIs need an option to return a boolean indicating whether
the operation occurred or not?
                  
> CuratorFramework.create().creatingParentsIfNeeded().forPath() throws NodeExistsException
if node exists
> -------------------------------------------------------------------------------------------------------
>
>                 Key: CURATOR-34
>                 URL: https://issues.apache.org/jira/browse/CURATOR-34
>             Project: Apache Curator
>          Issue Type: Improvement
>          Components: Framework
>    Affects Versions: 2.0.0-incubating, 2.0.1-incubating
>            Reporter: Nandor Kracser
>            Priority: Minor
>
> I think that NodeExistsException should be ignored in CreateBuilderImpl. In the try and
in the NoNodeException catch block as well.
> org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists
for /examples/something
> 	at org.apache.zookeeper.KeeperException.create(KeeperException.java:119)
> 	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$10.call(CreateBuilderImpl.java:626)
> 	at org.apache.curator.framework.imps.CreateBuilderImpl$10.call(CreateBuilderImpl.java:610)
> 	at org.apache.curator.RetryLoop.callWithRetry(RetryLoop.java:107)
> 	at org.apache.curator.framework.imps.CreateBuilderImpl.pathInForeground(CreateBuilderImpl.java:606)
> 	at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:429)
> 	at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:409)
> 	at org.apache.curator.framework.imps.CreateBuilderImpl$4.forPath(CreateBuilderImpl.java:317)
> 	at org.apache.curator.framework.imps.CreateBuilderImpl$4.forPath(CreateBuilderImpl.java:253)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message