Class BlockAwareSegmentInputStream

java.lang.Object
java.io.InputStream
org.apache.bookkeeper.mledger.offload.jcloud.BlockAwareSegmentInputStream
All Implemented Interfaces:
Closeable, AutoCloseable
Direct Known Subclasses:
BlockAwareSegmentInputStreamImpl

public abstract class BlockAwareSegmentInputStream extends InputStream
The BlockAwareSegmentInputStream for each cold storage data block. This interface should be implemented while extends InputStream. It gets data from ledger, and will be read out the content for a data block. DataBlockHeader + entries(each with format[[entry_size -- int][entry_id -- long][entry_data]]) + padding
  • Constructor Details

    • BlockAwareSegmentInputStream

      public BlockAwareSegmentInputStream()
  • Method Details

    • getLedger

      public abstract org.apache.bookkeeper.client.api.ReadHandle getLedger()
      Get the ledger, from which this InputStream read data.
    • getStartEntryId

      public abstract long getStartEntryId()
      Get start entry id contained in this InputStream.
      Returns:
      the start entry id
    • getBlockSize

      public abstract int getBlockSize()
      Get block size that could read out from this InputStream.
      Returns:
      the block size
    • getBlockEntryCount

      public abstract int getBlockEntryCount()
      Get entry count that read out from this InputStream.
      Returns:
      the block entry count
    • getEndEntryId

      public abstract long getEndEntryId()
      Get end entry id contained in this InputStream.
      Returns:
      the end entry id
    • getBlockEntryBytesCount

      public abstract int getBlockEntryBytesCount()
      Get sum of entries data size read from the this InputStream.
      Returns:
      the block entry bytes count