Package org.apache.bookkeeper.client
Class LedgerEntry
java.lang.Object
org.apache.bookkeeper.client.LedgerEntry
Ledger entry. Its a simple tuple containing the ledger id, the entry-id, and
the entry content.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]getEntry()Returns the content of the entry.io.netty.buffer.ByteBufReturn the internal buffer that contains the entry payload.longReturns the content of the entry.longlong
-
Field Details
-
ledgerId
final long ledgerId -
entryId
final long entryId -
length
final long length -
data
io.netty.buffer.ByteBuf data
-
-
Constructor Details
-
LedgerEntry
LedgerEntry(LedgerEntryImpl entry)
-
-
Method Details
-
getLedgerId
public long getLedgerId() -
getEntryId
public long getEntryId() -
getLength
public long getLength() -
getEntry
public byte[] getEntry()Returns the content of the entry. This method can be called only once. While using v2 wire protocol this method will automatically release the internal ByteBuf- Returns:
- the content of the entry
- Throws:
IllegalStateException- if this method is called twice
-
getEntryInputStream
Returns the content of the entry. This method can be called only once. While using v2 wire protocol this method will automatically release the internal ByteBuf when calling the close method of the returned InputStream- Returns:
- an InputStream which gives access to the content of the entry
- Throws:
IllegalStateException- if this method is called twice
-
getEntryBuffer
public io.netty.buffer.ByteBuf getEntryBuffer()Return the internal buffer that contains the entry payload.Note: Using v2 wire protocol it is responsibility of the caller to ensure to release the buffer after usage.
- Returns:
- a ByteBuf which contains the data
- Throws:
IllegalStateException- if the entry has been retrieved bygetEntry()orgetEntryInputStream().- See Also:
-