[
https://issues.apache.org/jira/browse/SOLR-10465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16657322#comment-16657322
]
Jason Gerlowski commented on SOLR-10465:
----------------------------------------
Thanks for the cross-reference Erick! Def would've missed that. And I agree
on the rename
And thanks for taking interest in this Charles. I didn't realize this when I
created the JIRA, but I think the fate of this setter should be tied to that of
{{setDefaultCollection}} (see SOLR-10466). If we lock down the routing-field
only, we're kindof undercutting {{setDefaultCollection}} (that method becomes
useless/unusable unless several of your collections all have the same
routing-field-name). This point also extends to the SolrClient methods which
take in an overriding collection. If we lock down the routing field, we're
making {{SolrClient.add(String collection, SolrInputDocument doc)}} tougher to
use.
I think the end goal of thread-safety is still something to aim for, but I'm
not sure moving this setter to the builder now is the right way to go with the
current obstacles. Sorry to only catch this after you'd put work into it
Charles. Sorry to waste your time; I should have caught some of the problems
here earlier and closed this jira out (or at least posted a word-of-warning
here). That's on me and I'm sorry!
If you're still interested in helping out and improving this area of the code,
there are some other steps we _can_ take though. We can deprecate/rename the
method to {{setRoutingField}} or something similar as Erick suggested. There's
also other setters that cause thread-safety issues, where the simple
move-it-to-the-builder approach still makes sense. Examples of this are:
SOLR-10467, SOLR-10468, SOLR-10462, and SOLR-10461. Sorry again for the
confusion/trouble.
> setIdField should be deprecated in favor of SolrClientBuilder methods
> ---------------------------------------------------------------------
>
> Key: SOLR-10465
> URL: https://issues.apache.org/jira/browse/SOLR-10465
> Project: Solr
> Issue Type: Sub-task
> Components: SolrJ
> Reporter: Jason Gerlowski
> Priority: Minor
> Fix For: 7.0
>
> Attachments: SOLR-10465.patch, SOLR-10465.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 {{setIdField}} setter
> on all {{SolrClient}} implementations.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]