Class Lucene90BlockTreeTermsWriter.TermsWriter
- java.lang.Object
-
- org.apache.lucene.codecs.lucene90.blocktree.Lucene90BlockTreeTermsWriter.TermsWriter
-
- Enclosing class:
- Lucene90BlockTreeTermsWriter
class Lucene90BlockTreeTermsWriter.TermsWriter extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private LZ4.HighCompressionHashTable
compressionHashTable
(package private) FixedBitSet
docsSeen
private FieldInfo
fieldInfo
private Lucene90BlockTreeTermsWriter.PendingTerm
firstPendingTerm
private Lucene90BlockTreeTermsWriter.PendingTerm
lastPendingTerm
private BytesRefBuilder
lastTerm
private ByteBuffersDataOutput
metaWriter
private java.util.List<Lucene90BlockTreeTermsWriter.PendingBlock>
newBlocks
private long
numTerms
private java.util.List<Lucene90BlockTreeTermsWriter.PendingEntry>
pending
private int[]
prefixStarts
private byte[]
spareBytes
private ByteBuffersDataOutput
spareWriter
private ByteBuffersDataOutput
statsWriter
private ByteBuffersDataOutput
suffixLengthsWriter
private BytesRefBuilder
suffixWriter
(package private) long
sumDocFreq
(package private) long
sumTotalTermFreq
-
Constructor Summary
Constructors Constructor Description TermsWriter(FieldInfo fieldInfo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean
allEqual(byte[] b, int startOffset, int endOffset, byte value)
void
finish()
private void
pushTerm(BytesRef text)
Pushes the new term to the top of the stack, and writes new blocks.void
write(BytesRef text, TermsEnum termsEnum, NormsProducer norms)
Writes one term's worth of postings.private Lucene90BlockTreeTermsWriter.PendingBlock
writeBlock(int prefixLength, boolean isFloor, int floorLeadLabel, int start, int end, boolean hasTerms, boolean hasSubBlocks)
Writes the specified slice (start is inclusive, end is exclusive) from pending stack as a new block.(package private) void
writeBlocks(int prefixLength, int count)
Writes the top count entries in pending, using prevTerm to compute the prefix.
-
-
-
Field Detail
-
fieldInfo
private final FieldInfo fieldInfo
-
numTerms
private long numTerms
-
docsSeen
final FixedBitSet docsSeen
-
sumTotalTermFreq
long sumTotalTermFreq
-
sumDocFreq
long sumDocFreq
-
lastTerm
private final BytesRefBuilder lastTerm
-
prefixStarts
private int[] prefixStarts
-
pending
private final java.util.List<Lucene90BlockTreeTermsWriter.PendingEntry> pending
-
newBlocks
private final java.util.List<Lucene90BlockTreeTermsWriter.PendingBlock> newBlocks
-
firstPendingTerm
private Lucene90BlockTreeTermsWriter.PendingTerm firstPendingTerm
-
lastPendingTerm
private Lucene90BlockTreeTermsWriter.PendingTerm lastPendingTerm
-
suffixLengthsWriter
private final ByteBuffersDataOutput suffixLengthsWriter
-
suffixWriter
private final BytesRefBuilder suffixWriter
-
statsWriter
private final ByteBuffersDataOutput statsWriter
-
metaWriter
private final ByteBuffersDataOutput metaWriter
-
spareWriter
private final ByteBuffersDataOutput spareWriter
-
spareBytes
private byte[] spareBytes
-
compressionHashTable
private LZ4.HighCompressionHashTable compressionHashTable
-
-
Constructor Detail
-
TermsWriter
TermsWriter(FieldInfo fieldInfo)
-
-
Method Detail
-
writeBlocks
void writeBlocks(int prefixLength, int count) throws java.io.IOException
Writes the top count entries in pending, using prevTerm to compute the prefix.- Throws:
java.io.IOException
-
allEqual
private boolean allEqual(byte[] b, int startOffset, int endOffset, byte value)
-
writeBlock
private Lucene90BlockTreeTermsWriter.PendingBlock writeBlock(int prefixLength, boolean isFloor, int floorLeadLabel, int start, int end, boolean hasTerms, boolean hasSubBlocks) throws java.io.IOException
Writes the specified slice (start is inclusive, end is exclusive) from pending stack as a new block. If isFloor is true, there were too many (more than maxItemsInBlock) entries sharing the same prefix, and so we broke it into multiple floor blocks where we record the starting label of the suffix of each floor block.- Throws:
java.io.IOException
-
write
public void write(BytesRef text, TermsEnum termsEnum, NormsProducer norms) throws java.io.IOException
Writes one term's worth of postings.- Throws:
java.io.IOException
-
pushTerm
private void pushTerm(BytesRef text) throws java.io.IOException
Pushes the new term to the top of the stack, and writes new blocks.- Throws:
java.io.IOException
-
finish
public void finish() throws java.io.IOException
- Throws:
java.io.IOException
-
-