[
https://issues.apache.org/jira/browse/SOLR-10452?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16080608#comment-16080608
]
Jason Gerlowski commented on SOLR-10452:
----------------------------------------
I think I agree in part, but not in the whole.
bq. Anything that needs flexibility post-construction ... shouldn't be part of
the builder
Though I tried to do them both in the attached patch, deprecating the setter,
and adding a builder method are conceptually separate things. IMO even if we
don't deprecate the setter, adding this method to the builder still makes
sense. (Users probably find it a bit unintuitive that we allow setting some
options with a builder, but then require others to be specified with a setter
after creation.)
bq. i.e. might need to be changed post construction of the client
I'm surprised to hear you say that this is more likely to change than some
other properties already present in the builders (timeouts, response parsers,
base urls, etc.). But this is likely just a failure of imagination on my part;
I'm admittedly not familiar with all use cases here. If you think it's
reasonable for users to change this during execution (as opposed to creating a
different client with the new options), then I'll of course defer to your
judgment. Though I'm curious if there's a use case the requires changing this
that I'm forgetting/missing.
In that case though, would you mind weighing in over on SOLR-8975 (or here)
about which other setters you have this concern with? I'd hoped to add builder
methods for many of these setters (and optionally deprecate the setters
themselves). I'd like to get a clearer picture of which ones would still make
sense for this in your opinion.
> setQueryParams should be deprecated in favor of SolrClientBuilder methods
> -------------------------------------------------------------------------
>
> Key: SOLR-10452
> URL: https://issues.apache.org/jira/browse/SOLR-10452
> Project: Solr
> Issue Type: Sub-task
> Components: SolrJ
> Reporter: Jason Gerlowski
> Priority: Minor
> Fix For: 7.0
>
> Attachments: SOLR-10452.patch
>
>
> 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 {{SolrClient}}s 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 subtask endeavors to change this behavior for the {{setQueryParams}}
> setter on all {{SolrClient}} implementations.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]