[ 
https://issues.apache.org/jira/browse/LUCENE-4215?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13412364#comment-13412364
 ] 

roman commented on LUCENE-4215:
-------------------------------

hi james,

I noticed the writerImpl (and started coding with it), but then realized that 
DIH might have wanted to use its own interface... 

My usecase was to customize the rollback behaviour. With the current situation, 
one has to make a custom DataImport class and duplicate lots of its code (DIH 
is not meant to be subclassed, it seems...) or, i thought, make that small 
change and write:

{code:title=Bar.java|borderStyle=solid}
new DataImporter() {
  public void runCmd(RequestInfo reqParams, DIHWriter sw) {
    DIHWriter w = new CustomWriter(null, ((SolrWriter) sw).req);
    super.runCmd(reqParams, w);
  }
}
{code}

The "writerImpl" parameter is definitely useful. Thanks for the link!
                
> DataImportHandler not using its own interface
> ---------------------------------------------
>
>                 Key: LUCENE-4215
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4215
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: core/other
>    Affects Versions: 4.0-ALPHA
>            Reporter: roman
>              Labels: DIH
>             Fix For: 4.0
>
>         Attachments: dateimporthandler-use-generic-type.patch
>
>
> It is hard to extend DIH (e.g. to provide our own writers). DIH accepts only 
> the SolrWriter instances, despite they implement the DIHWriter interace.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to