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

All PackedInts APIs should share a common interface for random-access reads

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 4.6
    • None
    • None
    • New

    Description

      It would be convenient if all PackedInts had a super-class with the long get(long index) method. Maybe this super-class could even be NumericDocValues so that doc values formats don't need to wrap eg. BlockPackedReader into this kind of construct:

              final BlockPackedReader reader = new BlockPackedReader(data, entry.packedIntsVersion, entry.blockSize, entry.count, true);
              return new LongNumericDocValues() {
                @Override
                public long get(long id) {
                  return reader.get(id);
                }
              };
      

      Instead, they could just

              return new BlockPackedReader(data, entry.packedIntsVersion, entry.blockSize, entry.count, true);
      

      Attachments

        1. LUCENE-5301.patch
          13 kB
          Adrien Grand
        2. LUCENE-5301.patch
          21 kB
          Adrien Grand

        Activity

          People

            jpountz Adrien Grand
            jpountz Adrien Grand
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: