[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12965419#action_12965419
 ] 

Thomas Koch commented on ZOOKEEPER-849:
---------------------------------------

Hi Benjamin,

- It's no problem to save the string internaly as byte[] and provide a Ctor 
with byte[]

- The initial motivation for the Path class was the java client code and 
applications using ZK. But there are also places in the Server code, where it 
makes sense:

 - appending the sequence number
 - getting the parent ZNode path

- In general I'd say that in most cases when you create a .*Util class, you're 
doing something wrong. In this case at hand there is code working with path 
strings spread all over the code base.

- The vision for the Path class is an alternative / additional ZK java api that 
receives and returns Path instances. Thus the responsibility of path validation 
is moved out of the ZK api. By receiving a Path object we can be sure, that it 
is valid since it exists.

- The isSequential() flag is only used to indicate that the Path may also be 
valid with a slash at the end for the purpose of creating a sequential znode. 
There is no need to ever transport this information from one server to another. 
The create request carries the "sequential" flag and thus already carries the 
information, that the path may also end in a slash and thus can be created as 
Path(pathString, true)

I hope this helps to convince you of the usefulness of a Path class?

> Provide Path class
> ------------------
>
>                 Key: ZOOKEEPER-849
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-849
>             Project: ZooKeeper
>          Issue Type: Sub-task
>          Components: java client
>            Reporter: Thomas Koch
>            Assignee: Thomas Koch
>             Fix For: 3.4.0
>
>         Attachments: ZOOKEEPER-849.patch, ZOOKEEPER-849.patch
>
>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to