[
https://issues.apache.org/jira/browse/ZOOKEEPER-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13098930#comment-13098930
]
César Álvarez Núñez commented on ZOOKEEPER-1172:
------------------------------------------------
Sorry, I should have read the link
[https://cwiki.apache.org/confluence/display/ZOOKEEPER/HowToContribute How To
Contribute] more carefully.
Fixed findbugs and core test issues. Running full "ant test".
With regard to "don't use system properties/env, rather use config file", I'm
not really sure if config file is the best option since it contains server
configuration properties and not client properties.
Anyway I think that a better approach is to include a new constructor like the
following (with its corresponding two sibling without 'canBeReadOnly' and
'sessionId & sessionPasswd'.):
{code:title=ZooKeeper.java|borderStyle=solid}
public ZooKeeper(HostProvider hostProvider,
String chroot,
int sessionTimeout,
Watcher watcher,
long sessionId,
byte[] sessionPasswd,
boolean canBeReadOnly) throws IOException
{code}
Where "connectString" is replaced by two new parameters: HostProvider and
chroot.
In fact "chroot" should be separated from "servers list" because you can
interpret that it is allowed to set a chroot per server
(server1:port1/chroot1,server2:port2/chroot2).
I understand that there is not any limitation on adding new constructors as
long as backward compatibility is not broken, don't I?
Finally, why priority has been changed to "Major"? I don't like it could block
in some way the 3.4.0 release.
> Support for custom org.apache.zookeeper.client.HostProvider implementation.
> ---------------------------------------------------------------------------
>
> Key: ZOOKEEPER-1172
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1172
> Project: ZooKeeper
> Issue Type: Improvement
> Components: java client
> Reporter: César Álvarez Núñez
> Assignee: César Álvarez Núñez
> Attachments: ZOOKEEPER-1172.patch
>
>
> The interface org.apache.zookeeper.client.HostProvider exist but it is
> hardcoded to org.apache.zookeeper.client.StaticHostProvider at Zookeeper
> constructor.
> Now it could be replaced by any other implementation just by pointing the
> system property "zookeeper.clientHostProvider" to the class name of your
> custom HostProvider implementation.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira