Lucene - Core
  1. Lucene - Core
  2. LUCENE-5633

NoMergePolicy should have one singleton - NoMergePolicy.INSTANCE

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.9, 6.0
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New, Patch Available

      Description

      Currently there are two singletons available - MergePolicy.NO_COMPOUND_FILES and MergePolicy.COMPOUND_FILES and it's confusing to distinguish on compound files when the merge policy never merges segments.

      We should have one singleton - NoMergePolicy.INSTANCE

      Post to the relevant discussion - http://mail-archives.apache.org/mod_mbox/lucene-java-user/201404.mbox/%3CCAOdYfZXXyVSf9%2BxYaRhr5v2O4Mc6S2v-qWuT112_CJFYhWTPqw%40mail.gmail.com%3E

        Activity

        Hide
        Shai Erera added a comment -

        To repeat here what I wrote on the thread, if we change to NoMergePolicy.INSTANCE, we should fix its useCompoundFile to return newSegment.info.isCompound.

        Show
        Shai Erera added a comment - To repeat here what I wrote on the thread, if we change to NoMergePolicy.INSTANCE, we should fix its useCompoundFile to return newSegment.info.isCompound.
        Hide
        Shai Erera added a comment -

        Patch removes the two singletons and adds a single INSTANCE. Also .useCompoundFile returns newSegment.info.isCompound. The majority of the patch is in test classes which made use of these singletons (for no good reason!).

        All tests pass.

        Show
        Shai Erera added a comment - Patch removes the two singletons and adds a single INSTANCE. Also .useCompoundFile returns newSegment.info.isCompound. The majority of the patch is in test classes which made use of these singletons (for no good reason!). All tests pass.
        Hide
        ASF subversion and git services added a comment -

        Commit 1591432 from Shai Erera in branch 'dev/trunk'
        [ https://svn.apache.org/r1591432 ]

        LUCENE-5633: replace NoMergePolicy.COMPOUND/NO_COMPOUND by NoMergePolicy.INSTANCE

        Show
        ASF subversion and git services added a comment - Commit 1591432 from Shai Erera in branch 'dev/trunk' [ https://svn.apache.org/r1591432 ] LUCENE-5633 : replace NoMergePolicy.COMPOUND/NO_COMPOUND by NoMergePolicy.INSTANCE
        Hide
        ASF subversion and git services added a comment -

        Commit 1591444 from Shai Erera in branch 'dev/branches/branch_4x'
        [ https://svn.apache.org/r1591444 ]

        LUCENE-5633: replace NoMergePolicy.COMPOUND/NO_COMPOUND by NoMergePolicy.INSTANCE

        Show
        ASF subversion and git services added a comment - Commit 1591444 from Shai Erera in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1591444 ] LUCENE-5633 : replace NoMergePolicy.COMPOUND/NO_COMPOUND by NoMergePolicy.INSTANCE
        Hide
        Shai Erera added a comment -

        Committed to trunk and 4x. Thanks Varun!

        Show
        Shai Erera added a comment - Committed to trunk and 4x. Thanks Varun!
        Hide
        ASF subversion and git services added a comment -

        Commit 1591446 from Shai Erera in branch 'dev/branches/branch_4x'
        [ https://svn.apache.org/r1591446 ]

        LUCENE-5633: leftover from bad merge

        Show
        ASF subversion and git services added a comment - Commit 1591446 from Shai Erera in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1591446 ] LUCENE-5633 : leftover from bad merge

          People

          • Assignee:
            Shai Erera
            Reporter:
            Varun Thacker
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development