Interface OffloadIndexBlockV2Builder
- All Known Implementing Classes:
OffloadIndexBlockV2BuilderImpl
@Unstable
@LimitedPrivate
public interface OffloadIndexBlockV2Builder
Interface for builder of index block used for offload a ledger to long term storage.
-
Method Summary
Modifier and TypeMethodDescriptionaddBlock(long ledgerId, long firstEntryId, int partId, int blockSize) Add one payload block related information into index block.addLedgerMeta(Long ledgerId, MLDataFormats.ManagedLedgerInfo.LedgerInfo metadata) Build index block with the passed in ledger metadata.buildV2()Finalize the immutable OffloadIndexBlock.static OffloadIndexBlockV2Buildercreate()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.
-
Method Details
-
addLedgerMeta
OffloadIndexBlockV2Builder addLedgerMeta(Long ledgerId, MLDataFormats.ManagedLedgerInfo.LedgerInfo metadata) Build index block with the passed in ledger metadata.- Parameters:
ledgerId-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
-
buildV2
OffloadIndexBlockV2 buildV2()Finalize the immutable OffloadIndexBlock. -
fromStream
Construct OffloadIndex from an InputStream.- Throws:
IOException
-
create
create an OffloadIndexBlockBuilder.
-