Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core/index
    • Labels:
      None
    • Lucene Fields:
      New, Patch Available

      Description

      IndexWriter is not so easy to extend. It hides a lot of useful methods from extending classes as well as useful members (like infoStream). Most of this stuff is very straightforward and I believe it's not exposed for no particular reason. Over in LUCENE-1879 I plan extend IndexWriter to provide a ParallelWriter which will support the parallel indexing requirements. For that I'll need access to several methods and members. I plan to contain in this issue some simple hooks, nothing fancy (and hopefully controversial). I'll leave the rest to specific issues. For now:

      1. Introduce a protected default constructor and init(Directory, IndexWriterConfig). That's required because ParallelWriter does not itself index anything, but instead delegates to its Slices. So that ctor is for convenience only, and I'll make it clear (through javadocs) that if one uses it, one needs to call init(). PQ has the same pattern.
      2. Expose some members and methods that are useful for extensions (such as config, infoStream etc.). Some candidates are package-private methods, but these will be reviewed and converted on a case by case basis.

      I don't plan to do anything drastic here, just prepare IW for easier extendability.

      I'll post a patch after LUCENE-2320 is committed.

        Activity

        Hide
        Earwin Burrfoot added a comment -

        Please, only open up something if you decorate it with @experimental @will.change.without.single.warning annotations like a christmas tree.

        With luceneish freakyish back-compat policy you want to have as few things public as possible

        Show
        Earwin Burrfoot added a comment - Please, only open up something if you decorate it with @experimental @will.change.without.single.warning annotations like a christmas tree. With luceneish freakyish back-compat policy you want to have as few things public as possible
        Hide
        Shai Erera added a comment -

        Sure, I'll annotate whatever is needed for PI (e.g. protected/public but still for internal use) as @lucene.experimental. After we see more than one extension of IW, we can decide whether those API need to made 'public' in essence (i.e. w/o the annotation).

        I've been burned plenty of times w/ bw policy .

        Show
        Shai Erera added a comment - Sure, I'll annotate whatever is needed for PI (e.g. protected/public but still for internal use) as @lucene.experimental. After we see more than one extension of IW, we can decide whether those API need to made 'public' in essence (i.e. w/o the annotation). I've been burned plenty of times w/ bw policy .
        Hide
        Shai Erera added a comment -

        I don't think this issue is relevant anymore.

        Show
        Shai Erera added a comment - I don't think this issue is relevant anymore.

          People

          • Assignee:
            Unassigned
            Reporter:
            Shai Erera
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development