Class ReadCallback<E extends Endpoints<E>,​P extends ReplicaPlan.ForRead<E,​P>>

    • Method Detail

      • replicaPlan

        protected P replicaPlan()
      • await

        public boolean await​(long commandTimeout,
                             java.util.concurrent.TimeUnit unit)
      • awaitUntil

        public boolean awaitUntil​(long deadline)
        In case of speculation, we want to time out the request immediately if we have _also_ hit a deadline. For example, we have a read timeout of 10s, 99% latency of 5 seconds, and time base is QUEUE: * Request has spent 3 seconds in the queue. Here, we will wait for 2 seconds and try to speculate * Request has spent 10 seconds in the queue. Here, we will wait for 0 seconds and try to speculate If the time base is REQUEST: * Request has spent 10 seconds in the queue. Here, we will only wait 2 seconds and then try to speculate We should _not_ speculate in all these cases, since by that time we are already past request deadline.
      • blockFor

        public int blockFor()
      • trackLatencyForSnitch

        public boolean trackLatencyForSnitch()
        Specified by:
        trackLatencyForSnitch in interface RequestCallback<E extends Endpoints<E>>
        Returns:
        true if this callback is on the read path and its latency should be given as input to the dynamic snitch.
      • invokeOnFailure

        public boolean invokeOnFailure()
        Description copied from interface: RequestCallback
        Returns true if the callback handles failure reporting - in which case the remove host will be asked to report failures to us in the event of a problem processing the request. TODO: this is an error prone method, and we should be handling failures everywhere so we should probably just start doing that, and remove this method
        Specified by:
        invokeOnFailure in interface RequestCallback<E extends Endpoints<E>>
        Returns:
        true if the callback should be invoked on failure