Class STBlockLine.Serializer
- java.lang.Object
-
- org.apache.lucene.codecs.uniformsplit.BlockLine.Serializer
-
- org.apache.lucene.codecs.uniformsplit.sharedterms.STBlockLine.Serializer
-
- All Implemented Interfaces:
Accountable
- Enclosing class:
- STBlockLine
public static class STBlockLine.Serializer extends BlockLine.Serializer
Reads block lines encoded incrementally, with all fields corresponding to the term of the line.This class extends
BlockLine.Serializer
, so it keeps a state of the previous term read to decode the next term.
-
-
Field Summary
-
Fields inherited from class org.apache.lucene.codecs.uniformsplit.BlockLine.Serializer
currentTerm
-
-
Constructor Summary
Constructors Constructor Description Serializer()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int[]
readFieldIds(DataInput termStatesInput, int numFields)
Reads all the field ids in the current block line of the provided input.static void
readFieldTermStatesMap(DataInput termStatesInput, DeltaBaseTermStateSerializer termStateSerializer, BlockHeader blockHeader, FieldInfos fieldInfos, java.util.Map<java.lang.String,BlockTermState> fieldTermStatesMap)
Reads all theBlockTermState
of all the field in the current block line of the provided input.static BlockTermState
readTermStateForField(int fieldId, DataInput termStatesInput, DeltaBaseTermStateSerializer termStateSerializer, BlockHeader blockHeader, FieldInfos fieldInfos, BlockTermState reuse)
Reads a singleBlockTermState
for the provided field in the current block line of the provided input.static void
writeLineTermStates(DataOutput termStatesOutput, STBlockLine line, DeltaBaseTermStateSerializer encoder)
Writes all theBlockTermState
of the providedSTBlockLine
to the given output.-
Methods inherited from class org.apache.lucene.codecs.uniformsplit.BlockLine.Serializer
numBitsToEncode, ramBytesUsed, readBytes, readIncrementallyEncodedTerm, readLine, writeIncrementallyEncodedTerm, writeLine, writeLineTermState
-
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
-
-
-
-
Method Detail
-
writeLineTermStates
public static void writeLineTermStates(DataOutput termStatesOutput, STBlockLine line, DeltaBaseTermStateSerializer encoder) throws java.io.IOException
Writes all theBlockTermState
of the providedSTBlockLine
to the given output.- Throws:
java.io.IOException
-
readTermStateForField
public static BlockTermState readTermStateForField(int fieldId, DataInput termStatesInput, DeltaBaseTermStateSerializer termStateSerializer, BlockHeader blockHeader, FieldInfos fieldInfos, BlockTermState reuse) throws java.io.IOException
Reads a singleBlockTermState
for the provided field in the current block line of the provided input.- Parameters:
termStatesInput
- Data input to read theBlockTermState
from.blockHeader
- Current block header.reuse
- A previousBlockTermState
to reuse; or null to create a new one.- Returns:
- The
BlockTermState
corresponding to the provided field id; or null if the field does not occur in the line. - Throws:
java.io.IOException
-
readFieldTermStatesMap
public static void readFieldTermStatesMap(DataInput termStatesInput, DeltaBaseTermStateSerializer termStateSerializer, BlockHeader blockHeader, FieldInfos fieldInfos, java.util.Map<java.lang.String,BlockTermState> fieldTermStatesMap) throws java.io.IOException
Reads all theBlockTermState
of all the field in the current block line of the provided input.- Parameters:
fieldTermStatesMap
- Map filled with the term states for each field. It is cleared first.- Throws:
java.io.IOException
- See Also:
readTermStateForField(int, org.apache.lucene.store.DataInput, org.apache.lucene.codecs.uniformsplit.DeltaBaseTermStateSerializer, org.apache.lucene.codecs.uniformsplit.BlockHeader, org.apache.lucene.index.FieldInfos, org.apache.lucene.codecs.BlockTermState)
-
readFieldIds
public static int[] readFieldIds(DataInput termStatesInput, int numFields) throws java.io.IOException
Reads all the field ids in the current block line of the provided input.- Throws:
java.io.IOException
-
-