Class PendingReadOp.SequenceReadRequest

    • Field Detail

      • nextReplicaIndexToReadFrom

        int nextReplicaIndexToReadFrom
      • sentReplicas

        final java.util.BitSet sentReplicas
      • erroredReplicas

        final java.util.BitSet erroredReplicas
    • Constructor Detail

      • SequenceReadRequest

        SequenceReadRequest​(java.util.List<org.apache.bookkeeper.net.BookieId> ensemble,
                            long lId,
                            long eId)
    • Method Detail

      • maybeSendSpeculativeRead

        org.apache.bookkeeper.net.BookieId maybeSendSpeculativeRead​(java.util.BitSet heardFrom)
        Send to next replica speculatively, if required and possible. This returns the host we may have sent to for unit testing.
        Specified by:
        maybeSendSpeculativeRead in class PendingReadOp.LedgerEntryRequest
        Parameters:
        heardFrom - the set of hosts that we already received responses.
        Returns:
        host we sent to if we sent. null otherwise.
      • sendNextRead

        org.apache.bookkeeper.net.BookieId sendNextRead()
      • logErrorAndReattemptRead

        void logErrorAndReattemptRead​(int bookieIndex,
                                      org.apache.bookkeeper.net.BookieId host,
                                      java.lang.String errMsg,
                                      int rc)
        Description copied from class: PendingReadOp.LedgerEntryRequest
        Log error errMsg and reattempt read from host.
        Overrides:
        logErrorAndReattemptRead in class PendingReadOp.LedgerEntryRequest
        Parameters:
        bookieIndex - bookie index
        host - host that just respond
        errMsg - error msg to log
        rc - read result code
      • complete

        boolean complete​(int bookieIndex,
                         org.apache.bookkeeper.net.BookieId host,
                         io.netty.buffer.ByteBuf buffer)
        Description copied from class: PendingReadOp.LedgerEntryRequest
        Complete the read request from host.
        Overrides:
        complete in class PendingReadOp.LedgerEntryRequest
        Parameters:
        bookieIndex - bookie index
        host - host that respond the read
        buffer - the data buffer
        Returns:
        return true if we managed to complete the entry; otherwise return false if the read entry is not complete or it is already completed before