No (easy) way to get the current session id
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gozk |
New
|
Undecided
|
Unassigned |
Bug Description
After doing a zookeeper.Conn.Get you are given a zookeeper.Stat struct. One of the methods on the Stat struct is EphemeralOwner which returns an int64.
The issue is that you can't lookup your own id from the zookeeper.Conn or zookeeper.ClientId.
Looking through the zookeeper documentation for the Java code they have a `getSessionId` (http://
As a work around I could create a random ephemeral znode, do a stat, get the owner id and then store that locally for comparison, this is a much larger hassle than I'd prefer.
-T
I've attached a patch which adds a very simple `ClientId. SessionId( )` method