Github user cammckenzie commented on a diff in the pull request:

    https://github.com/apache/curator/pull/281#discussion_r231322157
  
    --- Diff: 
curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentNode.java
 ---
    @@ -445,7 +445,8 @@ private void createNode()
             try
             {
                 String existingPath = nodePath.get();
    -            String createPath = (existingPath != null && !useProtection) ? 
existingPath : basePath;
    +            String createPath = existingPath == null || (useProtection && 
!isSequential(mode)) ? basePath
    +                    : (useProtection ? basePath + 
existingPath.substring(existingPath.length()-10) : existingPath);
    --- End diff --
    
    I think that this would be cleaner as some if statements. Also, the 10 
magic number is not ideal, but I don't believe that we have a constant defining 
the length of the sequential part of the node name anywhere. Not sure where the 
best place would be, perhaps just in the CuratorFramework interface. Thoughts 
@Randgalt ?


---

Reply via email to