[
https://issues.apache.org/jira/browse/SOLR-8332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15622314#comment-15622314
]
Christine Poerschke commented on SOLR-8332:
-------------------------------------------
bq. Creating a new instance of {{ReplicaListTransformer}} for each request is
wasteful. That is why added the request object as a parameter to each call.
This way you can manage with a singleton
[#102|https://github.com/apache/lucene-solr/pull/102] supports use of a
singleton where possible e.g. {{HttpShardHandlerFactory}}'s shuffling
transformer:
{code}
private final ReplicaListTransformer shufflingReplicaListTransformer = new
ShufflingReplicaListTransformer(r);
...
ReplicaListTransformer getReplicaListTransformer(final SolrQueryRequest req)
{
return shufflingReplicaListTransformer;
}
{code}
[#102|https://github.com/apache/lucene-solr/pull/102] also supports use of
per-request transformers where required (e.g.
[ReplicaListTransformerTest.java#L96-L111|https://github.com/bloomberg/lucene-solr/blob/master-solr-8332/solr/core/src/test/org/apache/solr/handler/component/ReplicaListTransformerTest.java#L96-L111])
so that request param deciphering happens only once per prepDistributed call
rather than repeatedly in each transform call.
> factor HttpShardHandler[Factory]'s url shuffling out into a
> ReplicaListTransformer class
> ----------------------------------------------------------------------------------------
>
> Key: SOLR-8332
> URL: https://issues.apache.org/jira/browse/SOLR-8332
> Project: Solr
> Issue Type: Wish
> Reporter: Christine Poerschke
> Assignee: Christine Poerschke
> Priority: Minor
> Attachments: SOLR-8332.patch, SOLR-8332.patch, SOLR-8332.patch
>
>
> Proposed patch against trunk to follow. No change in behaviour intended. This
> would be as a step towards SOLR-6730.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]