Class DataBlockHeaderImpl
- java.lang.Object
-
- org.apache.bookkeeper.mledger.offload.jcloud.impl.DataBlockHeaderImpl
-
- All Implemented Interfaces:
DataBlockHeader
public class DataBlockHeaderImpl extends java.lang.Object implements DataBlockHeader
The data block header in tiered storage for each data block.
-
-
Constructor Summary
Constructors Constructor Description DataBlockHeaderImpl(long headerLength, long blockLength, long firstEntryId)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DataBlockHeaderfromStream(java.io.InputStream stream)longgetBlockLength()Get the length of the block in bytes, including the header.static intgetBlockMagicWord()static intgetDataStartOffset()longgetFirstEntryId()Get the message entry Id for the first message that stored in this data block.longgetHeaderLength()Get the size of this DataBlockHeader.static DataBlockHeaderImplof(int blockLength, long firstEntryId)java.io.InputStreamtoStream()Get the content of the data block header as InputStream.java.lang.StringtoString()
-
-
-
Method Detail
-
of
public static DataBlockHeaderImpl of(int blockLength, long firstEntryId)
-
fromStream
public static DataBlockHeader fromStream(java.io.InputStream stream) throws java.io.IOException
- Throws:
java.io.IOException
-
getBlockMagicWord
public static int getBlockMagicWord()
-
getDataStartOffset
public static int getDataStartOffset()
-
getBlockLength
public long getBlockLength()
Description copied from interface:DataBlockHeaderGet the length of the block in bytes, including the header.- Specified by:
getBlockLengthin interfaceDataBlockHeader
-
getHeaderLength
public long getHeaderLength()
Description copied from interface:DataBlockHeaderGet the size of this DataBlockHeader.- Specified by:
getHeaderLengthin interfaceDataBlockHeader
-
getFirstEntryId
public long getFirstEntryId()
Description copied from interface:DataBlockHeaderGet the message entry Id for the first message that stored in this data block.- Specified by:
getFirstEntryIdin interfaceDataBlockHeader
-
toStream
public java.io.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:
toStreamin interfaceDataBlockHeader
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-