zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lahiru Gunathilake <glah...@gmail.com>
Subject Re: EPEHMERAL_SEQUENCIAL and EPHEMERAL_SEQUENTIAL constants
Date Mon, 23 Jun 2014 04:24:31 GMT
Thanks Edward !


On Sun, Jun 22, 2014 at 8:32 PM, Edward Ribeiro <edward.ribeiro@gmail.com>
wrote:

> Hi,
>
> Rakesh already answered your question, but let me just reinforce some
> points:
>
>
> On Fri, Jun 20, 2014 at 10:50 AM, Lahiru Gunathilake <glahiru@gmail.com>
> wrote:
>
> > ​
> > so the usecase is when two clients try to create same nodes with same
> name
> > ​​
> > z
> > ​​
> > k
> > ​​
> > ​​
> > ch
> > ​​
> > a
> > ​​
> > n
> > ​​
> > g
> > ​​
> > e
> > ​​
> > ​​
> > t
> > ​​
> > h
> > ​​
> > e
> > ​​
> > ​​
> > n
> > ​​
> > a
> > ​​
> > m
> > ​​
> > i
> > ​​
> > n
> > ​​
> > g
> > ​​
> > ​​
> > ?
> > ​​
> > ​​
> >
>
> Nope. When creating a sequential znode you inform a prefix (e.g., "serv_")
> and ZK provides the number part. The final name will be your prefix + the
> number (i.e., serv_0000007). The big plus is that the number part is
> atomically and sequentially provided so no more than one client will create
> the znode with this full path name.
>
> ​
>
> > I
> > ​​
> > ​​
> > ​​
> > ​​
> > f my system is well defined and no ra
> > ​​
> > ndom node
> > ​​
> > creation I do not need this feature ?
> > ​
> >
>
> This feature is used for leader election among ZK clients, for example.
> Other cases can for sure make use of sequential znodes.
> ​
>
> > ​​
> >
> > In this case can I just get th
> > ​​
> > e node with /leader/serv or should I get with
> > /leader/serv_000000001
> > ​
> >
>
> Later option, as Rakesh wrote.​
> ​
>
> > ​
> >
> >
> > Anyways for my application I do not need this because I do not have a
> > scenario where naming is nondeterministic between zk clients.
> > ​
> >
>
> I would not say that it is "non deterministic". More like, you have an
> atomically increasing numbered znode suffix name. ;)
>
> Regards,
> Edward​
>



-- 
System Analyst Programmer
PTI Lab
Indiana University

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message