Class AvailabilityOfEntriesOfLedger

java.lang.Object
org.apache.bookkeeper.util.AvailabilityOfEntriesOfLedger

public class AvailabilityOfEntriesOfLedger extends Object
Ordered collection of SequenceGroups will represent entries of the ledger residing in a bookie.

In the byte array representation of AvailabilityOfEntriesOfLedger, for the sake of future extensibility it would be helpful to have reserved space for header at the beginning. So the first 64 bytes will be used for header, with the first four bytes specifying the int version number, next four bytes specifying the number of sequencegroups for now and the rest of the bytes in the reserved space will be 0's. The encoded format will be represented after the first 64 bytes. The ordered collection of SequenceGroups will be appended sequentially to this byte array, with each SequenceGroup taking 24 bytes.

  • Field Details

  • Constructor Details

    • AvailabilityOfEntriesOfLedger

      public AvailabilityOfEntriesOfLedger(PrimitiveIterator.OfLong entriesOfLedgerItr)
    • AvailabilityOfEntriesOfLedger

      public AvailabilityOfEntriesOfLedger(long[] entriesOfLedger)
    • AvailabilityOfEntriesOfLedger

      public AvailabilityOfEntriesOfLedger(byte[] serializeStateOfEntriesOfLedger)
    • AvailabilityOfEntriesOfLedger

      public AvailabilityOfEntriesOfLedger(io.netty.buffer.ByteBuf byteBuf)
  • Method Details

    • serializeStateOfEntriesOfLedger

      public byte[] serializeStateOfEntriesOfLedger()
    • isEntryAvailable

      public boolean isEntryAvailable(long entryId)
    • getUnavailableEntries

      public List<Long> getUnavailableEntries(long startEntryId, long lastEntryId, BitSet availabilityOfEntries)
    • getTotalNumOfAvailableEntries

      public long getTotalNumOfAvailableEntries()