Package org.apache.lucene.codecs
Class PostingsReaderBase
java.lang.Object
org.apache.lucene.codecs.PostingsReaderBase
- All Implemented Interfaces:
Closeable,AutoCloseable,Accountable
- Direct Known Subclasses:
IDVersionPostingsReader,Lucene50PostingsReader,Lucene84PostingsReader
The core terms dictionaries (BlockTermsReader,
BlockTreeTermsReader) interact with a single instance
of this class to manage creation of
PostingsEnum and
PostingsEnum instances. It provides an
IndexInput (termsIn) where this class may read any
previously stored data that it had written in its
corresponding PostingsWriterBase at indexing
time.-
Field Summary
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidChecks consistency of this reader.abstract voidclose()abstract voiddecodeTerm(DataInput in, FieldInfo fieldInfo, BlockTermState state, boolean absolute) Actually decode metadata for next termabstract ImpactsEnumimpacts(FieldInfo fieldInfo, BlockTermState state, int flags) Return aImpactsEnumthat computes impacts withscorer.abstract voidinit(IndexInput termsIn, SegmentReadState state) Performs any initialization, such as reading and verifying the header from the provided terms dictionaryIndexInput.abstract BlockTermStateReturn a newly created empty TermStateabstract PostingsEnumpostings(FieldInfo fieldInfo, BlockTermState state, PostingsEnum reuse, int flags) Must fully consume state, since after this call that TermState may be reused.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.lucene.util.Accountable
getChildResources, ramBytesUsed
-
Constructor Details
-
PostingsReaderBase
protected PostingsReaderBase()Sole constructor. (For invocation by subclass constructors, typically implicit.)
-
-
Method Details
-
init
Performs any initialization, such as reading and verifying the header from the provided terms dictionaryIndexInput.- Throws:
IOException
-
newTermState
Return a newly created empty TermState- Throws:
IOException
-
decodeTerm
public abstract void decodeTerm(DataInput in, FieldInfo fieldInfo, BlockTermState state, boolean absolute) throws IOException Actually decode metadata for next term- Throws:
IOException- See Also:
-
postings
public abstract PostingsEnum postings(FieldInfo fieldInfo, BlockTermState state, PostingsEnum reuse, int flags) throws IOException Must fully consume state, since after this call that TermState may be reused.- Throws:
IOException
-
impacts
public abstract ImpactsEnum impacts(FieldInfo fieldInfo, BlockTermState state, int flags) throws IOException Return aImpactsEnumthat computes impacts withscorer.- Throws:
IOException- See Also:
-
checkIntegrity
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.
- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-