Class BlockAwareSegmentInputStream
java.lang.Object
java.io.InputStream
org.apache.bookkeeper.mledger.offload.jcloud.BlockAwareSegmentInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
BlockAwareSegmentInputStreamImpl
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract intGet sum of entries data size read from the this InputStream.abstract intGet entry count that read out from this InputStream.abstract intGet block size that could read out from this InputStream.abstract longGet end entry id contained in this InputStream.abstract org.apache.bookkeeper.client.api.ReadHandleGet the ledger, from which this InputStream read data.abstract longGet 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, skipNBytes, transferTo
-
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
-