Packages

abstract class FilteredThriftClientModule[FutureIface <: ThriftService, ServiceIface <: Filterable[ServiceIface]] extends TwitterModule

Provides a FutureIface in the form of RemoteService[Future] for making calls to a remote service. The FutureIface (e.g., RemoteService[Future]) wraps a ServiceIface in which each method is implemented in the form of a com.twitter.finagle.Service typed from com.twitter.scrooge.ThriftMethod.Args to com.twitter.scrooge.ThriftMethod.SuccessType.

A FutureIface of RemoteService[Future] is used as this is the FutureIface type generated by Scrooge's "services-per-endpoint" functionality e.g. the result of calling Thrift.Client.newMethodIface(...); as opposed to the functionally equivalent RemoteService.FutureIface.

To provide per-method filters to the ServiceIface provide an implementation of filterServiceIface and use the provided com.twitter.inject.thrift.filters.ThriftClientFilterBuilder to filter methods. E.g.,

serviceIface.copy( fetchBlob = filters.method(FetchBlob) .withMethodLatency .withExponentialRetry( shouldRetryResponse = PossiblyRetryableExceptions, start = 50.millis, multiplier = 2, retries = 3) .withRequestLatency .withRequestTimeout(500.millis) .withConcurrencyLimit( initialPermits = 100) .filtered(new MyFilter) .filtered[MyOtherFilter] .andThen(serviceIface.fetchBlob))

Annotations
@deprecated
Deprecated

(Since version 2018-01-08) Use the com.twitter.inject.thrift.modules.ThriftMethodBuilderClientModule

See also

com.twitter.finagle.thrift.MethodIfaceBuilder

Services-per-endpoint in Scrooge

Finagle Clients

Linear Supertypes
TwitterModule, TwitterBaseModule, TwitterModuleLifecycle, Logging, util.logging.Logging, TwitterModuleFlags, AbstractModule, Module, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. FilteredThriftClientModule
  2. TwitterModule
  3. TwitterBaseModule
  4. TwitterModuleLifecycle
  5. Logging
  6. Logging
  7. TwitterModuleFlags
  8. AbstractModule
  9. Module
  10. AnyRef
  11. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new FilteredThriftClientModule()(implicit arg0: ClassTag[FutureIface], arg1: ClassTag[ServiceIface], serviceBuilder: ServiceIfaceBuilder[ServiceIface], methodBuilder: MethodIfaceBuilder[ServiceIface, FutureIface])

Abstract Value Members

  1. abstract val dest: String

    Destination of client

  2. abstract val label: String

    Name of client for use in metrics

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. val PossiblyRetryableExceptions: PartialFunction[Try[_], Boolean]
    Attributes
    protected
  5. def addError(arg0: Message): Unit
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  6. def addError(arg0: Throwable): Unit
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  7. def addError(arg0: String, arg1: <repeated...>[AnyRef]): Unit
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
    Annotations
    @transient()
  8. def addTypeConverter[T](converter: TypeConverter)(implicit arg0: Manifest[T]): Unit
    Attributes
    protected
    Definition Classes
    TwitterModule
  9. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  10. def bind[T, A <: Annotation](implicit arg0: Manifest[T], arg1: Manifest[A]): ScalaAnnotatedBindingBuilder[T]
    Attributes
    protected
    Definition Classes
    TwitterModule
  11. def bind[T](annotation: Annotation)(implicit arg0: Manifest[T]): ScalaAnnotatedBindingBuilder[T]
    Attributes
    protected
    Definition Classes
    TwitterModule
  12. def bind[T](implicit arg0: Manifest[T]): ScalaAnnotatedBindingBuilder[T]
    Attributes
    protected
    Definition Classes
    TwitterModule
  13. def bind[T](arg0: Class[T]): AnnotatedBindingBuilder[T]
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  14. def bind[T](arg0: TypeLiteral[T]): AnnotatedBindingBuilder[T]
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  15. def bind[T](arg0: Key[T]): LinkedBindingBuilder[T]
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  16. def bindAssistedFactory[T]()(implicit arg0: Manifest[T]): Unit
    Attributes
    protected
    Definition Classes
    TwitterModule
  17. def bindConstant(): AnnotatedConstantBindingBuilder
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  18. def bindInterceptor(arg0: Matcher[_ >: Class[_]], arg1: Matcher[_ >: Method], arg2: <repeated...>[MethodInterceptor]): Unit
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
    Annotations
    @transient()
  19. def bindListener(arg0: Matcher[_ >: Binding[_]], arg1: <repeated...>[ProvisionListener]): Unit
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
    Annotations
    @transient()
  20. def bindListener(arg0: Matcher[_ >: TypeLiteral[_]], arg1: TypeListener): Unit
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  21. def bindScope(arg0: Class[_ <: Annotation], arg1: Scope): Unit
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  22. def bindSingleton[T, A <: Annotation](implicit arg0: Manifest[T], arg1: Manifest[A]): ScalaAnnotatedBindingBuilder[T]
    Attributes
    protected
    Definition Classes
    TwitterModule
  23. def bindSingleton[T](annotation: Annotation)(implicit arg0: Manifest[T]): ScalaAnnotatedBindingBuilder[T]
    Attributes
    protected
    Definition Classes
    TwitterModule
  24. def bindSingleton[T](implicit arg0: Manifest[T]): ScalaAnnotatedBindingBuilder[T]
    Attributes
    protected
    Definition Classes
    TwitterModule
  25. def binder(): Binder
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  26. def budget: Budget

    Default com.twitter.finagle.service.RetryBudget.

    Default com.twitter.finagle.service.RetryBudget. It is highly recommended that budgets be shared between all filters that retry or re-queue requests to prevent retry storms.

    returns

    a default com.twitter.finagle.service.RetryBudget

    Attributes
    protected
    See also

    https://twitter.github.io/finagle/guide/Clients.html#retries

  27. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  28. def closeOnExit(f: ⇒ Unit): Unit
    Attributes
    protected
    Definition Classes
    TwitterModuleLifecycle
  29. def configure(): Unit
    Attributes
    protected
    Definition Classes
    TwitterModule → AbstractModule
  30. final def configure(arg0: Binder): Unit
    Definition Classes
    AbstractModule → Module
  31. def configureNonThriftMuxClient(client: Client): Client

    This method allows for further configuration of the client for parameters not exposed by this module or for overriding defaults provided herein, e.g.,

    This method allows for further configuration of the client for parameters not exposed by this module or for overriding defaults provided herein, e.g.,

    override def configureNonThriftMuxClient(client: Thrift.Client): Thrift.Client = { client .withProtocolFactory(myCustomProtocolFactory)) .withStatsReceiver(someOtherScopedStatsReceiver) .withMonitor(myAwesomeMonitor) .withTracer(notTheDefaultTracer) .withResponseClassifier(ThriftResponseClassifier.ThriftExceptionsAsFailures) }

    In general it is recommended that users prefer to use ThriftMux if the server-side supports mux connections.

    client

    - the com.twitter.finagle.Thrift.Client to configure.

    returns

    a configured Thrift.Client.

    Attributes
    protected
  32. def configureThriftMuxClient(client: Client): Client

    This method allows for further configuration of the client for parameters not exposed by this module or for overriding defaults provided herein, e.g.,

    This method allows for further configuration of the client for parameters not exposed by this module or for overriding defaults provided herein, e.g.,

    override def configureThriftMuxClient(client: ThriftMux.Client): ThriftMux.Client = { client .withProtocolFactory(myCustomProtocolFactory)) .withStatsReceiver(someOtherScopedStatsReceiver) .withMonitor(myAwesomeMonitor) .withTracer(notTheDefaultTracer) .withResponseClassifier(ThriftResponseClassifier.ThriftExceptionsAsFailures) }

    client

    - the com.twitter.finagle.ThriftMux.Client to configure.

    returns

    a configured ThriftMux.Client.

    Attributes
    protected
  33. def convertToTypes(arg0: Matcher[_ >: TypeLiteral[_]], arg1: TypeConverter): Unit
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  34. def createFlag[T](name: String, default: T, help: String, flaggable: Flaggable[T]): Flag[T]
    Attributes
    protected
    Definition Classes
    TwitterModuleFlags
  35. def createKey[T](implicit arg0: Manifest[T]): Key[T]
    Attributes
    protected
    Definition Classes
    TwitterBaseModule
  36. def createMandatoryFlag[T](name: String, help: String, usage: String, flaggable: Flaggable[T]): Flag[T]
    Definition Classes
    TwitterModuleFlags
  37. def createMultiBinder[MultiBindType](implicit arg0: Manifest[MultiBindType]): ScalaMultibinder[MultiBindType]
    Attributes
    protected
    Definition Classes
    TwitterModule
  38. def currentStage(): Stage
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  39. def debug(marker: Marker, message: ⇒ Any, cause: Throwable): Unit
    Attributes
    protected[this]
    Definition Classes
    Logging
  40. def debug(message: ⇒ Any, cause: Throwable): Unit
    Attributes
    protected[this]
    Definition Classes
    Logging
  41. def debug(marker: Marker, message: ⇒ Any): Unit
    Attributes
    protected[this]
    Definition Classes
    Logging
  42. def debug(message: ⇒ Any): Unit
    Attributes
    protected[this]
    Definition Classes
    Logging
  43. def debugFutureResult[T](msg: String)(func: ⇒ Future[T]): Future[T]
    Attributes
    protected
    Definition Classes
    Logging
  44. def debugResult[T](message: ⇒ String)(fn: ⇒ T): T
    Attributes
    protected[this]
    Definition Classes
    Logging
  45. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  46. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  47. def error(marker: Marker, message: ⇒ Any, cause: Throwable): Unit
    Attributes
    protected[this]
    Definition Classes
    Logging
  48. def error(message: ⇒ Any, cause: Throwable): Unit
    Attributes
    protected[this]
    Definition Classes
    Logging
  49. def error(marker: Marker, message: ⇒ Any): Unit
    Attributes
    protected[this]
    Definition Classes
    Logging
  50. def error(message: ⇒ Any): Unit
    Attributes
    protected[this]
    Definition Classes
    Logging
  51. def errorResult[T](message: ⇒ String)(fn: ⇒ T): T
    Attributes
    protected[this]
    Definition Classes
    Logging
  52. def filterServiceIface(serviceIface: ServiceIface, filters: ThriftClientFilterBuilder): ServiceIface

    Add filters to the ServiceIface.

    Add filters to the ServiceIface. This is done by copying the ServiceIface then filtering each method as desired via a com.twitter.inject.thrift.filters.ThriftClientFilterChain returned from com.twitter.inject.thrift.filters.ThriftClientFilterBuilder.method. E.g.,

    filters.method(FetchBlob) .withMethodLatency .withConstantRetry( shouldRetryResponse = PossiblyRetryableExceptions, start = 50.millis, retries = 3) .withRequestLatency .withRequestTimeout(250.millis) .withConcurrencyLimit( initialPermits = 500) .filtered(new MyFilter) .filtered[MyOtherFilter] .andThen(serviceIface.fetchBlob))

    Note: the com.twitter.inject.thrift.filters.ThriftClientFilterChain supports adding filters either by instance or by type.

    Subclasses of this module MAY provide an implementation of filterServiceIface which filters the ServiceIface per-method.

    serviceIface

    - the ServiceIface to filter per-method.

    filters

    - a com.twitter.inject.thrift.filters.ThriftClientFilterBuilder which can be invoked to construct a com.twitter.inject.thrift.filters.ThriftClientFilterChain per-method.

    returns

    a per-method filtered ServiceIface

    Attributes
    protected
    See also

    com.twitter.inject.thrift.filters.ThriftClientFilterChain

  53. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  54. def flag[T](name: String, help: String)(implicit arg0: Flaggable[T], arg1: Manifest[T]): Flag[T]
    Attributes
    protected
    Definition Classes
    TwitterModuleFlags
  55. def flag[T](name: String, default: T, help: String)(implicit arg0: Flaggable[T]): Flag[T]
    Attributes
    protected
    Definition Classes
    TwitterModuleFlags
  56. val flags: ArrayBuffer[Flag[_]]
    Attributes
    protected[com.twitter.inject]
    Definition Classes
    TwitterModuleFlags
  57. val frameworkModules: Seq[TwitterModule]
    Definition Classes
    FilteredThriftClientModule → TwitterBaseModule
  58. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  59. def getMembersInjector[T](arg0: TypeLiteral[T]): MembersInjector[T]
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  60. def getMembersInjector[T](arg0: Class[T]): MembersInjector[T]
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  61. def getProvider[T](implicit arg0: Manifest[T]): Provider[T]
    Attributes
    protected
    Definition Classes
    TwitterModule
  62. def getProvider[T](arg0: Class[T]): Provider[T]
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  63. def getProvider[T](arg0: Key[T]): Provider[T]
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  64. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  65. def info(marker: Marker, message: ⇒ Any, cause: Throwable): Unit
    Attributes
    protected[this]
    Definition Classes
    Logging
  66. def info(message: ⇒ Any, cause: Throwable): Unit
    Attributes
    protected[this]
    Definition Classes
    Logging
  67. def info(marker: Marker, message: ⇒ Any): Unit
    Attributes
    protected[this]
    Definition Classes
    Logging
  68. def info(message: ⇒ Any): Unit
    Attributes
    protected[this]
    Definition Classes
    Logging
  69. def infoResult[T](message: ⇒ String)(fn: ⇒ T): T
    Attributes
    protected[this]
    Definition Classes
    Logging
  70. def install(module: Module): Unit
    Attributes
    protected
    Definition Classes
    TwitterModule → AbstractModule
  71. def isDebugEnabled(marker: Marker): Boolean
    Attributes
    protected[this]
    Definition Classes
    Logging
  72. def isDebugEnabled: Boolean
    Attributes
    protected[this]
    Definition Classes
    Logging
  73. def isErrorEnabled(marker: Marker): Boolean
    Attributes
    protected[this]
    Definition Classes
    Logging
  74. def isErrorEnabled: Boolean
    Attributes
    protected[this]
    Definition Classes
    Logging
  75. def isInfoEnabled(marker: Marker): Boolean
    Attributes
    protected[this]
    Definition Classes
    Logging
  76. def isInfoEnabled: Boolean
    Attributes
    protected[this]
    Definition Classes
    Logging
  77. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  78. def isTraceEnabled(marker: Marker): Boolean
    Attributes
    protected[this]
    Definition Classes
    Logging
  79. def isTraceEnabled: Boolean
    Attributes
    protected[this]
    Definition Classes
    Logging
  80. def isWarnEnabled(marker: Marker): Boolean
    Attributes
    protected[this]
    Definition Classes
    Logging
  81. def isWarnEnabled: Boolean
    Attributes
    protected[this]
    Definition Classes
    Logging
  82. def javaModules: Collection[Module]
    Attributes
    protected[com.twitter.inject]
    Definition Classes
    TwitterBaseModule
  83. final def logger: Logger
    Attributes
    protected[this]
    Definition Classes
    Logging
  84. final def loggerName: String
    Attributes
    protected[this]
    Definition Classes
    Logging
  85. def modules: Seq[Module]
    Attributes
    protected[com.twitter.inject]
    Definition Classes
    TwitterBaseModule
  86. def monitor: Monitor

    Function to add a user-defined Monitor, c.t.finagle.DefaultMonitor will be installed implicitly which handles all exceptions caught in stack.

    Function to add a user-defined Monitor, c.t.finagle.DefaultMonitor will be installed implicitly which handles all exceptions caught in stack. Exceptions aren't handled by user-defined monitor propagated to the default monitor.

    NullMonitor has no influence on DefaultMonitor behavior here

    Attributes
    protected
  87. val mux: Boolean

    Enable thrift mux for this connection.

    Enable thrift mux for this connection.

    Note: Both server and client must have mux enabled otherwise a nondescript ChannelClosedException will be seen.

    Attributes
    protected
    See also

    What is ThriftMux?

  88. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  89. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  90. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  91. final def providesClient(timeoutMultiplier: Int, retryMultiplier: Int, serviceIface: ServiceIface, injector: Injector, statsReceiver: StatsReceiver, andThenService: AndThenService): FutureIface
    Annotations
    @Provides() @Singleton()
  92. final def providesUnfilteredServiceIface(timeoutMultiplier: Int, clientId: ClientId, statsReceiver: StatsReceiver): ServiceIface
    Annotations
    @Provides() @NonFiltered() @Singleton()
  93. def requestInjection(arg0: Any): Unit
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  94. def requestStaticInjection(arg0: <repeated...>[Class[_]]): Unit
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
    Annotations
    @transient()
  95. def requireBinding(arg0: Class[_]): Unit
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  96. def requireBinding(arg0: Key[_]): Unit
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  97. def sessionAcquisitionTimeout: Duration

    Configures the session acquisition timeout of this client (default: unbounded).

    Configures the session acquisition timeout of this client (default: unbounded).

    returns

    an com.twitter.util.Duration which represents the acquisition timeout

    Attributes
    protected
    See also

    com.twitter.finagle.param.ClientSessionParams#acquisitionTimeout

    https://twitter.github.io/finagle/guide/Clients.html#timeouts-expiration

  98. def singletonPostWarmupComplete(injector: Injector): Unit
    Attributes
    protected[com.twitter.inject]
    Definition Classes
    TwitterModuleLifecycle
  99. def singletonShutdown(injector: Injector): Unit
    Attributes
    protected[com.twitter.inject]
    Definition Classes
    TwitterModuleLifecycle
  100. def singletonStartup(injector: Injector): Unit
    Attributes
    protected[com.twitter.inject]
    Definition Classes
    TwitterModuleLifecycle
  101. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  102. def time[T](formatStr: String)(func: ⇒ T): T
    Attributes
    protected
    Definition Classes
    Logging
  103. def toString(): String
    Definition Classes
    AnyRef → Any
  104. def trace(marker: Marker, message: ⇒ Any, cause: Throwable): Unit
    Attributes
    protected[this]
    Definition Classes
    Logging
  105. def trace(message: ⇒ Any, cause: Throwable): Unit
    Attributes
    protected[this]
    Definition Classes
    Logging
  106. def trace(marker: Marker, message: ⇒ Any): Unit
    Attributes
    protected[this]
    Definition Classes
    Logging
  107. def trace(message: ⇒ Any): Unit
    Attributes
    protected[this]
    Definition Classes
    Logging
  108. def traceResult[T](message: ⇒ String)(fn: ⇒ T): T
    Attributes
    protected[this]
    Definition Classes
    Logging
  109. val useHighResTimerForRetries: Boolean

    Use a high resolution com.twitter.util.Timer such that retries are run tighter to their schedule.

    Use a high resolution com.twitter.util.Timer such that retries are run tighter to their schedule. Default: false.

    Note: There are performance implications to enabling.

    Attributes
    protected
  110. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  111. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  112. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  113. def warn(marker: Marker, message: ⇒ Any, cause: Throwable): Unit
    Attributes
    protected[this]
    Definition Classes
    Logging
  114. def warn(message: ⇒ Any, cause: Throwable): Unit
    Attributes
    protected[this]
    Definition Classes
    Logging
  115. def warn(marker: Marker, message: ⇒ Any): Unit
    Attributes
    protected[this]
    Definition Classes
    Logging
  116. def warn(message: ⇒ Any): Unit
    Attributes
    protected[this]
    Definition Classes
    Logging
  117. def warnResult[T](message: ⇒ String)(fn: ⇒ T): T
    Attributes
    protected[this]
    Definition Classes
    Logging

Inherited from TwitterModule

Inherited from TwitterBaseModule

Inherited from TwitterModuleLifecycle

Inherited from Logging

Inherited from util.logging.Logging

Inherited from TwitterModuleFlags

Inherited from AbstractModule

Inherited from Module

Inherited from AnyRef

Inherited from Any

Ungrouped