Lucene - Core
  1. Lucene - Core
  2. LUCENE-4998

be more precise about IOContext for reads

    Details

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

      Description

      Set the context as IOContext.READ / IOContext.READONCE where applicable


      Motivation:

      Custom PostingsFormat may want to check the context on SegmentReadState and branch differently, but for this to work properly the context has to be specified correctly up the stack.

      For example, DirectPostingsFormat only loads postings into memory if the context != MERGE. However a better condition would be context == Context.READ && !context.readOnce.

      1. LUCENE-4998.patch
        4 kB
        Shikhar Bhushan

        Activity

        Shikhar Bhushan created issue -
        Shikhar Bhushan made changes -
        Field Original Value New Value
        Attachment LUCENE-4998.patch [ 12582943 ]
        Hide
        Steve Rowe added a comment -

        Bulk move 4.4 issues to 4.5 and 5.0

        Show
        Steve Rowe added a comment - Bulk move 4.4 issues to 4.5 and 5.0
        Steve Rowe made changes -
        Fix Version/s 4.5 [ 12324742 ]
        Fix Version/s 4.4 [ 12324323 ]
        Hide
        Shikhar Bhushan added a comment -

        Michael McCandless maybe this patch is up your alley?

        Show
        Shikhar Bhushan added a comment - Michael McCandless maybe this patch is up your alley?
        Hide
        Michael McCandless added a comment -

        Thanks Shikhar.

        The patch looks good! Except, the changes in IndexWriter and BufferedDeletesStream are not quite right: because the reader pool may in fact pool (hang onto) the opened SegmentReader, READONCE is not necessarily correct.

        Ie, a reader may be opened in order to apply deletes, and that caller thinks it will READONCE, but then the pool will hang onto it, and reuse that reader to open an NRT reader, or to do a merge, etc.

        Show
        Michael McCandless added a comment - Thanks Shikhar. The patch looks good! Except, the changes in IndexWriter and BufferedDeletesStream are not quite right: because the reader pool may in fact pool (hang onto) the opened SegmentReader, READONCE is not necessarily correct. Ie, a reader may be opened in order to apply deletes, and that caller thinks it will READONCE, but then the pool will hang onto it, and reuse that reader to open an NRT reader, or to do a merge, etc.
        Hide
        ASF subversion and git services added a comment -

        Commit 1522722 from Michael McCandless in branch 'dev/trunk'
        [ https://svn.apache.org/r1522722 ]

        LUCENE-4998: fix a few places to pass IOContext.READONCE instead of IOContext.READ

        Show
        ASF subversion and git services added a comment - Commit 1522722 from Michael McCandless in branch 'dev/trunk' [ https://svn.apache.org/r1522722 ] LUCENE-4998 : fix a few places to pass IOContext.READONCE instead of IOContext.READ
        Hide
        ASF subversion and git services added a comment -

        Commit 1522723 from Michael McCandless in branch 'dev/branches/branch_4x'
        [ https://svn.apache.org/r1522723 ]

        LUCENE-4998: fix a few places to pass IOContext.READONCE instead of IOContext.READ

        Show
        ASF subversion and git services added a comment - Commit 1522723 from Michael McCandless in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1522723 ] LUCENE-4998 : fix a few places to pass IOContext.READONCE instead of IOContext.READ
        Michael McCandless made changes -
        Assignee Michael McCandless [ mikemccand ]
        Hide
        Michael McCandless added a comment -

        Thanks Shikhar, I committed the patch with a few changes: I didn't change BufferedDeletesStream.java nor IndexWriter.java, and fixed one other ctor in SegmentReader.java.

        Show
        Michael McCandless added a comment - Thanks Shikhar, I committed the patch with a few changes: I didn't change BufferedDeletesStream.java nor IndexWriter.java, and fixed one other ctor in SegmentReader.java.
        Michael McCandless made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 4.6 [ 12324999 ]
        Fix Version/s 4.5 [ 12324742 ]
        Resolution Fixed [ 1 ]
        Hide
        ASF subversion and git services added a comment -

        Commit 1530845 from Robert Muir in branch 'dev/branches/lucene_solr_4_5'
        [ https://svn.apache.org/r1530845 ]

        LUCENE-4998, LUCENE-5242, LUCENE-5254, LUCENE-5262, LUCENE-5263, LUCENE-5264: svn merge -c 1522723 -c 1525896 -c 1529136 -c 1529141 -c 1530063 -c 1530416 -c 1530657

        Show
        ASF subversion and git services added a comment - Commit 1530845 from Robert Muir in branch 'dev/branches/lucene_solr_4_5' [ https://svn.apache.org/r1530845 ] LUCENE-4998 , LUCENE-5242 , LUCENE-5254 , LUCENE-5262 , LUCENE-5263 , LUCENE-5264 : svn merge -c 1522723 -c 1525896 -c 1529136 -c 1529141 -c 1530063 -c 1530416 -c 1530657
        Robert Muir made changes -
        Fix Version/s 4.5.1 [ 12325265 ]
        Hide
        ASF subversion and git services added a comment -

        Commit 1533808 from Michael McCandless in branch 'dev/trunk'
        [ https://svn.apache.org/r1533808 ]

        LUCENE-4998: add DocumentExpressionDictionary, to compute each suggestion's weight using a javascript expression

        Show
        ASF subversion and git services added a comment - Commit 1533808 from Michael McCandless in branch 'dev/trunk' [ https://svn.apache.org/r1533808 ] LUCENE-4998 : add DocumentExpressionDictionary, to compute each suggestion's weight using a javascript expression
        Hide
        ASF subversion and git services added a comment -

        Commit 1533809 from Michael McCandless in branch 'dev/branches/branch_4x'
        [ https://svn.apache.org/r1533809 ]

        LUCENE-4998: add DocumentExpressionDictionary, to compute each suggestion's weight using a javascript expression

        Show
        ASF subversion and git services added a comment - Commit 1533809 from Michael McCandless in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1533809 ] LUCENE-4998 : add DocumentExpressionDictionary, to compute each suggestion's weight using a javascript expression
        Hide
        Michael McCandless added a comment -

        Sorry, the above commit was really for LUCENE-5294.

        Show
        Michael McCandless added a comment - Sorry, the above commit was really for LUCENE-5294 .
        Hide
        ASF subversion and git services added a comment -

        Commit 1533870 from Michael McCandless in branch 'dev/branches/branch_4x'
        [ https://svn.apache.org/r1533870 ]

        LUCENE-4998: can't use Lucene3x (test requires doc values)

        Show
        ASF subversion and git services added a comment - Commit 1533870 from Michael McCandless in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1533870 ] LUCENE-4998 : can't use Lucene3x (test requires doc values)
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        122d 4h 37m 1 Michael McCandless 12/Sep/13 21:49

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development