[ 
https://issues.apache.org/jira/browse/SOLR-8975?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Gerlowski updated SOLR-8975:
----------------------------------
    Attachment: SOLR-8975.patch

I made these changes with respect to {{HttpSolrClient}}, in hopes of getting 
some feedback early, and catching any mistakes/concerns before I work through 
the other SolrCtilient implementations as well.

I'd appreciate any feedback anyone can give.

Some notes about the change:
* the bulk of the changes occur in test files.
* in SOLR-8097, we added some methods for getting SolrClients to 
{{SolrTestCaseJ4}}, which either creates the client via the Builder, or via the 
deprecated ctors/setters.  Since this change adds many fields to HttpSolrClient 
ctors, a handful more of these methods were needed.  It's messy, but it's the 
exact sort of mess that will happen much less often when the SolrClient ctors 
are removed for good (Solr 7?).
* this change doesn't contain any added cases for 
{{HttpSolrClientBuilderTest}}, but those are definitely needed, and are simple 
to add.
* A number of test base-classes initialize/cache SolrClient objects.  
Subclasses then grab these objects, and make a few tweaks as necessary (change 
a timeout, swap out a RequestWriter, etc.).  In an immutable-SolrClient world, 
this base-class initialization makes less sense, since it's hard for the parent 
class to know how children will want to use the SolrClient.  I didn't take any 
steps to address this in this patch, but it's something to think about.  (For 
examples of this, see {{SolrJettyTestCase}} or {{AbstractDistribZkTestBase}}).

> SolrClient setters should be deprecated in favor of SolrClientBuilder methods
> -----------------------------------------------------------------------------
>
>                 Key: SOLR-8975
>                 URL: https://issues.apache.org/jira/browse/SOLR-8975
>             Project: Solr
>          Issue Type: Improvement
>          Components: SolrJ
>            Reporter: Jason Gerlowski
>            Priority: Minor
>         Attachments: SOLR-8975.patch
>
>
> SOLR-8097 added a builder layer on top of each {{SolrClient}} implementation.
> Now that builders are in place for SolrClients, the setters used in each 
> SolrClient can be deprecated, and their functionality moved over to the 
> Builders.  This change brings a few benefits:
> - unifies SolrClient configuration under the new Builders.  It'll be nice to 
> have all the knobs, and levers used to tweak SolrClients available in a 
> single place (the Builders).
> - reduces SolrClient thread-safety concerns.  Currently, clients are mutable. 
>  Using some SolrClient setters can result in erratic and "trappy" behavior 
> when the clients are used across multiple threads.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to