Class ReadOpBase.LedgerEntryRequest

    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      (package private) boolean fail​(int rc)
      Fail the request with given result code rc.
      (package private) int getRc()
      Get result code of this entry.
      (package private) boolean isComplete()
      Whether the read request completed.
      com.google.common.util.concurrent.ListenableFuture<java.lang.Boolean> issueSpeculativeRequest()
      Issues a speculative request and indicates if more speculative requests should be issued.
      (package private) void logErrorAndReattemptRead​(int bookieIndex, BookieId host, java.lang.String errMsg, int rc)
      Log error errMsg and reattempt read from host.
      (package private) abstract BookieId maybeSendSpeculativeRead​(java.util.BitSet heardFromHostsBitSet)
      Send to next replica speculatively, if required and possible.
      (package private) abstract void read()
      Execute the read request.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • complete

        final java.util.concurrent.atomic.AtomicBoolean complete
      • rc

        int rc
      • firstError

        int firstError
      • numBookiesMissingEntry

        int numBookiesMissingEntry
      • eId

        final long eId
      • ensemble

        final java.util.List<BookieId> ensemble
    • Constructor Detail

      • LedgerEntryRequest

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

      • close

        public void close()
      • read

        abstract void read()
        Execute the read request.
      • 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
      • issueSpeculativeRequest

        public com.google.common.util.concurrent.ListenableFuture<java.lang.Boolean> issueSpeculativeRequest()
        Issues a speculative request and indicates if more speculative requests should be issued.
        Specified by:
        issueSpeculativeRequest in interface SpeculativeRequestExecutor
        Returns:
        whether more speculative requests should be issued