class
BackupRequestFilter[Req, Rep] extends SimpleFilter[Req, Rep]
Value Members
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
final
def
==(arg0: Any): Boolean
-
def
agnosticAndThen(next: TypeAgnostic): Filter[Req, Rep, Req, Rep]
-
-
def
andThen(service: Service[Req, Rep]): Service[Req, Rep]
-
def
andThen[Req2, Rep2](next: Filter[Req, Rep, Req2, Rep2]): Filter[Req, Rep, Req2, Rep2]
-
def
andThenIf[Req2 >: Req, Rep2 <: Rep](condAndFilter: (Boolean, Filter[Req, Rep, Req2, Rep2])): Filter[Req, Rep, Req2, Rep2]
-
def
apply(req: Req, service: Service[Req, Rep]): Future[Rep]
-
final
def
asInstanceOf[T0]: T0
-
def
clone(): AnyRef
-
def
curried: (Req) ⇒ (Service[Req, Rep]) ⇒ Future[Rep]
-
final
def
eq(arg0: AnyRef): Boolean
-
def
equals(arg0: Any): Boolean
-
def
finalize(): Unit
-
final
def
getClass(): Class[_]
-
def
hashCode(): Int
-
final
def
isInstanceOf[T0]: Boolean
-
final
def
ne(arg0: AnyRef): Boolean
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
def
toString(): String
-
def
tupled: ((Req, Service[Req, Rep])) ⇒ Future[Rep]
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
Inherited from Filter[Req, Rep, Req, Rep]
Inherited from AnyRef
Inherited from Any
Issue a backup request after a threshold time has elapsed, useful for curtailing tail latencies in distributed systems. See [1] for details.
Several stats are exported through the given stats receiver exposing the filter's operating behavior:
timeouts
indicates the number of original requests that timed out and subsequently caused a backup request to be issued;won
indicates the number of original requests that won, including those that didn't actually race with a backup;lost
indicates the number of original requests that lost a race with their corresponding backup request, and finallycutoff_ms
indicates the current backup request cutoff value in milliseconds.[1]: Dean, J. and Barroso, L.A. (2013), The Tail at Scale, Communications of the ACM, Vol. 56 No. 2, Pages 74-80, http://cacm.acm.org/magazines/2013/2/160173-the-tail-at-scale/fulltext
A filter alone cannot guarantee that a request is dispatched onto a different endpoint from the original. Eventually, this should be implemented as a sort of queueing policy.
,Care must be taken to ensure that application of this filter preserves semantics since a request may be issued twice (ie. they are idempotent).