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

IndexWriter.setCommitData should be late binding

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.0, 6.2
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      Today, IndexWriter.setCommitData is early-binding: as soon as you call it, it clones the provided map and later on when commit is called, it uses that clone.

      But this makes it hard for some use cases where the app needs to record more timely information based on when specifically the commit actually occurs. E.g., with LUCENE-7302, it would be helpful to store the max completed sequence number in the commit point: that would be a lower bound of operations that were after the commit.

      I think the most minimal way to do this would be to upgrade the existing method to take an Iterable<Map.Entry<String,String>, and document that it's now late binding, i.e. IW will pull an Iterator from that when it's time to write the segments file.

      Or we could also make an explicit interface that you pass (seems like overkill), or maybe have a listener or something (or you subclass IW) that's invoked when the commit is about to write the segments file, but that also seems like overkill.

      1. LUCENE-7335.patch
        34 kB
        Michael McCandless

        Activity

        Hide
        mikemccand Michael McCandless added a comment -

        Patch, just renaming the method to set/getLiveCommitData and taking Iterable ...

        Show
        mikemccand Michael McCandless added a comment - Patch, just renaming the method to set/getLiveCommitData and taking Iterable ...
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 55fc01bc4517e3824de39ce9ef5b809b4e3bdd43 in lucene-solr's branch refs/heads/master from Mike McCandless
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=55fc01b ]

        LUCENE-7335: IW's commit data is now late binding

        Show
        jira-bot ASF subversion and git services added a comment - Commit 55fc01bc4517e3824de39ce9ef5b809b4e3bdd43 in lucene-solr's branch refs/heads/master from Mike McCandless [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=55fc01b ] LUCENE-7335 : IW's commit data is now late binding
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit ea9c7ea88cc92f5ed18716874bfbbc8c287e8538 in lucene-solr's branch refs/heads/branch_6x from Mike McCandless
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=ea9c7ea ]

        LUCENE-7335: IW's commit data is now late binding

        Show
        jira-bot ASF subversion and git services added a comment - Commit ea9c7ea88cc92f5ed18716874bfbbc8c287e8538 in lucene-solr's branch refs/heads/branch_6x from Mike McCandless [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=ea9c7ea ] LUCENE-7335 : IW's commit data is now late binding
        Hide
        mikemccand Michael McCandless added a comment -

        Bulk close resolved issues after 6.2.0 release.

        Show
        mikemccand Michael McCandless added a comment - Bulk close resolved issues after 6.2.0 release.

          People

          • Assignee:
            mikemccand Michael McCandless
            Reporter:
            mikemccand Michael McCandless
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development