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

Rakesh R commented on ZOOKEEPER-1344:
-------------------------------------

*First approach* could be, expose Op.setPath(path) method. On invocation of 
multi(ops) api, will iterate and modify directly to the client Op objects by 
prepending chRoot. I feel, this appraoch will break the immutability of Op and 
is modifying the Op passed by the client. Hence it will not able to reuse Op 
objects on a non-chRoot clients.

*Second approach* could be, provide Op.clone(String path) method. On invocation 
of multi(ops) api, will iterate and create a new Op object by prepending chRoot 
path, and retains Op client object as immutable. Made clone(path) as abstract 
and will be overidden for new operation type. IMO, the second one could be the 
better way.

I have attached the patch based on the second appraoch, please review the 
changes and test cases.

*Case:* Also I have seen the 'path' validation is missing for the multi(ops) 
api. IMO, we can raise a new task/subtask and address the issue separately, 
since it involves method signature modification of Op apis by throwing 
'KeeperException'. 
If everyone agrees, I would like to help by doing the changes.

Thanks
Rakesh
                
> ZooKeeper client multi-update command is not considering the Chroot request
> ---------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1344
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1344
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: java client
>    Affects Versions: 3.4.0
>            Reporter: Rakesh R
>            Assignee: Rakesh R
>            Priority: Critical
>             Fix For: 3.5.0
>
>         Attachments: ZOOKEEPER-1344-onlytestcase.patch, ZOOKEEPER-1344.patch
>
>
> For example: 
> I have created a ZooKeeper client with subtree as "10.18.52.144:2179/apps/X". 
> Now just generated OP command for the creation of zNode "/myId". When the 
> client creates the path "/myid", the ZooKeeper server is actually be creating 
> the path as "/myid" instead of creating as "/apps/X/myid"
> Expected output: zNode has to be created as "/apps/X/myid"

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to