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

noble.paul edited comment on SOLR-269 at 7/24/08 9:00 AM:
----------------------------------------------------------

bq.Many processors need to maintain state within a request. Check the 'log' 
processor. I have one that checks if the user has permission on everything in 
the request before executing the commands. 
I do not think we need a factory where we need to maintain local state . 
Everything can be maintained in the method stack 

example
{code}
class LocalState{
class LogUpdateProcessor extends UpdateRequestProcessor {
  private final SolrQueryRequest req;
  private final SolrQueryResponse rsp;
  private final UpdateRequestProcessor next;
  private final NamedList<Object> toLog;
doSomething(){
//do your thing
}
}

 public class LogUpdateProcessor extends UpdateRequestProcessor
   
  
  
  @Override
  public void processAdd(AddUpdateCommand cmd) throws IOException {
     LocalState state = new LocalState ();//pass the params
     state.doSomeThing()
    }
    
    }

{code}
Here the method acts as the factory and the framework does not have to worry

      was (Author: noble.paul):
    bq.Many processors need to maintain state within a request. Check the 'log' 
processor. I have one that checks if the user has permission on everything in 
the request before executing the commands. 
I do not think we need a factory where we need to maintain local state . 
Everything can be maintained in the method stack 

example
{code}
class LocalState{
class LogUpdateProcessor extends UpdateRequestProcessor {
  private final SolrQueryRequest req;
  private final SolrQueryResponse rsp;
  private final UpdateRequestProcessor next;
  private final NamedList<Object> toLog;
doSomething(){
//do your thing
}
}

 public class LogUpdateProcessor extends UpdateRequestProcessor
   
  
  
  @Override
  public void processAdd(AddUpdateCommand cmd) throws IOException {
     LocalState state = new LocalState ();//pass the params
     state.doSomeThing()
    }
    
    }

{code}

  
> 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, 
> SOLR-269-UpdateRequestProcessorFactory.patch, 
> SOLR-269-UpdateRequestProcessorFactory.patch, UpdateProcessor.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