lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (LUCENE-4044) Add NamedSPILoader support to TokenizerFactory, TokenFilterFactory and CharFilterFactory
Date Tue, 24 Jul 2012 12:48:35 GMT

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

Uwe Schindler edited comment on LUCENE-4044 at 7/24/12 12:48 PM:
-----------------------------------------------------------------

-There is one problem with the SPI approach:-
-SPI loads one instance per factory. The SPI loader returns only this instance. If you then
set init paramters on it, you modify the only available singleton.-

EDIT: You fixed that in the specail SPI loader :-)

A second problem I see is the fact that on SPI init *all* factories are instantiated, but
there is no way around that without another "Provider" interface inbetween. In all cases it
is important that the factory does *not* initialize the class it creates, otherwise things
like Kumoroji slow down. I hate the fact that SPILoader automatically instantiates the factory,
but there is with Java 6 no way around, unless we write an own parser for META-INF files.
Which would be a good option maybe.
                
      was (Author: thetaphi):
    -There is one problem with the SPI approach:
SPI loads one instance per factory. The SPI loader returns only this instance. If you then
set init paramters on it, you modify the only available singleton.-

EDIT: You fixed that in the specail SPI loader :-)

A second problem I see is the fact that on SPI init *all* factories are instantiated, but
there is no way around that without another "Provider" interface inbetween. In all cases it
is important that the factory does *not* initialize the class it creates, otherwise things
like Kumoroji slow down. I hate the fact that SPILoader automatically instantiates the factory,
but there is with Java 6 no way around, unless we write an own parser for META-INF files.
Which would be a good option maybe.
                  
> Add NamedSPILoader support to TokenizerFactory, TokenFilterFactory and CharFilterFactory
> ----------------------------------------------------------------------------------------
>
>                 Key: LUCENE-4044
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4044
>             Project: Lucene - Core
>          Issue Type: Sub-task
>          Components: modules/analysis
>            Reporter: Chris Male
>             Fix For: 4.0
>
>         Attachments: LUCENE-4044.patch
>
>
> In LUCENE-2510 I want to move all the analysis factories out of Solr and into the directories
with what they create.  This is going to hamper Solr's existing strategy for supporting {{solr.*}}
package names, where it replaces {{solr}} with various pre-defined package names.  One way
to tackle this is to use NamedSPILoader so we simply look up {{StandardTokenizerFactory}}
for example, and find it wherever it is, as long as it is defined as a service.  This is similar
to how we support Codecs currently.
> As noted by Robert in LUCENE-2510, this would also have the benefit of meaning configurations
could be less verbose, would aid in fully decoupling the analysis module from Solr, and make
the analysis factories easier to interact with.

--
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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message