Class PendingAddOp

  • All Implemented Interfaces:
    java.lang.Runnable, org.apache.bookkeeper.proto.BookkeeperInternalCallbacks.WriteCallback

    class PendingAddOp
    extends java.lang.Object
    implements java.lang.Runnable, org.apache.bookkeeper.proto.BookkeeperInternalCallbacks.WriteCallback
    This represents a pending add operation. When it has got success from all bookies, it sees if its at the head of the pending adds queue, and if yes, sends ack back to the application. If a bookie fails, a replacement is made and placed at the same position in the ensemble. The pending adds are then rereplicated.
    • Field Detail

      • payload

        io.netty.buffer.ByteBuf payload
      • toSend

        org.apache.bookkeeper.util.ByteBufList toSend
      • ctx

        java.lang.Object ctx
      • entryId

        long entryId
      • entryLength

        int entryLength
      • completed

        boolean completed
      • isRecoveryAdd

        boolean isRecoveryAdd
      • requestTimeNanos

        long requestTimeNanos
      • qwcLatency

        long qwcLatency
      • addEntrySuccessBookies

        java.util.Set<org.apache.bookkeeper.net.BookieId> addEntrySuccessBookies
      • writeDelayedStartTime

        long writeDelayedStartTime
      • currentLedgerLength

        long currentLedgerLength
      • pendingWriteRequests

        int pendingWriteRequests
      • callbackTriggered

        boolean callbackTriggered
      • hasRun

        boolean hasRun
      • writeFlags

        java.util.EnumSet<WriteFlag> writeFlags
      • allowFailFast

        boolean allowFailFast
      • ensemble

        java.util.List<org.apache.bookkeeper.net.BookieId> ensemble
    • Method Detail

      • allowFailFastOnUnwritableChannel

        PendingAddOp allowFailFastOnUnwritableChannel()
      • setEntryId

        void setEntryId​(long entryId)
      • setLedgerLength

        void setLedgerLength​(long ledgerLength)
      • getEntryId

        long getEntryId()
      • sendWriteRequest

        void sendWriteRequest​(java.util.List<org.apache.bookkeeper.net.BookieId> ensemble,
                              int bookieIndex)
      • maybeTimeout

        boolean maybeTimeout()
      • timeoutQuorumWait

        void timeoutQuorumWait()
      • unsetSuccessAndSendWriteRequest

        void unsetSuccessAndSendWriteRequest​(java.util.List<org.apache.bookkeeper.net.BookieId> ensemble,
                                             int bookieIndex)
      • run

        public void run()
        Initiate the add operation.
        Specified by:
        run in interface java.lang.Runnable
      • writeComplete

        public void writeComplete​(int rc,
                                  long ledgerId,
                                  long entryId,
                                  org.apache.bookkeeper.net.BookieId addr,
                                  java.lang.Object ctx)
        Specified by:
        writeComplete in interface org.apache.bookkeeper.proto.BookkeeperInternalCallbacks.WriteCallback
      • sendAddSuccessCallbacks

        void sendAddSuccessCallbacks()
      • submitCallback

        void submitCallback​(int rc)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • hashCode

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

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • recyclePendAddOpObject

        public void recyclePendAddOpObject()