Class BlockHeader
- java.lang.Object
-
- org.apache.lucene.codecs.uniformsplit.BlockHeader
-
- All Implemented Interfaces:
Accountable
public class BlockHeader extends java.lang.Object implements Accountable
Block header containing block metadata.Holds the number of lines in the block.
Holds the base file pointers to apply delta base encoding to all the file pointers in the block with
DeltaBaseTermStateSerializer
.Holds the offset to the details region of the block (the term states).
Holds the offset to the middle term of the block to divide the number of terms to scan by 2.
-
-
Field Summary
Fields Modifier and Type Field Description protected long
baseDocsFP
protected long
basePayloadsFP
protected long
basePositionsFP
protected int
linesCount
protected int
middleLineIndex
protected int
middleLineOffset
private static long
RAM_USAGE
protected int
termStatesBaseOffset
-
Constructor Summary
Constructors Modifier Constructor Description protected
BlockHeader()
Empty constructor.protected
BlockHeader(int linesCount, long baseDocsFP, long basePositionsFP, long basePayloadsFP, int termStatesBaseOffset, int middleLineOffset)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getBaseDocsFP()
long
getBasePayloadsFP()
long
getBasePositionsFP()
int
getLinesCount()
int
getMiddleLineIndex()
int
getMiddleLineOffset()
int
getTermStatesBaseOffset()
long
ramBytesUsed()
Return the memory usage of this object in bytes.static BlockHeader
read(DataInput input, BlockHeader reuse)
protected BlockHeader
reset(int linesCount, long baseDocsFP, long basePositionsFP, long basePayloadsFP, int termStatesBaseOffset, int middleTermOffset)
void
write(DataOutput output)
-
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
-
RAM_USAGE
private static final long RAM_USAGE
-
linesCount
protected int linesCount
-
baseDocsFP
protected long baseDocsFP
-
basePositionsFP
protected long basePositionsFP
-
basePayloadsFP
protected long basePayloadsFP
-
termStatesBaseOffset
protected int termStatesBaseOffset
-
middleLineIndex
protected int middleLineIndex
-
middleLineOffset
protected int middleLineOffset
-
-
Constructor Detail
-
BlockHeader
protected BlockHeader(int linesCount, long baseDocsFP, long basePositionsFP, long basePayloadsFP, int termStatesBaseOffset, int middleLineOffset)
- Parameters:
linesCount
- Number of lines in the block.baseDocsFP
- File pointer to the docs of the first term with docs in the block.basePositionsFP
- File pointer to the positions of the first term with positions in the block.basePayloadsFP
- File pointer to the payloads of the first term with payloads in the block.termStatesBaseOffset
- Offset to the details region of the block (the term states), relative to the block start.middleLineOffset
- Offset to the middle term of the block, relative to the block start.
-
BlockHeader
protected BlockHeader()
Empty constructor.reset(int, long, long, long, int, int)
must be called before writing.
-
-
Method Detail
-
reset
protected BlockHeader reset(int linesCount, long baseDocsFP, long basePositionsFP, long basePayloadsFP, int termStatesBaseOffset, int middleTermOffset)
-
getLinesCount
public int getLinesCount()
- Returns:
- The number of lines in the block.
-
getMiddleLineIndex
public int getMiddleLineIndex()
- Returns:
- The index of the middle line of the block.
-
getMiddleLineOffset
public int getMiddleLineOffset()
- Returns:
- The offset to the middle line of the block, relative to the block start.
-
getTermStatesBaseOffset
public int getTermStatesBaseOffset()
- Returns:
- The offset to the details region of the block (the term states), relative to the block start.
-
getBaseDocsFP
public long getBaseDocsFP()
- Returns:
- The file pointer to the docs of the first term with docs in the block.
-
getBasePositionsFP
public long getBasePositionsFP()
- Returns:
- The file pointer to the positions of the first term with positions in the block.
-
getBasePayloadsFP
public long getBasePayloadsFP()
- Returns:
- The file pointer to the payloads of the first term with payloads in the block.
-
write
public void write(DataOutput output) throws java.io.IOException
- Throws:
java.io.IOException
-
read
public static BlockHeader read(DataInput input, BlockHeader reuse) throws java.io.IOException
- Throws:
java.io.IOException
-
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
-
-