lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shai Erera (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LUCENE-4132) IndexWriterConfig live settings
Date Mon, 11 Jun 2012 13:00:44 GMT

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

Shai Erera commented on LUCENE-4132:
------------------------------------

{quote}
I don't think we should add another Config object, making things complicated for such a very
very expert use case.
Even ordinary users need to use IWC, and 99% of them don't care about changing things live.
{quote}

I'm not proposing to complicate matters for 99.9% of the users. On the contrary -- users will
still do:

{code}
IndexWriterConfig config = new IndexWriterConfig(...);
// configure it
IndexWriter writer = new IndexWriter(dir, config);
{code}

Only the expert users who will want to change some settings "live", will do:
{code}
Config conf = writer.getConfig(); // NOTE: it's a different type
conf.setSomething();
{code}

Config can be an IW internal type and most users won't even be aware of it. Today we document
that the given IWC to IW ctor is cloned and it will remain as such. Only instead of being
cloned to an IWC type, it will be cloned to a Config (or LiveConfig) type.

IWC documentation isn't changed, IW.getConfig changes by removing that NOTE, and if you care
about "lively" configure IW, you can do so through LiveConfig. And we can test that type too
!
                
> IndexWriterConfig live settings
> -------------------------------
>
>                 Key: LUCENE-4132
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4132
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Shai Erera
>            Priority: Minor
>             Fix For: 4.0, 5.0
>
>
> A while ago there was a discussion about making some IW settings "live" and I remember
that RAM buffer size was one of them. Judging from IW code, I see that RAM buffer can be changed
"live" as IW never caches it.
> However, I don't remember which other settings were decided to be "live" and I don't
see any documentation in IW nor IWC for that. IW.getConfig mentions:
> {code}
> * <b>NOTE:</b> some settings may be changed on the
> * returned {@link IndexWriterConfig}, and will take
> * effect in the current IndexWriter instance.  See the
> * javadocs for the specific setters in {@link
> * IndexWriterConfig} for details.
> {code}
> But there's no text on e.g. IWC.setRAMBuffer mentioning that.
> I think that it'd be good if we make it easier for users to tell which of the settings
are "live" ones. There are few possible ways to do it:
> * Introduce a custom @live.setting tag on the relevant IWC.set methods, and add special
text for them in build.xml
> ** Or, drop the tag and just document it clearly.
> * Separate IWC to two interfaces, LiveConfig and OneTimeConfig (name proposals are welcome
!), have IWC impl both, and introduce another IW.getLiveConfig which will return that interface,
thereby clearly letting the user know which of the settings are "live".
> It'd be good if IWC itself could only expose setXYZ methods for the "live" settings though.
So perhaps, off the top of my head, we can do something like this:
> * Introduce a Config object, which is essentially what IWC is today, and pass it to IW.
> * IW will create a different object, IWC from that Config and IW.getConfig will return
IWC.
> * IWC itself will only have setXYZ methods for the "live" settings.
> It adds another object, but user code doesn't change - it still creates a Config object
when initializing IW, and need to handle a different type if it ever calls IW.getConfig.
> Maybe that's not such a bad idea?

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