Class ReadLastConfirmedAndEntryOp.ReadLACAndEntryRequest

    • Constructor Detail

      • ReadLACAndEntryRequest

        ReadLACAndEntryRequest​(java.util.List<BookieId> ensemble,
                               long lId,
                               long eId)
    • Method Detail

      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
      • getFirstError

        int getFirstError()
      • read

        abstract void read()
        Execute the read request.
      • complete

        boolean complete​(int bookieIndex,
                         BookieId host,
                         io.netty.buffer.ByteBuf buffer,
                         long entryId)
        Complete the read request from host.
        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
      • fail

        boolean fail​(int rc)
        Fail the request with given result code rc.
        Parameters:
        rc - result code to fail the request.
        Returns:
        true if we managed to fail the entry; otherwise return false if it already failed or completed.
      • logErrorAndReattemptRead

        void logErrorAndReattemptRead​(int bookieIndex,
                                      BookieId host,
                                      java.lang.String errMsg,
                                      int rc)
        Log error errMsg and reattempt read from host.
        Parameters:
        bookieIndex - bookie index
        host - host that just respond
        errMsg - error msg to log
        rc - read result code
      • maybeSendSpeculativeRead

        abstract BookieId maybeSendSpeculativeRead​(java.util.BitSet heardFromHostsBitSet)
        Send to next replica speculatively, if required and possible. This returns the host we may have sent to for unit testing.
        Parameters:
        heardFromHostsBitSet - the set of hosts that we already received responses.
        Returns:
        host we sent to if we sent. null otherwise.
      • isComplete

        boolean isComplete()
        Whether the read request completed.
        Returns:
        true if the read request is completed.
      • getRc

        int getRc()
        Get result code of this entry.
        Returns:
        result code.
      • toString

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