Hi Lahiru, You mean EPHEMERAL and EPHEMERAL_SEQUENTIAL, right?
A znode is created by a client logged on a session. Both EPHEMERAL and EPHEMERAL_SEQUENTIAL znodes are deleted once the session -- where the znode was created -- expires (that is, the user disconnects). The difference between the two types of ephemeral node is that EPHEMERAL_SEQUENTIAL allows you to create an atomic and sequentially increasing number suffixes. For example, if three clients are trying to create child ephemeral_sequential znodes of a '/leader' parent znode at the same time they will be generated as follows (for example): /leader/serv_000000001 /leader/serv_000000002 /leader/serv_000000003 the number suffix was automatically appended by ZK such that no two clients will generate the same znode (serv_00000001, for example). If the client which created znode 'serv_00000002' disconnects then ZK automatically deletes that znode. Got it? Edward On Thu, Jun 19, 2014 at 2:53 PM, Lahiru Gunathilake <[email protected]> wrote: > When creating a node we have to parse the constants and there are four. > PERSISTENT, PERSISTENT_SEQUENTIAL, EPHEMERAL, EPHEMERAL_SEQUENTIAL > > I do not really get the description of two constants EPEHMERAL_SEQUENCIAL > and EPHEMERAL_SEQUENTIAL. In API docs it says like below. > > The znode will be deleted upon the client's disconnect, and its name will > be appended with a monotonically increasing number. > > Can someone please describe me what this is about. > > Regards > Lahiru > > -- > System Analyst Programmer > PTI Lab > Indiana University >
