a com.twitter.finagle.stats.StatsReceiver
the thrift client label
the configured com.twitter.finagle.service.RetryBudget
the com.twitter.scrooge.ThriftMethod for which this filter chain is configured
a multiplier to apply to timeouts used in any configures com.twitter.finagle.service.TimeoutFilter
a multiplier to apply to the number of retries used in any configured com.twitter.finagle.service.RetryFilter
if a high resolution com.twitter.util.Timer should be used such that retries are run tighter to their schedule
the com.twitter.finagle.Service to invoke after the filter chain
After this filter chain is executed this is the com.twitter.finagle.Service to invoke.
After this filter chain is executed this is the com.twitter.finagle.Service to invoke. The layer of indirection is to allow for servers that wish to intercept the invocation of the bottom service.
the com.twitter.finagle.Service to invoke at the end of this filter chain
a com.twitter.finagle.Service with this filter chain applied
Install a com.twitter.finagle.Filter.
Install a com.twitter.finagle.Filter. This filter will be added to the end of the filter chain. That is, this filter will be invoked AFTER any other installed filter on a request Req and thus BEFORE any other installed filter on a response Rep.
the type of the filter to instantiate from the injector
Install a com.twitter.finagle.Filter.
Install a com.twitter.finagle.Filter. This filter will be added to the end of the filter chain. That is, this filter will be invoked AFTER any other installed filter on a request Req and thus BEFORE any other installed filter on a response Rep.
the com.twitter.finagle.Filter to install.
Example scope: clnt/thrift/Adder/add1String
Example scope: clnt/thrift/Adder/add1String
Install a com.twitter.finagle.Filter.TypeAgnostic that is agnostic to the ThriftMethod Req/Rep types.
Install a com.twitter.finagle.Filter.TypeAgnostic that is agnostic to the ThriftMethod Req/Rep types. This allows for use of more general filters that do not care about the ThriftMethod input and output types.
the type of the filter to instantiate from the injector
Install a com.twitter.finagle.Filter that is agnostic to the ThriftMethod Req/Rep types.
Install a com.twitter.finagle.Filter that is agnostic to the ThriftMethod Req/Rep types. This allows for use of more general filters that do not care about the ThriftMethod input and output types.
the com.twitter.finagle.Filter.TypeAgnostic to install.
Install a com.twitter.finagle.filter.RequestSemaphoreFilter using an com.twitter.concurrent.AsyncSemaphore
with an Optional maxWaiters
as the limit on the number of waiters for permits.
Install a com.twitter.finagle.filter.RequestSemaphoreFilter using an com.twitter.concurrent.AsyncSemaphore
with an Optional maxWaiters
as the limit on the number of waiters for permits.
must be positive
must be non-negative if set
com.twitter.concurrent.AsyncSemaphore
com.twitter.finagle.filter.RequestSemaphoreFilter
Install a com.twitter.finagle.service.RetryFilter configured with a com.twitter.finagle.service.RetryPolicy using constant backoffs.
Install a com.twitter.finagle.service.RetryFilter configured with a com.twitter.finagle.service.RetryPolicy using constant backoffs.
a PartialFunction over the both the Req and a Try-wrapped returned Rep. Only one of
#shouldRetry
or #shouldRetryResponse
should be configured
a PartialFunction over only the Try-wrapped returned Rep. Only one of
#shouldRetry
or #shouldRetryResponse
should be configured
how long to delay before retrying
number of times to retry
a com.twitter.finagle.service.RetryBudget. It is highly recommended to share a single instance of com.twitter.finagle.service.RetryBudget between both retry and re-queue filters to prevent retry storms. As such, use caution here when specifying a new retryBudget
com.twitter.finagle.service.RetryPolicy
com.twitter.finagle.service.RetryFilter
Install a com.twitter.finagle.Filter specific to handling exceptions.
Install a com.twitter.finagle.Filter specific to handling exceptions. This filter will be correctly positioned in the filter chain near the top of the stack. This filter is generally used to mutate or alter the final response Req based on a returned exception. E.g., to translate a transport-level exception from Finagle to an application-level exception.
the type of the filter to instantiate from the injector
Install a com.twitter.finagle.Filter specific to handling exceptions.
Install a com.twitter.finagle.Filter specific to handling exceptions. This filter will be correctly positioned in the filter chain near the top of the stack. This filter is generally used to mutate or alter the final response Req based on a returned exception. E.g., to translate a transport-level exception from Finagle to an application-level exception.
the com.twitter.finagle.Filter to install.
Install a com.twitter.finagle.service.RetryFilter configured with a com.twitter.finagle.service.RetryPolicy using backoffs that grow exponentially using com.twitter.finagle.service.Backoff#decorrelatedJittered.
Install a com.twitter.finagle.service.RetryFilter configured with a com.twitter.finagle.service.RetryPolicy
using backoffs that grow exponentially using com.twitter.finagle.service.Backoff#decorrelatedJittered. The jittered
maximum is the start
duration * the multiplier
value.
a PartialFunction over the both the Req and a Try-wrapped returned Rep. Only one of
#shouldRetry
or #shouldRetryResponse
should be configured
a PartialFunction over only the Try-wrapped returned Rep. Only one of
#shouldRetry
or #shouldRetryResponse
should be configured
how long to delay before retrying
used to create a jitter with a random distribution between start
and 3 times the previously selected value,
capped at start
* multiplier
. See: com.twitter.finagle.service.Backoff#decorrelatedJittered
number of times to retry
com.twitter.finagle.service.RetryPolicy
com.twitter.finagle.service.RetryFilter
A parameter-less implementation with defaults
Install a com.twitter.inject.thrift.internal.filters.LatencyFilter that tracks the "logical" (overall) latency distribution of a method invocation.
Install a com.twitter.inject.thrift.internal.filters.LatencyFilter that tracks the "logical" (overall) latency distribution of a method invocation. This will INCLUDE any retries as it is installed at the top of the filter stack.
a com.twitter.finagle.stats.StatsReceiver to track StatsFilter measurements. By default this will be the class-level StatsReceiver scoped accordingly.
this controls what granularity is used for measuring latency. The default is milliseconds, but other values are valid. The choice of this changes the name of the stat attached to the given com.twitter.finagle.stats.StatsReceiver. For the common units, it will be "latency_ms".
com.twitter.finagle.service.StatsFilter.DefaultExceptions
com.twitter.finagle.service.ResponseClassifier
A parameter-less implementation with defaults
Install a com.twitter.inject.thrift.internal.filters.LatencyFilter that tracks the per-request latency distribution of a method invocation.
Install a com.twitter.inject.thrift.internal.filters.LatencyFilter that tracks the per-request latency distribution of a method invocation. This will per-retry if the invocation results in retried requests.
a com.twitter.finagle.stats.StatsReceiver to track StatsFilter measurements. By default this will be the class-level StatsReceiver scoped accordingly.
this controls what granularity is used for measuring latency. The default is milliseconds, but other values are valid. The choice of this changes the name of the stat attached to the given com.twitter.finagle.stats.StatsReceiver. For the common units, it will be "request_latency_ms".
com.twitter.finagle.service.StatsFilter.DefaultExceptions
com.twitter.finagle.service.ResponseClassifier
Install a com.twitter.finagle.service.TimeoutFilter configuration with the given tunable timeout.
Install a com.twitter.finagle.service.TimeoutFilter configuration with the given tunable timeout. This filter will always be "below" any configured retry filter and thus does NOT include retries.
the Tunable[Duration] (org.joda.time.Duration) timeout to apply to requests through the filter.
com.twitter.finagle.service.TimeoutFilter
Install a com.twitter.finagle.service.TimeoutFilter configuration with the given org.joda.time.Duration timeout.
Install a com.twitter.finagle.service.TimeoutFilter configuration with the given org.joda.time.Duration timeout. This filter will always be "below" any configured retry filter and thus does NOT include retries.
the org.joda.time.Duration timeout to apply to requests through the filter.
com.twitter.finagle.service.TimeoutFilter
Install a com.twitter.finagle.service.RetryFilter configured with the given com.twitter.finagle.service.RetryPolicy.
Install a com.twitter.finagle.service.RetryFilter configured with the given com.twitter.finagle.service.RetryPolicy.
the com.twitter.finagle.service.RetryPolicy to use
a String message to display before retrying thr request.
com.twitter.finagle.service.RetryPolicy
com.twitter.finagle.service.RetryFilter
Install a com.twitter.finagle.service.TimeoutFilter configuration with the given tunable timeout.
Install a com.twitter.finagle.service.TimeoutFilter configuration with the given tunable timeout. This filter will be "above" any configured retry filter and thus includes retries.
the Tunable[Duration] (org.joda.time.Duration) timeout to apply to requests through the filter.
com.twitter.finagle.service.TimeoutFilter
Install a com.twitter.finagle.service.TimeoutFilter configuration with the given org.joda.time.Duration timeout.
Install a com.twitter.finagle.service.TimeoutFilter configuration with the given org.joda.time.Duration timeout. This filter will be "above" and configured retry filter and thus includes retries.
the org.joda.time.Duration timeout to apply to requests through the filter.
com.twitter.finagle.service.TimeoutFilter
A com.twitter.finagle.Filter chain builder which provides helper functions for installing and configuring common filters.
Filters configured via the helper methods, e.g., withRetryPolicy, withTimeout, withRequestTimeout, withMethodLatency, withExceptionFilter, will be composed in a specific order, (from top-down, assuming requests/responses enter and exit through the top):
+------------------------+ | latencyFilter | +------------------------+ | exceptionFilter | +------------------------+ | timeoutFilter | +------------------------+ | retryFilter | +------------------------+ | requestTimeoutFilter | +------------------------+ | concurrencyLimitFilter | +------------------------+ | filterChain | +------------------------+
where, the
filterChain
is the chain of filters added in the order of calls to filtered.Request type for this filter chain
Response type for this filter chain
(Since version 2018-01-12) Use ThriftMethodBuilderClientModule and ThriftMethodBuilder
com.twitter.finagle.thrift.service.ThriftServicePerEndpoint
com.twitter.inject.thrift.filters.ThriftClientFilterBuilder