Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-4132

IndexWriterConfig live settings

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 4.0-ALPHA, 6.0
    • None
    • None
    • New, Patch Available

    Description

      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:

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

      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?

      Attachments

        1. LUCENE-4132.patch
          58 kB
          Shai Erera
        2. LUCENE-4132.patch
          58 kB
          Shai Erera
        3. LUCENE-4132.patch
          57 kB
          Shai Erera
        4. LUCENE-4132.patch
          55 kB
          Shai Erera
        5. LUCENE-4132.patch
          54 kB
          Shai Erera
        6. LUCENE-4132.patch
          57 kB
          Shai Erera
        7. LUCENE-4132.patch
          59 kB
          Shai Erera

        Activity

          People

            shaie Shai Erera
            shaie Shai Erera
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: