[jira] [Commented] (SOLR-11629) CloudSolrClient.Builder should accept a zk host

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (SOLR-11629) CloudSolrClient.Builder should accept a zk host

JIRA jira@apache.org

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

Varun Thacker commented on SOLR-11629:
--------------------------------------

Hi Jason,

Thanks for picking it up!

Sorry I've been tied up with work past few days. Things should get better in the next couple of days for me to fully review and commit it.

So esentially we added 4 Builders here:
{code}
1.   public Builder(List<String> solrUrls) {
2.   public Builder(List<String> zkHosts, Optional<String> zkChroot) {
3.   public Builder(String zkHost, Optional<String> zkChroot) {
4.   public Builder(ClusterStateProvider stateProvider) {
{code}

Do we need 3? We could just add a simple Javadoc line in 2 on how to create a singleton list?
Do we need 4? I guess if you implement your own ClusterStateProvider which would certainly be an expert use case. So a) we don't add it for now unless someone explicitly asks for it or b) document it as experts only?

What are your thoughts on these? Apart from this if we add Javadocs to the Builders I should be able to review it Thursday/Friday and commit it if the rest of the patch looks good.

> CloudSolrClient.Builder should accept a zk host
> -----------------------------------------------
>
>                 Key: SOLR-11629
>                 URL: https://issues.apache.org/jira/browse/SOLR-11629
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public)
>            Reporter: Varun Thacker
>         Attachments: SOLR-11629.patch
>
>
> Today we need to create an empty builder and then wither pass zkHost or withSolrUrl
> {code}
> SolrClient solrClient = new CloudSolrClient.Builder().withZkHost("localhost:9983").build();
> solrClient.request(updateRequest, "gettingstarted");
> {code}
> What if we have two constructors , one that accepts a zkHost and one that accepts a SolrUrl .
> The advantages that I can think of are:
> - It will be obvious to users that we support two mechanisms of creating a CloudSolrClient . The SolrUrl option is cool and applications don't need to know about ZooKeeper and new users will learn about this . Maybe our example's on the ref guide should use this?
> - Today people can set both zkHost and solrUrl  but CloudSolrClient can only utilize one of them
> HttpClient's Builder accepts the host
> {code}
> HttpSolrClient client = new HttpSolrClient.Builder("http://localhost:8983/solr").build();
> client.request(updateRequest, "techproducts");
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]