Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

chroot with ZooKeeperClient? #52

Open
jdanbrown opened this Issue · 5 comments

2 participants

@jdanbrown

Looking at the ZooKeeperClient api (and also the implementation), it looks like there's no way to connect to the zk cluster using a chroot suffix, which I typically do just by specifying the zk connect string directly, e.g.

"host-a,host-b,host-c/prod/service"
@jsirois
Collaborator

Ack - this would be a nice improvement. Definitely happy to take a patch if you're willing.

@jdanbrown

Sure. How about another constructor that takes the zk connect string directly? Something like:

public ZooKeeperClient(Amount<Integer, Time> sessionTimeout, Credentials credentials, String zooKeeperServers) {
  ...
  this.zooKeeperServers = zooKeeperServers;
}

In my experience those strings are specified as-is in the config, so I'm not sure if there's much advantage to trying to split it all up into hosts and ports and chroots, rather than just passing through the string directly and letting the ZooKeeper constructor complain if it can't parse it.

@jsirois
Collaborator

I'd prefer an additional chroot argument overload too to keep with the existing style - reasoning going like this:
Most internal usages use the Arg parsing facility to parse Arg<List<InetSocketAddress>> at startup - validation can fail fast here. The actual ZooKeeper client is then often created later in a background thread.

@jdanbrown

Ok, sounds good to me. I'll submit a pull request.

@jdanbrown

Pull requested: #53.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.