这是indexloc提供的服务,不要输入任何密码
Skip to content
This repository was archived by the owner on Jul 21, 2021. It is now read-only.
This repository was archived by the owner on Jul 21, 2021. It is now read-only.

Chroot support? #32

@mmcgrana

Description

@mmcgrana

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!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions