Interface OffloadIndexBlockV2

  • All Superinterfaces:
    java.lang.AutoCloseable, java.io.Closeable
    All Known Subinterfaces:
    OffloadIndexBlock
    All Known Implementing Classes:
    OffloadIndexBlockImpl, OffloadIndexBlockV2Impl

    @Unstable
    public interface OffloadIndexBlockV2
    extends java.io.Closeable
    The Index block abstraction used for offload a ledger to long term storage.
    • Method Detail

      • toStream

        OffloadIndexBlock.IndexInputStream toStream()
                                             throws java.io.IOException
        Get the content of the index block as InputStream. Read out in format: | index_magic_header | index_block_len | index_entry_count | | data_object_size | segment_metadata_length | segment metadata | index entries ... |
        Throws:
        java.io.IOException
      • getIndexEntryForEntry

        OffloadIndexEntry getIndexEntryForEntry​(long ledgerId,
                                                long messageEntryId)
                                         throws java.io.IOException
        Get the related OffloadIndexEntry that contains the given messageEntryId.
        Parameters:
        messageEntryId - the entry id of message
        Returns:
        the offload index entry
        Throws:
        java.io.IOException
      • getStartEntryId

        long getStartEntryId​(long ledgerId)
      • getEntryCount

        int getEntryCount()
        Get the entry count that contained in this index Block.
      • getLedgerMetadata

        org.apache.bookkeeper.client.api.LedgerMetadata getLedgerMetadata​(long ledgerId)
        Get LedgerMetadata.
        Returns:
      • getDataObjectLength

        long getDataObjectLength()
        Get the total size of the data object.
      • getDataBlockHeaderLength

        long getDataBlockHeaderLength()
        Get the length of the header in the blocks in the data object.