Class PositionImpl

java.lang.Object
org.apache.bookkeeper.mledger.impl.PositionImpl
All Implemented Interfaces:
Comparable<PositionImpl>, Position
Direct Known Subclasses:
PositionImplRecyclable

public class PositionImpl extends Object implements Position, Comparable<PositionImpl>
  • Field Details

    • ledgerId

      protected long ledgerId
    • entryId

      protected long entryId
    • ackSet

      protected long[] ackSet
    • EARLIEST

      public static final PositionImpl EARLIEST
    • LATEST

      public static final PositionImpl LATEST
  • Constructor Details

  • Method Details

    • get

      public static PositionImpl get(long ledgerId, long entryId)
    • get

      public static PositionImpl get(long ledgerId, long entryId, long[] ackSet)
    • get

      public static PositionImpl get(PositionImpl other)
    • getAckSet

      public long[] getAckSet()
    • setAckSet

      public void setAckSet(long[] ackSet)
    • getLedgerId

      public long getLedgerId()
      Specified by:
      getLedgerId in interface Position
    • getEntryId

      public long getEntryId()
      Specified by:
      getEntryId in interface Position
    • getNext

      public PositionImpl getNext()
      Description copied from interface: Position
      Get the position of the entry next to this one. The returned position might point to a non-existing, or not-yet existing entry
      Specified by:
      getNext in interface Position
      Returns:
      the position of the next logical entry
    • getPositionAfterEntries

      public PositionImpl getPositionAfterEntries(int entryNum)
      Position after moving entryNum messages, if entryNum < 1, then return the current position.
    • toString

      public String toString()
      String representation of virtual cursor - LedgerId:EntryId.
      Overrides:
      toString in class Object
    • compareTo

      public int compareTo(PositionImpl that)
      Specified by:
      compareTo in interface Comparable<PositionImpl>
    • compareTo

      public int compareTo(long ledgerId, long entryId)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hasAckSet

      public boolean hasAckSet()
    • getPositionInfo

      public MLDataFormats.PositionInfo getPositionInfo()