Class BlockAwareSegmentInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.apache.bookkeeper.mledger.offload.jcloud.BlockAwareSegmentInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
- Direct Known Subclasses:
BlockAwareSegmentInputStreamImpl
public abstract class BlockAwareSegmentInputStream extends java.io.InputStreamThe 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 Summary
Constructors Constructor Description BlockAwareSegmentInputStream()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract intgetBlockEntryBytesCount()Get sum of entries data size read from the this InputStream.abstract intgetBlockEntryCount()Get entry count that read out from this InputStream.abstract intgetBlockSize()Get block size that could read out from this InputStream.abstract longgetEndEntryId()Get end entry id contained in this InputStream.abstract org.apache.bookkeeper.client.api.ReadHandlegetLedger()Get the ledger, from which this InputStream read data.abstract longgetStartEntryId()Get start entry id contained in this InputStream.
-
-
-
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
-
-