Package org.apache.bookkeeper.client
Class LedgerEntry
- java.lang.Object
-
- org.apache.bookkeeper.client.LedgerEntry
-
public class LedgerEntry extends java.lang.Object
Ledger entry. Its a simple tuple containing the ledger id, the entry-id, and the entry content.
-
-
Constructor Summary
Constructors Constructor Description LedgerEntry(LedgerEntryImpl entry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getEntry()
Returns the content of the entry.io.netty.buffer.ByteBuf
getEntryBuffer()
Return the internal buffer that contains the entry payload.long
getEntryId()
java.io.InputStream
getEntryInputStream()
Returns the content of the entry.long
getLedgerId()
long
getLength()
-
-
-
Constructor Detail
-
LedgerEntry
LedgerEntry(LedgerEntryImpl entry)
-
-
Method Detail
-
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:
java.lang.IllegalStateException
- if this method is called twice
-
getEntryInputStream
public java.io.InputStream 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:
java.lang.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:
java.lang.IllegalStateException
- if the entry has been retrieved bygetEntry()
orgetEntryInputStream()
.- See Also:
ClientConfiguration.setNettyUsePooledBuffers(boolean)
-
-