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

Anthony Urso commented on ZOOKEEPER-104:
----------------------------------------

>> I took the liberty of making some small updates to Anthony's patch file, 
>> Anthony please let me know if you see any issues with this. 

Those changes are all good.

>> in the keepset contructor i changed if (exits) zk.create() to try { 
>> zk.create() } (nodeexistsexcpetion ){}

Since the set can only be added to by a watcher event, these end up being 
semantically the same. I think checking the set first is a little more 
efficient, but either way is fine with me.

>> also i added braces around for and if with single lines (its less confusion 
>> for readign code  ).

OK.

>> i dont understand the while loops of while(true) in all the zookeeper calls? 
>> why do you need that anthony?

I do that to handle an InterruptedException by retrying the same command. 
Hopefully that is the right behavior. :)
The purpose of the InterruptedException has always been a mystery to me when 
coding non-interactive programs.


> KeptSet: a distributed data stucture backed by the children of a ZooKeeper 
> node
> -------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-104
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-104
>             Project: Zookeeper
>          Issue Type: New Feature
>          Components: java client
>            Reporter: Anthony Urso
>            Assignee: Anthony Urso
>            Priority: Minor
>         Attachments: ZOOKEEPER-104.patch, ZOOKEEPER-104.patch, 
> ZOOKEEPER-104.patch
>
>
> Here is an implementation of a ZooKeeper backed Java Set. It should be 
> generally useful.

-- 
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