Package org.apache.lucene.codecs
Class PostingsReaderBase
- java.lang.Object
-
- org.apache.lucene.codecs.PostingsReaderBase
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,Accountable
- Direct Known Subclasses:
IDVersionPostingsReader
,Lucene50PostingsReader
,Lucene84PostingsReader
public abstract class PostingsReaderBase extends java.lang.Object implements java.io.Closeable, Accountable
The core terms dictionaries (BlockTermsReader, BlockTreeTermsReader) interact with a single instance of this class to manage creation ofPostingsEnum
andPostingsEnum
instances. It provides an IndexInput (termsIn) where this class may read any previously stored data that it had written in its correspondingPostingsWriterBase
at indexing time.
-
-
Field Summary
-
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
PostingsReaderBase()
Sole constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract void
checkIntegrity()
Checks consistency of this reader.abstract void
close()
abstract void
decodeTerm(DataInput in, FieldInfo fieldInfo, BlockTermState state, boolean absolute)
Actually decode metadata for next termabstract ImpactsEnum
impacts(FieldInfo fieldInfo, BlockTermState state, int flags)
Return aImpactsEnum
that computes impacts withscorer
.abstract void
init(IndexInput termsIn, SegmentReadState state)
Performs any initialization, such as reading and verifying the header from the provided terms dictionaryIndexInput
.abstract BlockTermState
newTermState()
Return a newly created empty TermStateabstract PostingsEnum
postings(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, wait
-
Methods inherited from interface org.apache.lucene.util.Accountable
getChildResources, ramBytesUsed
-
-
-
-
Method Detail
-
init
public abstract void init(IndexInput termsIn, SegmentReadState state) throws java.io.IOException
Performs any initialization, such as reading and verifying the header from the provided terms dictionaryIndexInput
.- Throws:
java.io.IOException
-
newTermState
public abstract BlockTermState newTermState() throws java.io.IOException
Return a newly created empty TermState- Throws:
java.io.IOException
-
decodeTerm
public abstract void decodeTerm(DataInput in, FieldInfo fieldInfo, BlockTermState state, boolean absolute) throws java.io.IOException
Actually decode metadata for next term- Throws:
java.io.IOException
- See Also:
PostingsWriterBase.encodeTerm(org.apache.lucene.store.DataOutput, org.apache.lucene.index.FieldInfo, org.apache.lucene.codecs.BlockTermState, boolean)
-
postings
public abstract PostingsEnum postings(FieldInfo fieldInfo, BlockTermState state, PostingsEnum reuse, int flags) throws java.io.IOException
Must fully consume state, since after this call that TermState may be reused.- Throws:
java.io.IOException
-
impacts
public abstract ImpactsEnum impacts(FieldInfo fieldInfo, BlockTermState state, int flags) throws java.io.IOException
Return aImpactsEnum
that computes impacts withscorer
.- Throws:
java.io.IOException
- See Also:
postings(FieldInfo, BlockTermState, PostingsEnum, int)
-
checkIntegrity
public abstract void checkIntegrity() throws java.io.IOException
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:
java.io.IOException
-
close
public abstract void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
-