It looks very good, Alex. I have just a few comments below.
I was also wondering about the use cases for this. Zookeeper clients could use it directly, but it is not clear if it is they main use case. It might be a good idea to clarify somewhere: documentation, wiki, or jira.
It sounds like there are a couple of related jiras that would be good to link to this one if they are really related:
- Re-resolving DNS hosnames (ZOOKEEPER-338?)
- Specifying user lists with a URL (ZOOKEEPER-390?)
I'm assuming that those will use the functionality of this patch. Is this correct?