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

Make IndexReader.open() always return MSR to simplify (re-)opens.

Details

    • Task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.9
    • 2.9
    • None
    • None
    • New

    Description

      As per discussion in mailing list, I'm making DirectoryIndexReader.open() always return MSR, even for single-segment indexes.
      While theoretically valid in the past (if you make sure to keep your index constantly optimized) this feature is made practically obsolete by per-segment collection.

      The patch somewhat de-hairies (re-)open logic for MSR/SR.
      SR no longer needs an ability to pose as toplevel directory-owning IR.
      All related logic is moved from DIR to MSR.
      DIR becomes almost empty, and copying two or three remaining fields over to MSR/SR, I remove it.
      Lots of tests fail, as they rely on SR returned from IR.open(), I fix by introducing SR.getOnlySegmentReader static package-private method.
      Some previous bugs are uncovered, one is fixed in LUCENE-1645, another (partially fixed in LUCENE-1648) is fixed in this patch.

      Attachments

        1. LUCENE-1651.patch
          161 kB
          Earwin Burrfoot
        2. LUCENE-1651.patch
          161 kB
          Earwin Burrfoot
        3. LUCENE-1651.patch
          91 kB
          Earwin Burrfoot
        4. LUCENE-1651.patch
          92 kB
          Earwin Burrfoot
        5. LUCENE-1651-tag.patch
          17 kB
          Earwin Burrfoot
        6. LUCENE-1651-tag.patch
          10 kB
          Earwin Burrfoot

        Issue Links

          Activity

            People

              mikemccand Michael McCandless
              earwin Earwin Burrfoot
              Votes:
              1 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: