public class STBlockWriter extends BlockWriter
As defined in STUniformSplitTermsWriter, all the fields terms are
shared in the same dictionary. Each block line contains a term and all the
fields org.apache.lucene.index.TermStates for this term.
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Set<FieldMetadata> |
fieldsInBlock |
blockEncoder, blockLines, blockLinesWriteBuffer, blockOutput, blockWriteBuffer, deltaNumLines, fieldMetadata, lastTerm, reusableBlockHeader, scratchBytesRef, targetNumBlockLines, termStateSerializer, termStatesWriteBuffer| Constructor and Description |
|---|
STBlockWriter(IndexOutput blockOutput,
int targetNumBlockLines,
int deltaNumLines,
BlockEncoder blockEncoder) |
| Modifier and Type | Method and Description |
|---|---|
void |
addLine(BytesRef term,
java.util.List<FieldMetadataTermState> termStates,
IndexDictionary.Builder dictionaryBuilder)
Adds a new
BlockLine term for the current field. |
protected void |
finishLastBlock(IndexDictionary.Builder dictionaryBuilder)
This method is called when there is no more term for the field.
|
protected void |
updateFieldMetadata(long blockStartFP)
updates the field metadata after all lines were written for the block.
|
protected void |
writeBlockLine(boolean isIncrementalEncodingSeed,
BlockLine line,
BlockLine previousLine) |
addBlockKey, splitAndWriteBlock, writeBlockprotected final java.util.Set<FieldMetadata> fieldsInBlock
public STBlockWriter(IndexOutput blockOutput,
int targetNumBlockLines,
int deltaNumLines,
BlockEncoder blockEncoder)
public void addLine(BytesRef term,
java.util.List<FieldMetadataTermState> termStates,
IndexDictionary.Builder dictionaryBuilder)
throws java.io.IOException
BlockLine term for the current field.
This method determines whether the new term is part of the current block,
or if it is part of the next block. In the latter case, a new block is started
(including one or more of the lastly added lines), the current block is
written to the block file, and the current block key is added to the
IndexDictionary.Builder.
addLine in class BlockWriterterm - The block line term. The BytesRef instance is used directly,
the caller is responsible to make a deep copy if needed. This is required
because we keep a list of block lines until we decide to write the
current block, and each line must have a different term instance.termStates - Block line details for all fields in the line.dictionaryBuilder - to which the block keys are added.java.io.IOExceptionprotected void finishLastBlock(IndexDictionary.Builder dictionaryBuilder) throws java.io.IOException
BlockWriterBlockWriter.addLine(BytesRef, BlockTermState, org.apache.lucene.codecs.uniformsplit.IndexDictionary.Builder) as the last block of the
field and resets this BlockWriter state. Then this BlockWriter
can be used for another field.finishLastBlock in class BlockWriterjava.io.IOExceptionprotected void writeBlockLine(boolean isIncrementalEncodingSeed,
BlockLine line,
BlockLine previousLine)
throws java.io.IOException
writeBlockLine in class BlockWriterjava.io.IOExceptionprotected void updateFieldMetadata(long blockStartFP)
BlockWriterupdateFieldMetadata in class BlockWriterData In Motion GmbH all rights reserved