Class AvailabilityOfEntriesOfLedger


  • public class AvailabilityOfEntriesOfLedger
    extends java.lang.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.

    • Constructor Detail

      • AvailabilityOfEntriesOfLedger

        public AvailabilityOfEntriesOfLedger​(java.util.PrimitiveIterator.OfLong entriesOfLedgerItr)
      • AvailabilityOfEntriesOfLedger

        public AvailabilityOfEntriesOfLedger​(long[] entriesOfLedger)
      • AvailabilityOfEntriesOfLedger

        public AvailabilityOfEntriesOfLedger​(byte[] serializeStateOfEntriesOfLedger)
      • AvailabilityOfEntriesOfLedger

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

      • serializeStateOfEntriesOfLedger

        public byte[] serializeStateOfEntriesOfLedger()
      • isEntryAvailable

        public boolean isEntryAvailable​(long entryId)
      • getUnavailableEntries

        public java.util.List<java.lang.Long> getUnavailableEntries​(long startEntryId,
                                                                    long lastEntryId,
                                                                    java.util.BitSet availabilityOfEntries)
      • getTotalNumOfAvailableEntries

        public long getTotalNumOfAvailableEntries()