Class StreamingDataBlockHeaderImpl
- java.lang.Object
-
- org.apache.bookkeeper.mledger.offload.jcloud.impl.StreamingDataBlockHeaderImpl
-
- All Implemented Interfaces:
DataBlockHeader
public class StreamingDataBlockHeaderImpl extends java.lang.Object implements DataBlockHeader
The data block header in tiered storage for each data block.
-
-
Field Summary
Fields Modifier and Type Field Description static intHEADER_MAX_SIZE
-
Constructor Summary
Constructors Constructor Description StreamingDataBlockHeaderImpl(long headerLength, long blockLength, long ledgerId, long firstEntryId)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StreamingDataBlockHeaderImplfromStream(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.longgetLedgerId()static StreamingDataBlockHeaderImplof(int blockLength, long ledgerId, long firstEntryId)java.io.InputStreamtoStream()Get the content of the data block header as InputStream.java.lang.StringtoString()
-
-
-
Field Detail
-
HEADER_MAX_SIZE
public static final int HEADER_MAX_SIZE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getLedgerId
public long getLedgerId()
-
of
public static StreamingDataBlockHeaderImpl of(int blockLength, long ledgerId, long firstEntryId)
-
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
-
fromStream
public static StreamingDataBlockHeaderImpl fromStream(java.io.InputStream stream) throws java.io.IOException
- Throws:
java.io.IOException
-
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
-
-