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

Lucene50PostingsReader.postings() casts BlockTermState param to private IntBlockTermState

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 8.3
    • core/codecs
    • None
    • New

    Description

      Lucene50PostingsReader is the public API that offers the postings() method to read the postings. Any PostingFormat can use it (as well as Lucene50PostingsWriter) to read/write postings.

      But the postings() method asks for a (public) BlockTermState param which is internally cast to the private IntBlockTermState. This BlockTermState is provided by Lucene50PostingsReader.newTermState().

      public PostingsEnum postings(FieldInfo fieldInfo, BlockTermState termState, PostingsEnum reuse, int flags)

      This actually makes impossible to a custom PostingFormat customizing the Block file structure to use this postings() method by providing their (Int)BlockTermState, because they cannot access the FP fields of the IntBlockTermState returned by PostingsReaderBase.newTermState().

      Proposed change:

      • Either make IntBlockTermState public, as well as its fields.
      • Or replace it by an interface in the postings() method. In this case the IntBlockTermState fields currently accessed directly would be replaced by getter/setter.

      Attachments

        Issue Links

          Activity

            People

              dsmiley David Smiley
              broustant Bruno Roustant
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m