Class FilterCodecReader

All Implemented Interfaces:
Closeable, AutoCloseable
Direct Known Subclasses:
SortingCodecReader

public abstract class FilterCodecReader extends CodecReader
A FilterCodecReader contains another CodecReader, which it uses as its basic source of data, possibly transforming the data along the way or providing additional functionality.

NOTE: If this FilterCodecReader does not change the content the contained reader, you could consider delegating calls to LeafReader.getCoreCacheHelper() and IndexReader.getReaderCacheHelper().

  • Field Details

    • in

      protected final CodecReader in
      The underlying CodecReader instance.
  • Constructor Details

    • FilterCodecReader

      public FilterCodecReader(CodecReader in)
      Creates a new FilterCodecReader.
      Parameters:
      in - the underlying CodecReader instance.
  • Method Details

    • unwrap

      public static CodecReader unwrap(CodecReader reader)
      Get the wrapped instance by reader as long as this reader is an instance of FilterCodecReader.
    • getFieldsReader

      public StoredFieldsReader getFieldsReader()
      Description copied from class: CodecReader
      Expert: retrieve thread-private StoredFieldsReader
      Specified by:
      getFieldsReader in class CodecReader
    • getTermVectorsReader

      public TermVectorsReader getTermVectorsReader()
      Description copied from class: CodecReader
      Expert: retrieve thread-private TermVectorsReader
      Specified by:
      getTermVectorsReader in class CodecReader
    • getNormsReader

      public NormsProducer getNormsReader()
      Description copied from class: CodecReader
      Expert: retrieve underlying NormsProducer
      Specified by:
      getNormsReader in class CodecReader
    • getDocValuesReader

      public DocValuesProducer getDocValuesReader()
      Description copied from class: CodecReader
      Expert: retrieve underlying DocValuesProducer
      Specified by:
      getDocValuesReader in class CodecReader
    • getPostingsReader

      public FieldsProducer getPostingsReader()
      Description copied from class: CodecReader
      Expert: retrieve underlying FieldsProducer
      Specified by:
      getPostingsReader in class CodecReader
    • getLiveDocs

      public Bits getLiveDocs()
      Description copied from class: LeafReader
      Returns the Bits representing live (not deleted) docs. A set bit indicates the doc ID has not been deleted. If this method returns null it means there are no deleted documents (all documents are live).

      The returned instance has been safely published for use by multiple threads without additional synchronization.

      Specified by:
      getLiveDocs in class LeafReader
    • getFieldInfos

      public FieldInfos getFieldInfos()
      Description copied from class: LeafReader
      Get the FieldInfos describing all fields in this reader.

      Note: Implementations should cache the FieldInfos instance returned by this method such that subsequent calls to this method return the same instance.

      Specified by:
      getFieldInfos in class LeafReader
    • getPointsReader

      public PointsReader getPointsReader()
      Description copied from class: CodecReader
      Expert: retrieve underlying PointsReader
      Specified by:
      getPointsReader in class CodecReader
    • getVectorReader

      public KnnVectorsReader getVectorReader()
      Description copied from class: CodecReader
      Expert: retrieve underlying VectorReader
      Specified by:
      getVectorReader in class CodecReader
    • numDocs

      public int numDocs()
      Description copied from class: IndexReader
      Returns the number of documents in this index.

      NOTE: This operation may run in O(maxDoc). Implementations that can't return this number in constant-time should cache it.

      Specified by:
      numDocs in class IndexReader
    • maxDoc

      public int maxDoc()
      Description copied from class: IndexReader
      Returns one greater than the largest possible document number. This may be used to, e.g., determine how big to allocate an array which will have an element for every document number in an index.
      Specified by:
      maxDoc in class IndexReader
    • getMetaData

      public LeafMetaData getMetaData()
      Description copied from class: LeafReader
      Return metadata about this leaf.
      Specified by:
      getMetaData in class LeafReader
    • doClose

      protected void doClose() throws IOException
      Description copied from class: IndexReader
      Implements close.
      Overrides:
      doClose in class CodecReader
      Throws:
      IOException
    • checkIntegrity

      public void checkIntegrity() throws IOException
      Description copied from class: LeafReader
      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.

      Overrides:
      checkIntegrity in class CodecReader
      Throws:
      IOException
    • getDelegate

      public CodecReader getDelegate()
      Returns the wrapped CodecReader.