Class Lucene90CompressingTermVectorsReader

java.lang.Object
org.apache.lucene.index.TermVectors
org.apache.lucene.codecs.TermVectorsReader
org.apache.lucene.codecs.lucene90.compressing.Lucene90CompressingTermVectorsReader
All Implemented Interfaces:
Closeable, AutoCloseable, Cloneable

public final class Lucene90CompressingTermVectorsReader extends TermVectorsReader
  • Field Details

    • PREFETCH_CACHE_SIZE

      private static final int PREFETCH_CACHE_SIZE
      See Also:
    • PREFETCH_CACHE_MASK

      private static final int PREFETCH_CACHE_MASK
      See Also:
    • fieldInfos

      private final FieldInfos fieldInfos
    • indexReader

      final FieldsIndex indexReader
    • vectorsStream

      final IndexInput vectorsStream
    • version

      private final int version
    • packedIntsVersion

      private final int packedIntsVersion
    • compressionMode

      private final CompressionMode compressionMode
    • decompressor

      private final Decompressor decompressor
    • chunkSize

      private final int chunkSize
    • numDocs

      private final int numDocs
    • closed

      private boolean closed
    • reader

      private final BlockPackedReaderIterator reader
    • numChunks

      private final long numChunks
    • numDirtyChunks

      private final long numDirtyChunks
    • numDirtyDocs

      private final long numDirtyDocs
    • maxPointer

      private final long maxPointer
    • blockState

    • prefetchedBlockIDCache

      private final long[] prefetchedBlockIDCache
    • prefetchedBlockIDCacheIndex

      private int prefetchedBlockIDCacheIndex
  • Constructor Details

  • Method Details

    • getCompressionMode

      CompressionMode getCompressionMode()
    • getChunkSize

      int getChunkSize()
    • getPackedIntsVersion

      int getPackedIntsVersion()
    • getVersion

      int getVersion()
    • getIndexReader

      FieldsIndex getIndexReader()
    • getVectorsStream

      IndexInput getVectorsStream()
    • getMaxPointer

      long getMaxPointer()
    • getNumDirtyDocs

      long getNumDirtyDocs()
    • getNumDirtyChunks

      long getNumDirtyChunks()
    • getNumChunks

      long getNumChunks()
    • getNumDocs

      int getNumDocs()
    • ensureOpen

      private void ensureOpen() throws AlreadyClosedException
      Throws:
      AlreadyClosedException - if this TermVectorsReader is closed
    • close

      public void close() throws IOException
      Throws:
      IOException
    • clone

      public TermVectorsReader clone()
      Description copied from class: TermVectorsReader
      Create a clone that one caller at a time may use to read term vectors.
      Specified by:
      clone in class TermVectorsReader
    • getMergeInstance

      public TermVectorsReader getMergeInstance()
      Description copied from class: TermVectorsReader
      Returns an instance optimized for merging. This instance may only be consumed in the thread that called TermVectorsReader.getMergeInstance().

      The default implementation returns this

      Overrides:
      getMergeInstance in class TermVectorsReader
    • slice

      private static RandomAccessInput slice(IndexInput in) throws IOException
      Throws:
      IOException
    • isLoaded

      boolean isLoaded(int docID)
      Checks if a given docID was loaded in the current block state.
    • prefetch

      public void prefetch(int docID) throws IOException
      Description copied from class: TermVectors
      Optional method: Give a hint to this TermVectors instance that the given document will be read in the near future. This typically delegates to IndexInput.prefetch(long, long) and is useful to parallelize I/O across multiple documents.

      NOTE: This API is expected to be called on a small enough set of doc IDs that they could all fit in the page cache. If you plan on retrieving a very large number of documents, it may be a good idea to perform calls to TermVectors.prefetch(int) and TermVectors.get(int) in batches instead of prefetching all documents up-front.

      Overrides:
      prefetch in class TermVectors
      Throws:
      IOException
    • get

      public Fields get(int doc) throws IOException
      Description copied from class: TermVectors
      Returns term vectors for this document, or null if term vectors were not indexed.

      The returned Fields instance acts like a single-document inverted index (the docID will be 0). If offsets are available they are in an OffsetAttribute available from the PostingsEnum.

      Specified by:
      get in class TermVectors
      Throws:
      IOException
    • positionIndex

      private int[][] positionIndex(int skip, int numFields, LongValues numTerms, int[] termFreqs)
    • readPositions

      private int[][] readPositions(int skip, int numFields, LongValues flags, LongValues numTerms, int[] termFreqs, int flag, int totalPositions, int[][] positionIndex) throws IOException
      Throws:
      IOException
    • sum

      private static int sum(int[] arr)
    • checkIntegrity

      public void checkIntegrity() throws IOException
      Description copied from class: TermVectorsReader
      Checks consistency of this reader.

      Note that this may be costly in terms of I/O, e.g. may involve computing a checksum value against large data files.

      Specified by:
      checkIntegrity in class TermVectorsReader
      Throws:
      IOException
    • toString

      public String toString()
      Overrides:
      toString in class Object