Class OffloadIndexBlockV2Impl
java.lang.Object
org.apache.bookkeeper.mledger.offload.jcloud.impl.OffloadIndexBlockV2Impl
- All Implemented Interfaces:
Closeable,AutoCloseable,OffloadIndexBlockV2
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()static OffloadIndexBlockV2Implget(int magic, DataInputStream stream) static OffloadIndexBlockV2Implget(Map<Long, MLDataFormats.ManagedLedgerInfo.LedgerInfo> metadata, long dataObjectLength, long dataHeaderLength, Map<Long, List<OffloadIndexEntryImpl>> entries) longGet the length of the header in the blocks in the data object.longGet the total size of the data object.intGet the entry count that contained in this index Block.getIndexEntryForEntry(long ledgerId, long messageEntryId) Get the related OffloadIndexEntry that contains the given messageEntryId.static intorg.apache.bookkeeper.client.api.LedgerMetadatagetLedgerMetadata(long ledgerId) Get LedgerMetadata.longgetStartEntryId(long ledgerId) voidrecycle()toStream()Get the content of the index block as InputStream.
-
Method Details
-
get
public static OffloadIndexBlockV2Impl get(Map<Long, MLDataFormats.ManagedLedgerInfo.LedgerInfo> metadata, long dataObjectLength, long dataHeaderLength, Map<Long, List<OffloadIndexEntryImpl>> entries) -
get
- Throws:
IOException
-
recycle
public void recycle() -
getIndexEntryForEntry
public OffloadIndexEntry getIndexEntryForEntry(long ledgerId, long messageEntryId) throws IOException Description copied from interface:OffloadIndexBlockV2Get the related OffloadIndexEntry that contains the given messageEntryId.- Specified by:
getIndexEntryForEntryin interfaceOffloadIndexBlockV2messageEntryId- the entry id of message- Returns:
- the offload index entry
- Throws:
IOException
-
getStartEntryId
public long getStartEntryId(long ledgerId) - Specified by:
getStartEntryIdin interfaceOffloadIndexBlockV2
-
getEntryCount
public int getEntryCount()Description copied from interface:OffloadIndexBlockV2Get the entry count that contained in this index Block.- Specified by:
getEntryCountin interfaceOffloadIndexBlockV2
-
getLedgerMetadata
public org.apache.bookkeeper.client.api.LedgerMetadata getLedgerMetadata(long ledgerId) Description copied from interface:OffloadIndexBlockV2Get LedgerMetadata.- Specified by:
getLedgerMetadatain interfaceOffloadIndexBlockV2- Returns:
-
getDataObjectLength
public long getDataObjectLength()Description copied from interface:OffloadIndexBlockV2Get the total size of the data object.- Specified by:
getDataObjectLengthin interfaceOffloadIndexBlockV2
-
getDataBlockHeaderLength
public long getDataBlockHeaderLength()Description copied from interface:OffloadIndexBlockV2Get the length of the header in the blocks in the data object.- Specified by:
getDataBlockHeaderLengthin interfaceOffloadIndexBlockV2
-
toStream
Get the content of the index block as InputStream. Read out in format: | index_magic_header | index_block_len | data_object_len | data_header_len | | index_entry_count | segment_metadata_len | segment metadata | index entries... |- Specified by:
toStreamin interfaceOffloadIndexBlockV2- Throws:
IOException
-
getIndexMagicWord
public static int getIndexMagicWord() -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-