Class EntryImpl

All Implemented Interfaces:
io.netty.util.ReferenceCounted, Comparable<EntryImpl>, Entry

public final class EntryImpl extends AbstractCASReferenceCounted implements Entry, Comparable<EntryImpl>, io.netty.util.ReferenceCounted
  • Method Details

    • 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)
    • create

      public static EntryImpl create(EntryImpl other)
    • onDeallocate

      public void onDeallocate(Runnable r)
    • getTimestamp

      public long getTimestamp()
    • getDataBuffer

      public io.netty.buffer.ByteBuf getDataBuffer()
      Specified by:
      getDataBuffer in interface Entry
      Returns:
      the data buffer for the entry
    • getData

      public byte[] getData()
      Specified by:
      getData in interface Entry
      Returns:
      the data
    • getDataAndRelease

      public byte[] getDataAndRelease()
      Specified by:
      getDataAndRelease in interface Entry
    • getLength

      public int getLength()
      Specified by:
      getLength in interface Entry
      Returns:
      the entry length in bytes
    • getPosition

      public PositionImpl getPosition()
      Specified by:
      getPosition in interface Entry
      Returns:
      the position at which the entry was stored
    • getLedgerId

      public long getLedgerId()
      Specified by:
      getLedgerId in interface Entry
      Returns:
      ledgerId of the position
    • getEntryId

      public long getEntryId()
      Specified by:
      getEntryId in interface Entry
      Returns:
      entryId of the position
    • compareTo

      public int compareTo(EntryImpl other)
      Specified by:
      compareTo in interface Comparable<EntryImpl>
    • touch

      public io.netty.util.ReferenceCounted touch(Object hint)
      Specified by:
      touch in interface io.netty.util.ReferenceCounted
    • deallocate

      protected void deallocate()
      Description copied from class: AbstractCASReferenceCounted
      Called once AbstractCASReferenceCounted.refCnt() is equals 0.
      Specified by:
      deallocate in class AbstractCASReferenceCounted