Class DataBlockHeaderImpl

java.lang.Object
org.apache.bookkeeper.mledger.offload.jcloud.impl.DataBlockHeaderImpl
All Implemented Interfaces:
DataBlockHeader

public class DataBlockHeaderImpl extends Object implements DataBlockHeader
The data block header in tiered storage for each data block.
  • Constructor Details

    • DataBlockHeaderImpl

      public DataBlockHeaderImpl(long headerLength, long blockLength, long firstEntryId)
  • Method Details

    • of

      public static DataBlockHeaderImpl of(int blockLength, long firstEntryId)
    • fromStream

      public static DataBlockHeader fromStream(InputStream stream) throws IOException
      Throws:
      IOException
    • getBlockMagicWord

      public static int getBlockMagicWord()
    • getDataStartOffset

      public static int getDataStartOffset()
    • getBlockLength

      public long getBlockLength()
      Description copied from interface: DataBlockHeader
      Get the length of the block in bytes, including the header.
      Specified by:
      getBlockLength in interface DataBlockHeader
    • getHeaderLength

      public long getHeaderLength()
      Description copied from interface: DataBlockHeader
      Get the size of this DataBlockHeader.
      Specified by:
      getHeaderLength in interface DataBlockHeader
    • getFirstEntryId

      public long getFirstEntryId()
      Description copied from interface: DataBlockHeader
      Get the message entry Id for the first message that stored in this data block.
      Specified by:
      getFirstEntryId in interface DataBlockHeader
    • toStream

      public InputStream toStream()
      Get the content of the data block header as InputStream. Read out in format: [ magic_word -- int ][ block_len -- int ][ first_entry_id -- long] [padding zeros]
      Specified by:
      toStream in interface DataBlockHeader
    • toString

      public String toString()
      Overrides:
      toString in class Object