Class OffloadIndexBlockImpl
java.lang.Object
org.apache.bookkeeper.mledger.offload.jcloud.impl.OffloadIndexBlockImpl
- All Implemented Interfaces:
Closeable,AutoCloseable,OffloadIndexBlock,OffloadIndexBlockV2
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.bookkeeper.mledger.offload.jcloud.OffloadIndexBlock
OffloadIndexBlock.IndexInputStream -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()static OffloadIndexBlockImplget(int magic, DataInputStream stream) static OffloadIndexBlockImplget(org.apache.bookkeeper.client.api.LedgerMetadata metadata, long dataObjectLength, long dataHeaderLength, 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 messageEntryId) Get the related OffloadIndexEntry that contains the given messageEntryId.static intorg.apache.bookkeeper.client.api.LedgerMetadataGet LedgerMetadata.voidrecycle()toStream()Get the content of the index block as InputStream.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.bookkeeper.mledger.offload.jcloud.OffloadIndexBlock
getIndexEntryForEntry, getLedgerMetadata, getStartEntryId
-
Method Details
-
get
public static OffloadIndexBlockImpl get(org.apache.bookkeeper.client.api.LedgerMetadata metadata, long dataObjectLength, long dataHeaderLength, List<OffloadIndexEntryImpl> entries) -
get
- Throws:
IOException
-
recycle
public void recycle() -
getIndexEntryForEntry
Description copied from interface:OffloadIndexBlockGet the related OffloadIndexEntry that contains the given messageEntryId.- Specified by:
getIndexEntryForEntryin interfaceOffloadIndexBlock- Parameters:
messageEntryId- the entry id of message- Returns:
- the offload index entry
- Throws:
IOException
-
getEntryCount
public int getEntryCount()Description copied from interface:OffloadIndexBlockGet the entry count that contained in this index Block.- Specified by:
getEntryCountin interfaceOffloadIndexBlock- Specified by:
getEntryCountin interfaceOffloadIndexBlockV2
-
getLedgerMetadata
public org.apache.bookkeeper.client.api.LedgerMetadata getLedgerMetadata()Description copied from interface:OffloadIndexBlockGet LedgerMetadata.- Specified by:
getLedgerMetadatain interfaceOffloadIndexBlock
-
getDataObjectLength
public long getDataObjectLength()Description copied from interface:OffloadIndexBlockGet the total size of the data object.- Specified by:
getDataObjectLengthin interfaceOffloadIndexBlock- Specified by:
getDataObjectLengthin interfaceOffloadIndexBlockV2
-
getDataBlockHeaderLength
public long getDataBlockHeaderLength()Description copied from interface:OffloadIndexBlockGet the length of the header in the blocks in the data object.- Specified by:
getDataBlockHeaderLengthin interfaceOffloadIndexBlock- 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 interfaceOffloadIndexBlock- Specified by:
toStreamin interfaceOffloadIndexBlockV2- Throws:
IOException
-
getIndexMagicWord
public static int getIndexMagicWord() -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-