Interface OffloadIndexBlockBuilder
- All Known Implementing Classes:
OffloadIndexBlockV2BuilderImpl
@Unstable
@LimitedPrivate
public interface OffloadIndexBlockBuilder
Interface for builder of index block used for offload a ledger to long term storage.
-
Method Summary
Modifier and TypeMethodDescriptionaddBlock(long firstEntryId, int partId, int blockSize) Add one payload block related information into index block.build()Finalize the immutable OffloadIndexBlock.static OffloadIndexBlockBuildercreate()create an OffloadIndexBlockBuilder.Construct OffloadIndex from an InputStream.withDataBlockHeaderLength(long dataHeaderLength) Specify the length of the block headers in the data object.withDataObjectLength(long dataObjectLength) Specify the length of data object this index is associated with.withLedgerMetadata(org.apache.bookkeeper.client.api.LedgerMetadata metadata) Build index block with the passed in ledger metadata.
-
Method Details
-
withLedgerMetadata
OffloadIndexBlockBuilder withLedgerMetadata(org.apache.bookkeeper.client.api.LedgerMetadata metadata) Build index block with the passed in ledger metadata.- Parameters:
metadata- the ledger metadata
-
addBlock
Add one payload block related information into index block. It contains the first entryId in payload block, the payload block Id, and payload block size. This information will be used to consist one index entry in OffloadIndexBlock.- Parameters:
firstEntryId- the first entryId in payload blockpartId- the payload block IdblockSize- the payload block size
-
withDataObjectLength
Specify the length of data object this index is associated with.- Parameters:
dataObjectLength- the length of the data object
-
withDataBlockHeaderLength
Specify the length of the block headers in the data object.- Parameters:
dataHeaderLength- the length of the headers
-
build
OffloadIndexBlock build()Finalize the immutable OffloadIndexBlock. -
fromStream
Construct OffloadIndex from an InputStream.- Throws:
IOException
-
create
create an OffloadIndexBlockBuilder.
-