Package org.apache.lucene.codecs
Class PostingsReaderBase
- java.lang.Object
 - 
- org.apache.lucene.codecs.PostingsReaderBase
 
 
- 
- All Implemented Interfaces:
 java.io.Closeable,java.lang.AutoCloseable
- Direct Known Subclasses:
 Lucene40PostingsReader,Lucene41PostingsReader
public abstract class PostingsReaderBase extends java.lang.Object implements java.io.CloseableThe core terms dictionaries (BlockTermsReader, BlockTreeTermsReader) interact with a single instance of this class to manage creation ofDocsEnumandDocsAndPositionsEnuminstances. It provides an IndexInput (termsIn) where this class may read any previously stored data that it had written in its correspondingPostingsWriterBaseat indexing time. 
- 
- 
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract voidclose()abstract voiddecodeTerm(long[] longs, DataInput in, FieldInfo fieldInfo, BlockTermState state, boolean absolute)Actually decode metadata for next termabstract DocsEnumdocs(FieldInfo fieldInfo, BlockTermState state, Bits skipDocs, DocsEnum reuse, int flags)Must fully consume state, since after this call that TermState may be reused.abstract DocsAndPositionsEnumdocsAndPositions(FieldInfo fieldInfo, BlockTermState state, Bits skipDocs, DocsAndPositionsEnum reuse, int flags)Must fully consume state, since after this call that TermState may be reused.abstract voidinit(IndexInput termsIn)Performs any initialization, such as reading and verifying the header from the provided terms dictionaryIndexInput.abstract BlockTermStatenewTermState()Return a newly created empty TermStateabstract longramBytesUsed()Returns approximate RAM bytes used 
 - 
 
- 
- 
Method Detail
- 
init
public abstract void init(IndexInput termsIn) 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(long[] longs, DataInput in, FieldInfo fieldInfo, BlockTermState state, boolean absolute) throws java.io.IOExceptionActually decode metadata for next term 
- 
docs
public abstract DocsEnum docs(FieldInfo fieldInfo, BlockTermState state, Bits skipDocs, DocsEnum reuse, int flags) throws java.io.IOException
Must fully consume state, since after this call that TermState may be reused.- Throws:
 java.io.IOException
 
- 
docsAndPositions
public abstract DocsAndPositionsEnum docsAndPositions(FieldInfo fieldInfo, BlockTermState state, Bits skipDocs, DocsAndPositionsEnum reuse, int flags) throws java.io.IOException
Must fully consume state, since after this call that TermState may be reused.- Throws:
 java.io.IOException
 
- 
ramBytesUsed
public abstract long ramBytesUsed()
Returns approximate RAM bytes used 
- 
close
public abstract void close() throws java.io.IOException- Specified by:
 closein interfacejava.lang.AutoCloseable- Specified by:
 closein interfacejava.io.Closeable- Throws:
 java.io.IOException
 
 - 
 
 -