java.lang.Object
io.datarouter.filesystem.snapshot.block.leaf.LeafBlockV1
All Implemented Interfaces:
Block, LeafBlock

public class LeafBlockV1
extends Object
implements LeafBlock
Sections: - num keys - key endings: relative to the start of the section - keys - value block ids - value block indexes
  • Field Details

  • Constructor Details

    • LeafBlockV1

      public LeafBlockV1​(byte[] bytes)
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • heapSize

      public int heapSize()
      Specified by:
      heapSize in interface Block
    • recordId

      public long recordId​(int index)
      Specified by:
      recordId in interface LeafBlock
    • numRecords

      public int numRecords()
      Specified by:
      numRecords in interface LeafBlock
      Returns:
      Number of keys in the block
    • blockKey

      public io.datarouter.bytes.Bytes blockKey​(int index)
      Specified by:
      blockKey in interface LeafBlock
      Returns:
      Nth key in the block
    • blockValue

      public io.datarouter.bytes.Bytes blockValue​(int index)
      Specified by:
      blockValue in interface LeafBlock
      Returns:
      Nth value in the block
    • firstValueBlockId

      public int firstValueBlockId​(int column)
      Specified by:
      firstValueBlockId in interface LeafBlock
      Returns:
      First ValueBlock known to this LeafBlock
    • numValueBlocks

      public int numValueBlocks​(int column)
      Specified by:
      numValueBlocks in interface LeafBlock
      Returns:
      Number of ValueBlocks referenced by this LeafBlock
    • valueBlockEnding

      public int valueBlockEnding​(int column, int valueBlockId)
      Specified by:
      valueBlockEnding in interface LeafBlock
    • valueBlockKey

      public BlockKey valueBlockKey​(SnapshotKey snapshotKey, int column, int valueBlockId)
      Specified by:
      valueBlockKey in interface LeafBlock
    • firstValueIndex

      public int firstValueIndex​(int column)
      Specified by:
      firstValueIndex in interface LeafBlock
      Returns:
      First index into first ValueBlock known to this LeafBlock
    • valueBlockOffset

      public int valueBlockOffset​(int column, int valueBlockOffsetIndex)
      Specified by:
      valueBlockOffset in interface LeafBlock
      valueBlockOffsetIndex - offset into the list of valueBlockOffsets. Passing 0 should always return 0.
      Returns:
      recordIndex at the requested offset
    • toDetailedString

      public String toDetailedString()