zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jordan Zimmerman <jor...@jordanzimmerman.com>
Subject Re: identifying container nodes
Date Sun, 18 Dec 2016 17:05:47 GMT
Sadly, no. There needs to be a new API added to get the metadata for a node. When Container
(and now TTL) nodes were added we didn’t want to break binary compatibility so the metastate
is shoehorned into the ephemeralOwner value using the high bits. So as not to break existing
clients those bits are masked away when returning the Stat value to clients.


> On Dec 18, 2016, at 12:03 PM, Hadriel Kaplan <hadrielk@yahoo.com.INVALID> wrote:
> Howdy,
> Is there some way for us to identify a node as being a Container node, distinct from
persistent or ephemeral nodes, via a client?
> Inside of the server, it stores the client's session number in the ephemeral owner ID
for ephemeral nodes, a value of 0 to identify persistent nodes, and a value of CONTAINER_EPHEMERAL_OWNER
(a Long.MIN_VALUE) to identify Container nodes. But when passing back the Stat structure of
Container nodes to clients, it uses 0 instead of the Long.MIN_VALUE, making it appear as a
persistent node to the client. Is there some reason for this behavior?
> It seems easy enough for me to change that behavior for my own use, in DataNode.copyStat(),
but I'm concerned about making this change if there's some good reason it was being faked
> -hadriel

View raw message