[ 
https://issues.apache.org/jira/browse/SOLR-269?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12510012
 ] 

Hoss Man commented on SOLR-269:
-------------------------------

> we should return to the question of singleton vs factory - trying to work 
> with a more complex processor may make this choice more obvious.

i'm not really sure if i understand the issue ... but if it's a question of 
performance in the default case then i don't really see an issue -- a Factory 
API can return a Singleton provided the impl is threadsafe (iving us all the 
performance goodness of a Singleton) but switching to a Singleton API really 
limits what people can do when they *want* to have a complex 
UpdateRequestProcessor and know it might take a while.

Yonik, would your concerns be relieved if the default 
UpdateRequestProcessorFactory class was changed to look like this...

public class UpdateRequestProcessorFactory {
  private final UpdateRequestProcessor SINGLETON;
  public UpdateRequestProcessorFactory()  { /*NOOP*/}
  public void init( NamedList<Object> args ) { 
     SINGLETON = new UpdateRequestProcessor( req );
  }
  public UpdateRequestProcessor getInstance( SolrQueryRequest req ) {
    return SINGLETON  
  }
}

?


> UpdateRequestProcessorFactory - process requests before submitting them
> -----------------------------------------------------------------------
>
>                 Key: SOLR-269
>                 URL: https://issues.apache.org/jira/browse/SOLR-269
>             Project: Solr
>          Issue Type: New Feature
>            Reporter: Ryan McKinley
>            Assignee: Ryan McKinley
>             Fix For: 1.3
>
>         Attachments: SOLR-269-UpdateRequestProcessorFactory.patch
>
>
> A simple UpdateRequestProcessor was added to a bloated SOLR-133 commit. 
> An UpdateRequestProcessor lets clients plug in logic after a document has 
> been parsed and before it has been 'updated' with the index.  This is a good 
> place to add custom logic for:
>  * transforming the document fields
>  * fine grained authorization (can user X updated document Y?)
>  * allow update, but not delete (by query?)
>    <requestHandler name="/update" class="solr.StaxUpdateRequestHandler" >
>      <str 
> name="update.processor.class">org.apache.solr.handler.UpdateRequestProcessor</str>
>      <lst name="update.processor.args">
>       ... (optionally pass in arguments to the factory init method) ...
>      </lst> 
>    </requestHandler>
> http://www.nabble.com/Re%3A-svn-commit%3A-r547495---in--lucene-solr-trunk%3A-example-solr-conf-solrconfig.xml-src-java-org-apache-solr-handler-StaxUpdateRequestHandler.java-src-java-org-apache-solr-handler-UpdateRequestProcessor.jav-tf3950072.html#a11206583

-- 
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