Open 0xDTE opened 1 year ago
torvalds.dev is analyzing the ticket
torvalds.dev is analyzing the ticket
The issue at hand is related to the CloudSolrClient.Builder
class in Apache Solr. Currently, the builder class requires the user to create an empty builder and then pass either a zkHost
(ZooKeeper host) or withSolrUrl
. The user is suggesting that two constructors be created, one that accepts a zkHost
and one that accepts a SolrUrl
.
The advantages of this approach, as stated by the user, are:
CloudSolrClient
are supported.SolrUrl
option is user-friendly and applications don't need to know about ZooKeeper.zkHost
and solrUrl
but CloudSolrClient
can only utilize one of them.The user also points out that HttpClient's Builder
accepts the host, which is a feature they would like to see in CloudSolrClient.Builder
.
The relevant files to this issue are:
solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrClientBuilderTest.java
solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudHttp2SolrClientBuilderTest.java
These files contain tests for the CloudSolrClient.Builder
and CloudHttp2SolrClient.Builder
classes respectively.
Based on the issue, the following actions should be taken:
CloudSolrClient.Builder
and CloudHttp2SolrClient.Builder
classes to include two constructors, one that accepts a zkHost
and one that accepts a SolrUrl
.CloudSolrClient
are supported.CloudSolrClientBuilderTest.java
and CloudHttp2SolrClientBuilderTest.java
to test the new constructors.zkHost
and solrUrl
are set, an appropriate error is thrown or one of them is prioritized.
Today we need to create an empty builder and then wither pass zkHost or withSolrUrl
SolrClient solrClient = new CloudSolrClient.Builder().withZkHost("localhost:9983").build(); solrClient.request(updateRequest, "gettingstarted"); 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
HttpSolrClient client = new HttpSolrClient.Builder("http://localhost:8983/solr").build(); client.request(updateRequest, "techproducts");