Class BlockHeader

java.lang.Object
org.apache.lucene.codecs.uniformsplit.BlockHeader
All Implemented Interfaces:
Accountable

public class BlockHeader extends 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.

WARNING: This API is experimental and might change in incompatible ways in the next release.
  • Field Details

    • 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 Details

    • 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 Details

    • 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.
    • ramBytesUsed

      public long ramBytesUsed()
      Specified by:
      ramBytesUsed in interface Accountable