Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
Zookeeper, mail # user - Get sequence number without node creation


+
Vitalii Tymchyshyn 2011-11-17, 09:59
+
Sean Bridges 2011-11-17, 16:54
+
Vitalii Tymchyshyn 2011-11-18, 12:41
+
nileader 2011-11-20, 10:13
Copy link to this message
-
Re: Get sequence number without node creation
Benjamin Reed 2011-11-17, 18:06
you can do a setdata and use the mzxid or version in the stat
structure that gets returned as the sequence id.

ben

On Thu, Nov 17, 2011 at 1:59 AM, Vitalii Tymchyshyn <[EMAIL PROTECTED]> wrote:
> Hello.
>
> I have a feature request I'd like to discuss: How about a call that will
> give next sequential node number without node creation. Main reason is that
> in many cases this would allow retries without leak on reconnect, e.g.:
> Now:
> 1) create(SEQUENTIAL) - disconnect - retry - and you've just leaked a node
> Can be
> 2) incrementCounter() - create(name). And you can make a retry in any place.
> The worst thing that can occur is that you will have a hole in your
> numbering
>
> Another cases this can help are simple counters (no need to create nodes at
> all) or simply different sequential nodes naming schema.
>
> Best regards, Vitalii Tymchyshyn
>
+
Ivan Kelly 2011-11-18, 09:20
+
Vitalii Tymchyshyn 2011-11-18, 12:42