Class StreamingDataBlockHeaderImpl
java.lang.Object
org.apache.bookkeeper.mledger.offload.jcloud.impl.StreamingDataBlockHeaderImpl
- All Implemented Interfaces:
DataBlockHeader
The data block header in tiered storage for each data block.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionStreamingDataBlockHeaderImpl(long headerLength, long blockLength, long ledgerId, long firstEntryId) -
Method Summary
Modifier and TypeMethodDescriptionstatic StreamingDataBlockHeaderImplfromStream(InputStream stream) longGet the length of the block in bytes, including the header.static intstatic intlongGet the message entry Id for the first message that stored in this data block.longGet the size of this DataBlockHeader.longstatic StreamingDataBlockHeaderImplof(int blockLength, long ledgerId, long firstEntryId) toStream()Get the content of the data block header as InputStream.toString()
-
Field Details
-
HEADER_MAX_SIZE
public static final int HEADER_MAX_SIZE- See Also:
-
-
Constructor Details
-
StreamingDataBlockHeaderImpl
public StreamingDataBlockHeaderImpl(long headerLength, long blockLength, long ledgerId, long firstEntryId)
-
-
Method Details
-
getLedgerId
public long getLedgerId() -
of
-
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
- Throws:
IOException
-
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
-