Class OffloadIndexBlockV2Impl

    • Method Detail

      • get

        public static OffloadIndexBlockV2Impl get​(java.util.Map<java.lang.Long,​org.apache.bookkeeper.mledger.proto.MLDataFormats.ManagedLedgerInfo.LedgerInfo> metadata,
                                                  long dataObjectLength,
                                                  long dataHeaderLength,
                                                  java.util.Map<java.lang.Long,​java.util.List<OffloadIndexEntryImpl>> entries)
      • get

        public static OffloadIndexBlockV2Impl get​(int magic,
                                                  java.io.DataInputStream stream)
                                           throws java.io.IOException
        Throws:
        java.io.IOException
      • recycle

        public void recycle()
      • getIndexEntryForEntry

        public OffloadIndexEntry getIndexEntryForEntry​(long ledgerId,
                                                       long messageEntryId)
                                                throws java.io.IOException
        Description copied from interface: OffloadIndexBlockV2
        Get the related OffloadIndexEntry that contains the given messageEntryId.
        Specified by:
        getIndexEntryForEntry in interface OffloadIndexBlockV2
        messageEntryId - the entry id of message
        Returns:
        the offload index entry
        Throws:
        java.io.IOException
      • toStream

        public 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 | data_object_len | data_header_len | | index_entry_count | segment_metadata_len | segment metadata | index entries... |
        Specified by:
        toStream in interface OffloadIndexBlockV2
        Throws:
        java.io.IOException
      • getIndexMagicWord

        public static int getIndexMagicWord()
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable