[ 
https://issues.apache.org/jira/browse/SOLR-1367?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12744826#action_12744826
 ] 

Yonik Seeley commented on SOLR-1367:
------------------------------------

bq. What's hard to understand about a callback mechanism?

Callbacks are useful when you need to execute your own snippet of code in a 
different context - that's not the case here.

bq. Also, why would two loops over the same list be the same performance as one?

Because the iteration part is irrelevant compared to what else is done during 
the iteration.  Iteration can be as simple as a pointer dereference.  The 
callback approach has null pointer check whether to invoke the modifier or 
not... and that gets done even if no modifier will be used (but that will also 
be in the noise).

bq. Now multiply the need to do this for every query and I think it would add 
up.

It won't - it won't even be measurable.

bq. The whole use case is very much a special case. Most people in most 
situations don't need to do this. 

Which would seem to argue against adding code to try and do it.

That said, docListToSolrDocList isn't even used in Solr anywhere, so I don't 
care too much - it can be deprecated/removed later.  Solr itself shouldn't use 
this method since it's not streamable.  Allowing custom modifications while 
preserving streamability *does* call for callbacks... but not in 1.4


> Provide Callback mechanism for SolrPluginUtils.docListToSolrDocumentList
> ------------------------------------------------------------------------
>
>                 Key: SOLR-1367
>                 URL: https://issues.apache.org/jira/browse/SOLR-1367
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Grant Ingersoll
>            Priority: Minor
>             Fix For: 1.4
>
>         Attachments: SOLR-1367.patch
>
>
> Sometimes SearchComponents need to modify the DocList.  Often times this 
> requires two loops over the (Solr)DocList: once to convert the DocList to 
> SolrDocList and then once to iterate the SolrDocList for the Search 
> Component.  This can be seen in SOLR-773, for example.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to