You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Jason Gerlowski (JIRA)" <ji...@apache.org> on 2018/05/07 11:33:00 UTC

[jira] [Commented] (SOLR-12309) CloudSolrClient.Builder constructors are not well documented

    [ https://issues.apache.org/jira/browse/SOLR-12309?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16465806#comment-16465806 ] 

Jason Gerlowski commented on SOLR-12309:
----------------------------------------

bq. Is it a good idea to completely eliminate the ability to create a cloud client using a single string that matches the zkHost value used when starting Solr in cloud mode?

I added the two new constructors over on SOLR-11629.  They were added in an effort to make it clearer to users that these arguments were required, and that they weren't "just another Builder setting", but truly required arguments.  But since they're both strings, an {{Optional}}  was introduced on the ZK-based constructor (both to distinguish the method signatures, and because the chroot is a conceptually separate thing).

So, if you consider the added {{Optional}} param an evil; I'd at least argue it's a necessary one, because it allows us to distinguish the conn string/URL options from the other 6 or 7 setters that aren't required in any way.

Hope that clarifies things a bit.

But I do agree with your main point that the Javadocs can be improved, and that an example or two would be particularly helpful.  I'm happy to help draft up some text for this, unless you have already been thinking about it a lot and want to see it through?

Do you remember trying any particular constructor arguments that didn't work out for you the first time?  Any missteps or false-impressions you had reading the existing Javadocs might be good to know, as guides for what needs added/corrected in the Javadocs.

> CloudSolrClient.Builder constructors are not well documented
> ------------------------------------------------------------
>
>                 Key: SOLR-12309
>                 URL: https://issues.apache.org/jira/browse/SOLR-12309
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: clients - java
>    Affects Versions: 7.3
>            Reporter: Shawn Heisey
>            Priority: Minor
>
> I was having a lot of trouble figuring out how to create a CloudSolrClient object without using deprecated code.
> The no-arg constructor on the Builder object is deprecated, and the two remaining methods have similar signatures to each other.  It is not at all obvious how to successfully call the one that uses ZooKeeper to connect.  The javadoc is silent on the issue.  I did finally figure it out with a lot of googling, and I would like to save others the hassle.
> I believe that this is what the javadoc for the third ctor should say:
> ----
> Provide a series of ZooKeeper hosts which will be used when configuring CloudSolrClient instances.  Optionally, include a chroot to be used when accessing the ZooKeeper database.
> Here are a couple of examples.  The first one has no chroot, the second one does:
> new CloudSolrClient.Builder(zkHosts, Optional.empty())
> new CloudSolrClient.Builder(zkHosts, Optional.of("/solr"))
> ----
> The javadoc for the URL-based method should probably say something to indicate that it is easy to confuse with the ZK-based method.
> I have not yet looked at the current reference guide to see if that has any clarification.
> Is it a good idea to completely eliminate the ability to create a cloud client using a single string that matches the zkHost value used when starting Solr in cloud mode?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org