You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@curator.apache.org by cammckenzie <gi...@git.apache.org> on 2017/09/11 23:06:56 UTC

[GitHub] curator pull request #236: CURATOR-431 - Fixed stat population during create

GitHub user cammckenzie opened a pull request:

    https://github.com/apache/curator/pull/236

    CURATOR-431 - Fixed stat population during create

    -The stat object was not being populated if the create failed due to the node already existing.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/curator CURATOR-431

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/curator/pull/236.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #236
    
----
commit 931f1de5c4f72b71e96ea2071add297194e053bd
Author: Cam McKenzie <ca...@apache.org>
Date:   2017-09-11T22:58:47Z

    CURATOR-431 - Fixed stat population during create
    
    -The stat object was not being populated if the create failed due to the node already existing.

----


---

[GitHub] curator pull request #236: CURATOR-431 - Fixed stat population during create

Posted by Randgalt <gi...@git.apache.org>.
Github user Randgalt commented on a diff in the pull request:

    https://github.com/apache/curator/pull/236#discussion_r138405955
  
    --- Diff: curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java ---
    @@ -1212,7 +1212,21 @@ public String call() throws Exception
                                 {
                                     if ( setDataIfExists )
                                     {
    -                                    client.getZooKeeper().setData(path, data, setDataIfExistsVersion);
    +                                    Stat setStat = client.getZooKeeper().setData(path, data, setDataIfExistsVersion);
    +                                    if(storingStat != null)
    +                                    {
    +                                        storingStat.setAversion(setStat.getAversion());
    --- End diff --
    
    Other than that LGTM


---

[GitHub] curator pull request #236: CURATOR-431 - Fixed stat population during create

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/curator/pull/236


---

[GitHub] curator pull request #236: CURATOR-431 - Fixed stat population during create

Posted by Randgalt <gi...@git.apache.org>.
Github user Randgalt commented on a diff in the pull request:

    https://github.com/apache/curator/pull/236#discussion_r138342246
  
    --- Diff: curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java ---
    @@ -1212,7 +1212,21 @@ public String call() throws Exception
                                 {
                                     if ( setDataIfExists )
                                     {
    -                                    client.getZooKeeper().setData(path, data, setDataIfExistsVersion);
    +                                    Stat setStat = client.getZooKeeper().setData(path, data, setDataIfExistsVersion);
    +                                    if(storingStat != null)
    +                                    {
    +                                        storingStat.setAversion(setStat.getAversion());
    --- End diff --
    
    You can use `DataTree#copyStat()` - FYI


---

[GitHub] curator pull request #236: CURATOR-431 - Fixed stat population during create

Posted by cammckenzie <gi...@git.apache.org>.
Github user cammckenzie commented on a diff in the pull request:

    https://github.com/apache/curator/pull/236#discussion_r138482206
  
    --- Diff: curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java ---
    @@ -1212,7 +1212,21 @@ public String call() throws Exception
                                 {
                                     if ( setDataIfExists )
                                     {
    -                                    client.getZooKeeper().setData(path, data, setDataIfExistsVersion);
    +                                    Stat setStat = client.getZooKeeper().setData(path, data, setDataIfExistsVersion);
    +                                    if(storingStat != null)
    +                                    {
    +                                        storingStat.setAversion(setStat.getAversion());
    --- End diff --
    
    Thanks, there was another place in CreateBuilderImpl doing the same thing, and I've replaced that with DataTree#copyStat() also.


---