Class Lucene84PostingsReader
- java.lang.Object
-
- org.apache.lucene.codecs.PostingsReaderBase
-
- org.apache.lucene.codecs.lucene84.Lucene84PostingsReader
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,Accountable
public final class Lucene84PostingsReader extends PostingsReaderBase
Concrete class that reads docId(maybe frq,pos,offset,payloads) list with postings format.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classLucene84PostingsReader.BlockDocsEnum(package private) classLucene84PostingsReader.BlockImpactsDocsEnum(package private) classLucene84PostingsReader.BlockImpactsEverythingEnum(package private) classLucene84PostingsReader.BlockImpactsPostingsEnum(package private) classLucene84PostingsReader.EverythingEnum
-
Field Summary
Fields Modifier and Type Field Description private static longBASE_RAM_BYTES_USEDprivate IndexInputdocInprivate IndexInputpayInprivate IndexInputposInprivate intversion-
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE
-
-
Constructor Summary
Constructors Constructor Description Lucene84PostingsReader(SegmentReadState state)Sole constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckIntegrity()Checks consistency of this reader.voidclose()voiddecodeTerm(DataInput in, FieldInfo fieldInfo, BlockTermState _termState, boolean absolute)Actually decode metadata for next term(package private) static intfindFirstGreater(long[] buffer, int target, int from)ImpactsEnumimpacts(FieldInfo fieldInfo, BlockTermState state, int flags)Return aImpactsEnumthat computes impacts withscorer.voidinit(IndexInput termsIn, SegmentReadState state)Performs any initialization, such as reading and verifying the header from the provided terms dictionaryIndexInput.BlockTermStatenewTermState()Return a newly created empty TermStatePostingsEnumpostings(FieldInfo fieldInfo, BlockTermState termState, PostingsEnum reuse, int flags)Must fully consume state, since after this call that TermState may be reused.(package private) static voidprefixSum(long[] buffer, int count, long base)longramBytesUsed()Return the memory usage of this object in bytes.(package private) static voidreadVIntBlock(IndexInput docIn, long[] docBuffer, long[] freqBuffer, int num, boolean indexHasFreq)Read values that have been written using variable-length encoding instead of bit-packing.java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.lucene.util.Accountable
getChildResources
-
-
-
-
Field Detail
-
BASE_RAM_BYTES_USED
private static final long BASE_RAM_BYTES_USED
-
docIn
private final IndexInput docIn
-
posIn
private final IndexInput posIn
-
payIn
private final IndexInput payIn
-
version
private final int version
-
-
Constructor Detail
-
Lucene84PostingsReader
public Lucene84PostingsReader(SegmentReadState state) throws java.io.IOException
Sole constructor.- Throws:
java.io.IOException
-
-
Method Detail
-
init
public void init(IndexInput termsIn, SegmentReadState state) throws java.io.IOException
Description copied from class:PostingsReaderBasePerforms any initialization, such as reading and verifying the header from the provided terms dictionaryIndexInput.- Specified by:
initin classPostingsReaderBase- Throws:
java.io.IOException
-
readVIntBlock
static void readVIntBlock(IndexInput docIn, long[] docBuffer, long[] freqBuffer, int num, boolean indexHasFreq) throws java.io.IOException
Read values that have been written using variable-length encoding instead of bit-packing.- Throws:
java.io.IOException
-
prefixSum
static void prefixSum(long[] buffer, int count, long base)
-
findFirstGreater
static int findFirstGreater(long[] buffer, int target, int from)
-
newTermState
public BlockTermState newTermState()
Description copied from class:PostingsReaderBaseReturn a newly created empty TermState- Specified by:
newTermStatein classPostingsReaderBase
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein classPostingsReaderBase- Throws:
java.io.IOException
-
decodeTerm
public void decodeTerm(DataInput in, FieldInfo fieldInfo, BlockTermState _termState, boolean absolute) throws java.io.IOException
Description copied from class:PostingsReaderBaseActually decode metadata for next term- Specified by:
decodeTermin classPostingsReaderBase- 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 PostingsEnum postings(FieldInfo fieldInfo, BlockTermState termState, PostingsEnum reuse, int flags) throws java.io.IOException
Description copied from class:PostingsReaderBaseMust fully consume state, since after this call that TermState may be reused.- Specified by:
postingsin classPostingsReaderBase- Throws:
java.io.IOException
-
impacts
public ImpactsEnum impacts(FieldInfo fieldInfo, BlockTermState state, int flags) throws java.io.IOException
Description copied from class:PostingsReaderBaseReturn aImpactsEnumthat computes impacts withscorer.- Specified by:
impactsin classPostingsReaderBase- Throws:
java.io.IOException- See Also:
PostingsReaderBase.postings(FieldInfo, BlockTermState, PostingsEnum, int)
-
ramBytesUsed
public long ramBytesUsed()
Description copied from interface:AccountableReturn the memory usage of this object in bytes. Negative values are illegal.
-
checkIntegrity
public void checkIntegrity() throws java.io.IOExceptionDescription copied from class:PostingsReaderBaseChecks 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:
checkIntegrityin classPostingsReaderBase- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-