Class EntryImpl
- java.lang.Object
-
- org.apache.bookkeeper.mledger.util.AbstractCASReferenceCounted
-
- org.apache.bookkeeper.mledger.impl.EntryImpl
-
public final class EntryImpl extends AbstractCASReferenceCounted implements Entry, java.lang.Comparable<EntryImpl>, io.netty.util.ReferenceCounted
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(EntryImpl other)static EntryImplcreate(long ledgerId, long entryId, byte[] data)static EntryImplcreate(long ledgerId, long entryId, io.netty.buffer.ByteBuf data)static EntryImplcreate(org.apache.bookkeeper.client.api.LedgerEntry ledgerEntry)static EntryImplcreate(EntryImpl other)static EntryImplcreate(PositionImpl position, io.netty.buffer.ByteBuf data)protected voiddeallocate()Called onceAbstractCASReferenceCounted.refCnt()is equals 0.byte[]getData()byte[]getDataAndRelease()io.netty.buffer.ByteBufgetDataBuffer()longgetEntryId()longgetLedgerId()intgetLength()PositionImplgetPosition()longgetTimestamp()io.netty.util.ReferenceCountedtouch(java.lang.Object hint)-
Methods inherited from class org.apache.bookkeeper.mledger.util.AbstractCASReferenceCounted
refCnt, release, release, retain, retain, setRefCnt, touch
-
-
-
-
Method Detail
-
create
public static EntryImpl create(org.apache.bookkeeper.client.api.LedgerEntry ledgerEntry)
-
create
public static EntryImpl create(long ledgerId, long entryId, byte[] data)
-
create
public static EntryImpl create(long ledgerId, long entryId, io.netty.buffer.ByteBuf data)
-
create
public static EntryImpl create(PositionImpl position, io.netty.buffer.ByteBuf data)
-
getTimestamp
public long getTimestamp()
-
getDataBuffer
public io.netty.buffer.ByteBuf getDataBuffer()
- Specified by:
getDataBufferin interfaceEntry- Returns:
- the data buffer for the entry
-
getDataAndRelease
public byte[] getDataAndRelease()
- Specified by:
getDataAndReleasein interfaceEntry
-
getLength
public int getLength()
-
getPosition
public PositionImpl getPosition()
- Specified by:
getPositionin interfaceEntry- Returns:
- the position at which the entry was stored
-
getLedgerId
public long getLedgerId()
- Specified by:
getLedgerIdin interfaceEntry- Returns:
- ledgerId of the position
-
getEntryId
public long getEntryId()
- Specified by:
getEntryIdin interfaceEntry- Returns:
- entryId of the position
-
compareTo
public int compareTo(EntryImpl other)
- Specified by:
compareToin interfacejava.lang.Comparable<EntryImpl>
-
touch
public io.netty.util.ReferenceCounted touch(java.lang.Object hint)
- Specified by:
touchin interfaceio.netty.util.ReferenceCounted
-
deallocate
protected void deallocate()
Description copied from class:AbstractCASReferenceCountedCalled onceAbstractCASReferenceCounted.refCnt()is equals 0.- Specified by:
deallocatein classAbstractCASReferenceCounted
-
-