Lucene - Core
  1. Lucene - Core
  2. LUCENE-6681

SortingMergePolicy to override MergePolicy.size(...)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.3
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      github pull request to follow

        Activity

        Hide
        ASF GitHub Bot added a comment -

        GitHub user cpoerschke opened a pull request:

        https://github.com/apache/lucene-solr/pull/189

        LUCENE-6681: SortingMergePolicy now overrides MergePolicy.size

        for https://issues.apache.org/jira/i#browse/LUCENE-6681

        You can merge this pull request into a Git repository by running:

        $ git pull https://github.com/bloomberg/lucene-solr trunk-sorting-merge-policy-size

        Alternatively you can review and apply these changes as the patch at:

        https://github.com/apache/lucene-solr/pull/189.patch

        To close this pull request, make a commit to your master/trunk branch
        with (at least) the following in the commit message:

        This closes #189


        commit 02469cce7adeb973598c61fcf3e3e9e8dca435ca
        Author: Christine Poerschke <cpoerschke@bloomberg.net>
        Date: 2015-07-15T11:34:41Z

        LUCENE-????: SortingMergePolicy now overrides MergePolicy.size

        (necessary because SortingMergePolicy.in.size could differ from MergePolicy.size)


        Show
        ASF GitHub Bot added a comment - GitHub user cpoerschke opened a pull request: https://github.com/apache/lucene-solr/pull/189 LUCENE-6681 : SortingMergePolicy now overrides MergePolicy.size for https://issues.apache.org/jira/i#browse/LUCENE-6681 You can merge this pull request into a Git repository by running: $ git pull https://github.com/bloomberg/lucene-solr trunk-sorting-merge-policy-size Alternatively you can review and apply these changes as the patch at: https://github.com/apache/lucene-solr/pull/189.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #189 commit 02469cce7adeb973598c61fcf3e3e9e8dca435ca Author: Christine Poerschke <cpoerschke@bloomberg.net> Date: 2015-07-15T11:34:41Z LUCENE-????: SortingMergePolicy now overrides MergePolicy.size (necessary because SortingMergePolicy.in.size could differ from MergePolicy.size)
        Hide
        Christine Poerschke added a comment -

        in terms of a test for this: i had attempted extending TestSortingMergePolicy.java to have a testMethodsOverridden() similar to that in TestNoMergePolicy.java but that was a little tricky because size(...) is protected in MergePolicy.java

        Show
        Christine Poerschke added a comment - in terms of a test for this: i had attempted extending TestSortingMergePolicy.java to have a testMethodsOverridden() similar to that in TestNoMergePolicy.java but that was a little tricky because size(...) is protected in MergePolicy.java
        Hide
        Adrien Grand added a comment -

        Maybe we could do something like:

          public void testSizeOverridden() throws Exception {
            // make sure the method exists on MergePolicy
            MergePolicy.class.getDeclaredMethod("size", SegmentCommitInfo.class, IndexWriter.class);
            try {
              // and is overridden on SortingMergePolicy
              SortingMergePolicy.class.getDeclaredMethod("size", SegmentCommitInfo.class, IndexWriter.class);
            } catch (NoSuchMethodException e) {
              fail("SortingMergePolicy needs to override size(SegmentCommitInfo, IndexWriter)");
            }
          }
        
        Show
        Adrien Grand added a comment - Maybe we could do something like: public void testSizeOverridden() throws Exception { // make sure the method exists on MergePolicy MergePolicy.class.getDeclaredMethod( "size" , SegmentCommitInfo.class, IndexWriter.class); try { // and is overridden on SortingMergePolicy SortingMergePolicy.class.getDeclaredMethod( "size" , SegmentCommitInfo.class, IndexWriter.class); } catch (NoSuchMethodException e) { fail( "SortingMergePolicy needs to override size(SegmentCommitInfo, IndexWriter)" ); } }
        Hide
        Christine Poerschke added a comment -

        Hi Adrien Grand - thanks for the suggestion to use getDeclaredMethod(...) - i have updated the pull request so that the diff now includes a TestSortingMergePolicy.testMethodsOverridden method.

        Show
        Christine Poerschke added a comment - Hi Adrien Grand - thanks for the suggestion to use getDeclaredMethod(...) - i have updated the pull request so that the diff now includes a TestSortingMergePolicy.testMethodsOverridden method.
        Hide
        ASF subversion and git services added a comment -

        Commit 1691421 from Adrien Grand in branch 'dev/trunk'
        [ https://svn.apache.org/r1691421 ]

        LUCENE-6681: SortingMergePolicy must override MergePolicy.size(...).

        Show
        ASF subversion and git services added a comment - Commit 1691421 from Adrien Grand in branch 'dev/trunk' [ https://svn.apache.org/r1691421 ] LUCENE-6681 : SortingMergePolicy must override MergePolicy.size(...).
        Hide
        ASF subversion and git services added a comment -

        Commit 1691423 from Adrien Grand in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1691423 ]

        LUCENE-6681: SortingMergePolicy must override MergePolicy.size(...).

        Show
        ASF subversion and git services added a comment - Commit 1691423 from Adrien Grand in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1691423 ] LUCENE-6681 : SortingMergePolicy must override MergePolicy.size(...).
        Hide
        Adrien Grand added a comment -

        Thanks Christine, I just committed your change. However, I forgot to add "Close #XXX" to the commit message to close the Github pull request, would you mind closing it? (I don't have rights to) Thanks!

        Show
        Adrien Grand added a comment - Thanks Christine, I just committed your change. However, I forgot to add "Close #XXX" to the commit message to close the Github pull request, would you mind closing it? (I don't have rights to) Thanks!
        Hide
        ASF GitHub Bot added a comment -
        Show
        ASF GitHub Bot added a comment - Github user cpoerschke commented on the pull request: https://github.com/apache/lucene-solr/pull/189#issuecomment-122034909 https://svn.apache.org/r1691421
        Hide
        ASF GitHub Bot added a comment -

        Github user cpoerschke closed the pull request at:

        https://github.com/apache/lucene-solr/pull/189

        Show
        ASF GitHub Bot added a comment - Github user cpoerschke closed the pull request at: https://github.com/apache/lucene-solr/pull/189
        Hide
        Christine Poerschke added a comment -

        Thanks Adrien, pull request now closed, i've referenced the trunk svn revision above in the close comment.

        Show
        Christine Poerschke added a comment - Thanks Adrien, pull request now closed, i've referenced the trunk svn revision above in the close comment.
        Hide
        Shalin Shekhar Mangar added a comment -

        Bulk close for 5.3.0 release

        Show
        Shalin Shekhar Mangar added a comment - Bulk close for 5.3.0 release

          People

          • Assignee:
            Unassigned
            Reporter:
            Christine Poerschke
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development