Class BlockAwareSegmentInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable
    Direct Known Subclasses:
    BlockAwareSegmentInputStreamImpl

    public abstract class BlockAwareSegmentInputStream
    extends java.io.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
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      abstract int getBlockEntryBytesCount()
      Get sum of entries data size read from the this InputStream.
      abstract int getBlockEntryCount()
      Get entry count that read out from this InputStream.
      abstract int getBlockSize()
      Get block size that could read out from this InputStream.
      abstract long getEndEntryId()
      Get end entry id contained in this InputStream.
      abstract org.apache.bookkeeper.client.api.ReadHandle getLedger()
      Get the ledger, from which this InputStream read data.
      abstract long getStartEntryId()
      Get start entry id contained in this InputStream.
      • Methods inherited from class java.io.InputStream

        available, close, mark, markSupported, nullInputStream, read, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BlockAwareSegmentInputStream

        public BlockAwareSegmentInputStream()
    • Method Detail

      • 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