Class BlockLine
- java.lang.Object
-
- org.apache.lucene.codecs.uniformsplit.BlockLine
-
- All Implemented Interfaces:
Accountable
- Direct Known Subclasses:
STBlockLine
public class BlockLine extends java.lang.Object implements Accountable
One term block line.Contains a term and its details as a
BlockTermState
.The line is written to the
block file
in two parts. The first part is the term followed by an offset to the details region. The second part is the termBlockTermState
, written in the details region, after all the terms of the block.The separate details region allows fast scan of the terms without having to decode the details for each term. At read time, the
BlockLine.Serializer.readLine(org.apache.lucene.store.DataInput, boolean, org.apache.lucene.codecs.uniformsplit.BlockLine)
only reads the term and its offset to the details. The correspondingBlockTermState
is decoded on demand in theBlockReader
(seeBlockReader.readTermStateIfNotRead()
).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BlockLine.Serializer
Reads/writes block lines with terms encoded incrementally inside a block.
-
Field Summary
Fields Modifier and Type Field Description private static long
BASE_RAM_USAGE
protected TermBytes
termBytes
protected BlockTermState
termState
Only used for writing.protected int
termStateRelativeOffset
-
Constructor Summary
Constructors Modifier Constructor Description protected
BlockLine(TermBytes termBytes, int termStateRelativeOffset)
Constructor used for reading aBlockLine
.private
BlockLine(TermBytes termBytes, int termStateRelativeOffset, BlockTermState termState)
protected
BlockLine(TermBytes termBytes, BlockTermState termState)
Constructor used for writing aBlockLine
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TermBytes
getTermBytes()
int
getTermStateRelativeOffset()
long
ramBytesUsed()
Return the memory usage of this object in bytes.protected BlockLine
reset(TermBytes termBytes, int termStateRelativeOffset)
Resets thisBlockLine
to reuse it when reading.-
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
-
-
-
-
Field Detail
-
BASE_RAM_USAGE
private static final long BASE_RAM_USAGE
-
termBytes
protected TermBytes termBytes
-
termStateRelativeOffset
protected int termStateRelativeOffset
-
termState
protected final BlockTermState termState
Only used for writing.
-
-
Constructor Detail
-
BlockLine
protected BlockLine(TermBytes termBytes, BlockTermState termState)
Constructor used for writing aBlockLine
.
-
BlockLine
protected BlockLine(TermBytes termBytes, int termStateRelativeOffset)
Constructor used for reading aBlockLine
.
-
BlockLine
private BlockLine(TermBytes termBytes, int termStateRelativeOffset, BlockTermState termState)
-
-
Method Detail
-
reset
protected BlockLine reset(TermBytes termBytes, int termStateRelativeOffset)
Resets thisBlockLine
to reuse it when reading.
-
getTermBytes
public TermBytes getTermBytes()
-
getTermStateRelativeOffset
public int getTermStateRelativeOffset()
- Returns:
- The offset of the
TermState
bytes in the block, relatively to the term states base offset.
-
ramBytesUsed
public long ramBytesUsed()
Description copied from interface:Accountable
Return the memory usage of this object in bytes. Negative values are illegal.- Specified by:
ramBytesUsed
in interfaceAccountable
-
-