Class PendingReadLacOp

  • All Implemented Interfaces:

    class PendingReadLacOp
    extends java.lang.Object
    implements org.apache.bookkeeper.proto.BookkeeperInternalCallbacks.ReadLacCallback
    This represents a pending ReadLac operation.

    LAC is stored in two places on bookies. 1. WriteLac operation sends Explicit LAC and is stored in memory on each bookie. 2. Each AddEntry operation piggy-backs LAC which is stored on bookie's disk.

    This operation returns both of those entries and we pick the latest LAC out of available answers.

    This is an optional protocol operations to facilitate tailing readers to be up to date with the writer. This is best effort to get latest LAC from bookies, and doesn't affect the correctness of the protocol.

    • Field Detail

      • LOG

        static final org.slf4j.Logger LOG
      • bookieClient

        org.apache.bookkeeper.proto.BookieClient bookieClient
      • numResponsesPending

        int numResponsesPending
      • completed

        volatile boolean completed
      • lastSeenError

        int lastSeenError
      • maxLac

        long maxLac
      • currentEnsemble

        final java.util.List<> currentEnsemble
    • Constructor Detail

      • PendingReadLacOp

        PendingReadLacOp​(LedgerHandle lh,
                         org.apache.bookkeeper.proto.BookieClient bookieClient,
                         java.util.List<> ensemble,
                         PendingReadLacOp.LacCallback cb)
    • Method Detail

      • initiate

        public void initiate()
      • readLacComplete

        public void readLacComplete​(int rc,
                                    long ledgerId,
                                    io.netty.buffer.ByteBuf lacBuffer,
                                    io.netty.buffer.ByteBuf lastEntryBuffer,
                                    java.lang.Object ctx)
        Specified by:
        readLacComplete in interface org.apache.bookkeeper.proto.BookkeeperInternalCallbacks.ReadLacCallback