Skip to content
This repository has been archived by the owner on Jul 21, 2021. It is now read-only.

Chroot support? #32

Open
mmcgrana opened this issue Jul 7, 2014 · 1 comment
Open

Chroot support? #32

mmcgrana opened this issue Jul 7, 2014 · 1 comment

Comments

@mmcgrana
Copy link

mmcgrana commented Jul 7, 2014

A feature supported by some other Zookeeper clients, including the canonical
JVM one, is chroot support. This allows you to create (or move) a connection
that's relative to some fixed path prefix, for example "/apps/myapp", Chrooting
is discussed in the Zookeeper admin guide here:

https://zookeeper.apache.org/doc/r3.2.2/zookeeperProgrammers.html#ch_zkSessions

Here's the chroot interface for the canonical Java client:

https://zookeeper.apache.org/doc/r3.3.3/api/org/apache/zookeeper/ZooKeeper.html#ZooKeeper(java.lang.String, int, org.apache.zookeeper.Watcher)

What do you think about chroot support in this client?

It would be tricky to support something like this against the current interface
of the Go client because we expect a []string of server addrs, instead of the
single connection string expected by the Java client. But perhaps we could
figure something out. An alternative would be a Chroot(path string) *Conn
method on *Conn that returned a new connection chrooted to the given
path.

If you're interested in supporting chrooting, I'd consider trying to write a
patch for it.

(BTW, thanks for writing and sharing this code!)

@git-hulk
Copy link

git-hulk commented Sep 20, 2017

We also like the chroot feature very much, but it seems that the maintainer didn't want to accept any pr. Finally, we wrap the go-zookeeper connection with chroot. https://github.com/git-hulk/zk_wrapper

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants