Packages

  • package root
    Definition Classes
    root
  • package com
    Definition Classes
    root
  • package twitter
    Definition Classes
    com
  • package finagle
    Definition Classes
    twitter
  • object ThriftMux extends Client[ThriftClientRequest, Array[Byte]] with Server[Array[Byte], Array[Byte]]

    The ThriftMux object is both a com.twitter.finagle.Client and a com.twitter.finagle.Server for the Thrift protocol served over com.twitter.finagle.mux.

    The ThriftMux object is both a com.twitter.finagle.Client and a com.twitter.finagle.Server for the Thrift protocol served over com.twitter.finagle.mux. Rich interfaces are provided to adhere to those generated from a Thrift IDL by Scrooge or thrift-finagle.

    Clients

    Clients can be created directly from an interface generated from a Thrift IDL:

    For example, this IDL:

    service TestService {
      string query(1: string x)
    }

    compiled with Scrooge, generates the interface TestService.MethodPerEndpoint. This is then passed into ThriftMux.Client.build:

    ThriftMux.client.build[TestService.MethodPerEndpoint](
      addr, classOf[TestService.MethodPerEndpoint])

    However note that the Scala compiler can insert the latter Class for us, for which another variant of build is provided:

    ThriftMux.client.build[TestService.MethodPerEndpoint](addr)

    In Java, we need to provide the class object:

    TestService.MethodPerEndpoint client =
      ThriftMux.client.build(addr, TestService.MethodPerEndpoint.class);

    Servers

    Servers are also simple to expose:

    TestService.MethodPerEndpoint must be implemented and passed into serveIface:

    // An echo service
    ThriftMux.server.serveIface(":*", new TestService.MethodPerEndpoint {
      def query(x: String): Future[String] = Future.value(x)
    })

    This object does not expose any configuration options. Both clients and servers are instantiated with sane defaults. Clients are labeled with the "clnt/thrift" prefix and servers with "srv/thrift". If you'd like more configuration, see the configuration documentation.

    Definition Classes
    finagle
  • Client
  • Server

case class Client(muxer: StackClient[Request, Response] = Client.standardMuxer) extends StackBasedClient[ThriftClientRequest, Array[Byte]] with Parameterized[Client] with Transformable[Client] with CommonParams[Client] with ClientParams[Client] with WithClientTransport[Client] with WithClientAdmissionControl[Client] with WithClientSession[Client] with WithSessionQualifier[Client] with WithDefaultLoadBalancer[Client] with WithThriftPartitioningStrategy[Client] with ThriftRichClient with OpportunisticTlsParams[Client] with WithCompressionPreferences[Client] with Product with Serializable

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Client
  2. Serializable
  3. Product
  4. Equals
  5. WithCompressionPreferences
  6. OpportunisticTlsParams
  7. ThriftRichClient
  8. WithThriftPartitioningStrategy
  9. WithDefaultLoadBalancer
  10. WithSessionQualifier
  11. WithClientSession
  12. WithClientAdmissionControl
  13. WithClientTransport
  14. ClientParams
  15. CommonParams
  16. StackBasedClient
  17. Transformable
  18. Parameterized
  19. Client
  20. AnyRef
  21. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new Client(muxer: StackClient[Request, Response] = Client.standardMuxer)

Type Members

  1. class MultiplexedThriftClient extends AnyRef
    Definition Classes
    ThriftRichClient

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. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def build[ThriftServiceType](name: Name, label: String, cls: Class[_], clientParam: RichClientParam, service: Service[ThriftClientRequest, Array[Byte]]): ThriftServiceType
    Definition Classes
    ThriftRichClient
  6. def build[ThriftServiceType](name: Name, label: String, cls: Class[_]): ThriftServiceType
    Definition Classes
    ThriftRichClient
  7. def build[ThriftServiceType](dest: Name, label: String)(implicit arg0: ClassTag[ThriftServiceType]): ThriftServiceType
    Definition Classes
    ThriftRichClient
  8. def build[ThriftServiceType](dest: String, label: String)(implicit arg0: ClassTag[ThriftServiceType]): ThriftServiceType
    Definition Classes
    ThriftRichClient
  9. def build[ThriftServiceType](dest: String)(implicit arg0: ClassTag[ThriftServiceType]): ThriftServiceType
    Definition Classes
    ThriftRichClient
  10. def build[ThriftServiceType](dest: String, label: String, cls: Class[_]): ThriftServiceType
    Definition Classes
    ThriftRichClient
  11. def build[ThriftServiceType](dest: String, cls: Class[_]): ThriftServiceType
    Definition Classes
    ThriftRichClient
  12. val clientParam: RichClientParam
    Attributes
    protected
    Definition Classes
    Client → ThriftRichClient
  13. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  14. def configured[P](psp: (P, Param[P])): Client
    Definition Classes
    Client → Parameterized
  15. def configured[P](p: P)(implicit sp: Param[P]): Client
    Definition Classes
    Parameterized
  16. def configuredParams(newParams: Params): Client
    Definition Classes
    Parameterized
  17. lazy val defaultClientName: String
    Attributes
    protected
    Definition Classes
    Client → ThriftRichClient
  18. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. def filtered(filter: Filter[Request, Response, Request, Response]): Client

    Prepends filter to the top of the client.

    Prepends filter to the top of the client. That is, after materializing the client (newClient/newService) filter will be the first element which requests flow through. This is a familiar chaining combinator for filters.

  20. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  21. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  22. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  23. def methodBuilder(dest: Name): MethodBuilder

    Create a thriftmux.MethodBuilder for a given destination.

    Create a thriftmux.MethodBuilder for a given destination.

    See also

    user guide

  24. def methodBuilder(dest: String): MethodBuilder

    Create a thriftmux.MethodBuilder for a given destination.

    Create a thriftmux.MethodBuilder for a given destination.

    See also

    user guide

  25. def multiplex[T](dest: String, label: String)(build: (MultiplexedThriftClient) => T): T
    Definition Classes
    ThriftRichClient
  26. def multiplex[T](dest: Name, label: String)(build: (MultiplexedThriftClient) => T): T
    Definition Classes
    ThriftRichClient
  27. val muxer: StackClient[Request, Response]
  28. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  29. def newClient(dest: Name, label: String): ServiceFactory[ThriftClientRequest, Array[Byte]]
    Definition Classes
    Client → Client
  30. final def newClient(dest: String, label: String): ServiceFactory[ThriftClientRequest, Array[Byte]]
    Definition Classes
    Client
  31. final def newClient(dest: String): ServiceFactory[ThriftClientRequest, Array[Byte]]
    Definition Classes
    Client
  32. def newService(dest: Name, label: String): Service[ThriftClientRequest, Array[Byte]]
    Definition Classes
    Client → Client
  33. final def newService(dest: String, label: String): Service[ThriftClientRequest, Array[Byte]]
    Definition Classes
    Client
  34. final def newService(dest: String): Service[ThriftClientRequest, Array[Byte]]
    Definition Classes
    Client
  35. def newServicePerEndpoint[ServicePerEndpoint <: Filterable[ServicePerEndpoint]](service: Service[ThriftClientRequest, Array[Byte]], label: String)(implicit builder: ServicePerEndpointBuilder[ServicePerEndpoint]): ServicePerEndpoint
    Attributes
    protected
    Definition Classes
    ThriftRichClient
  36. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  37. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  38. def params: Params
    Definition Classes
    Client → Parameterized
  39. def productElementNames: Iterator[String]
    Definition Classes
    Product
  40. def servicePerEndpoint[ServicePerEndpoint <: Filterable[ServicePerEndpoint]](dest: Name, label: String)(implicit builder: ServicePerEndpointBuilder[ServicePerEndpoint]): ServicePerEndpoint
    Definition Classes
    ThriftRichClient
  41. def servicePerEndpoint[ServicePerEndpoint <: Filterable[ServicePerEndpoint]](dest: String, label: String)(implicit builder: ServicePerEndpointBuilder[ServicePerEndpoint]): ServicePerEndpoint
    Definition Classes
    ThriftRichClient
  42. def stack: Stack[ServiceFactory[Request, Response]]
  43. def stats: StatsReceiver
    Attributes
    protected
    Definition Classes
    ThriftRichClient
  44. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  45. def transformed(t: Transformer): Client
    Definition Classes
    Client → Transformable
  46. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  47. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  48. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  49. val withAdmissionControl: ClientAdmissionControlParams[Client]
    Definition Classes
    Client → WithClientAdmissionControl
  50. def withClientId(clientId: ClientId): Client

    Produce a com.twitter.finagle.ThriftMux.Client using the provided client ID.

  51. val withCompressionPreferences: CompressionParams[Client]
    Definition Classes
    WithCompressionPreferences
  52. def withExceptionStatsHandler(exceptionStatsHandler: ExceptionStatsHandler): Client
    Definition Classes
    Client → CommonParams
  53. def withExecutionOffloaded(pool: FuturePool): Client
    Definition Classes
    Client → CommonParams
  54. def withExecutionOffloaded(executor: ExecutorService): Client
    Definition Classes
    Client → CommonParams
  55. def withLabel(label: String): Client
    Definition Classes
    Client → CommonParams
  56. def withLabels(keywords: String*): Client
    Definition Classes
    CommonParams
  57. val withLoadBalancer: DefaultLoadBalancingParams[Client]
    Definition Classes
    Client → WithDefaultLoadBalancer
  58. def withMaxReusableBufferSize(size: Int): Client

    Produce a com.twitter.finagle.ThriftMux.Client with the specified max size of the reusable buffer for thrift responses.

    Produce a com.twitter.finagle.ThriftMux.Client with the specified max size of the reusable buffer for thrift responses. If this size is exceeded, the buffer is not reused and a new buffer is allocated for the next thrift response. The default max size is 16Kb.

    size

    Max size of the reusable buffer for thrift responses in bytes.

    Note

    MaxReusableBufferSize will be ignored if TReusableBufferFactory is set.

  59. def withMonitor(monitor: Monitor): Client
    Definition Classes
    Client → CommonParams
  60. def withNoOpportunisticTls: Client
    Definition Classes
    Client → OpportunisticTlsParams
  61. def withOpportunisticTls(level: Level): Client
    Definition Classes
    Client → OpportunisticTlsParams
  62. def withParams(ps: Params): Client
    Definition Classes
    Client → Parameterized
  63. val withPartitioning: PartitioningParams[Client]
    Definition Classes
    Client → WithThriftPartitioningStrategy
  64. def withPerEndpointStats: Client

    Produce a com.twitter.finagle.ThriftMux.Client with per-endpoint stats filters

  65. def withProtocolFactory(pf: TProtocolFactory): Client

    Produce a com.twitter.finagle.ThriftMux.Client using the provided protocolFactory.

  66. def withRequestTimeout(timeout: Duration): Client
    Definition Classes
    Client → CommonParams
  67. def withRequestTimeout(timeout: Tunable[Duration]): Client
    Definition Classes
    CommonParams
  68. def withResponseClassifier(responseClassifier: ResponseClassifier): Client
    Definition Classes
    Client → CommonParams
  69. def withRetryBackoff(backoff: Backoff): Client
    Definition Classes
    Client → ClientParams
  70. def withRetryBudget(budget: RetryBudget): Client
    Definition Classes
    Client → ClientParams
  71. def withServiceClass(clazz: Class[_]): Client

    Configure the service class that may be used with this client to collect instrumentation metadata.

    Configure the service class that may be used with this client to collect instrumentation metadata. This is not necessary to run a service.

    Note

    that when using the .build methods this is unnecessary.

  72. val withSession: ClientSessionParams[Client]
    Definition Classes
    Client → WithClientSession
  73. val withSessionQualifier: SessionQualificationParams[Client]
    Definition Classes
    Client → WithSessionQualifier
  74. def withStack(fn: (Stack[ServiceFactory[Request, Response]]) => Stack[ServiceFactory[Request, Response]]): Client
  75. def withStack(stack: Stack[ServiceFactory[Request, Response]]): Client

    Produce a com.twitter.finagle.ThriftMux.Client using the provided stack.

  76. def withStatsReceiver(statsReceiver: StatsReceiver): Client
    Definition Classes
    Client → CommonParams
  77. def withTReusableBufferFactory(tReusableBufferFactory: () => TReusableBuffer): Client

    Produce a com.twitter.finagle.ThriftMux.Client with a factory creates new TReusableBuffer, the TReusableBuffer can be shared with other client instance.

    Produce a com.twitter.finagle.ThriftMux.Client with a factory creates new TReusableBuffer, the TReusableBuffer can be shared with other client instance. If set, the MaxReusableBufferSize will be ignored.

  78. def withTracer(tracer: Tracer): Client
    Definition Classes
    Client → CommonParams
  79. val withTransport: ClientTransportParams[Client]
    Definition Classes
    Client → WithClientTransport

Deprecated Value Members

  1. def newIface[Iface](name: Name, label: String, cls: Class[_], protocolFactory: TProtocolFactory, service: Service[ThriftClientRequest, Array[Byte]]): Iface
    Definition Classes
    ThriftRichClient
    Annotations
    @deprecated
    Deprecated

    (Since version 2017-8-16) Use com.twitter.finagle.thrift.RichClientParam

  2. def newIface[Iface](name: Name, label: String, cls: Class[_], clientParam: RichClientParam, service: Service[ThriftClientRequest, Array[Byte]]): Iface
    Definition Classes
    ThriftRichClient
    Annotations
    @deprecated
    Deprecated

    (Since version 2017-11-20) Use com.twitter.finagle.ThriftRichClient#build

  3. def newIface[Iface](name: Name, label: String, cls: Class[_]): Iface
    Definition Classes
    ThriftRichClient
    Annotations
    @deprecated
    Deprecated

    (Since version 2017-11-20) Use com.twitter.finagle.ThriftRichClient#build

  4. def newIface[Iface](dest: Name, label: String)(implicit arg0: ClassTag[Iface]): Iface
    Definition Classes
    ThriftRichClient
    Annotations
    @deprecated
    Deprecated

    (Since version 2017-11-20) Use com.twitter.finagle.ThriftRichClient#build

  5. def newIface[Iface](dest: String, label: String)(implicit arg0: ClassTag[Iface]): Iface
    Definition Classes
    ThriftRichClient
    Annotations
    @deprecated
    Deprecated

    (Since version 2017-11-20) Use com.twitter.finagle.ThriftRichClient#build

  6. def newIface[Iface](dest: String)(implicit arg0: ClassTag[Iface]): Iface
    Definition Classes
    ThriftRichClient
    Annotations
    @deprecated
    Deprecated

    (Since version 2017-11-20) Use com.twitter.finagle.ThriftRichClient#build

  7. def newIface[Iface](dest: String, label: String, cls: Class[_]): Iface
    Definition Classes
    ThriftRichClient
    Annotations
    @deprecated
    Deprecated

    (Since version 2017-11-20) Use com.twitter.finagle.ThriftRichClient#build

  8. def newIface[Iface](dest: String, cls: Class[_]): Iface
    Definition Classes
    ThriftRichClient
    Annotations
    @deprecated
    Deprecated

    (Since version 2017-11-20) Use com.twitter.finagle.ThriftRichClient#build

  9. def newServiceIface[ServiceIface <: Filterable[ServiceIface]](dest: Name, label: String)(implicit builder: ServiceIfaceBuilder[ServiceIface]): ServiceIface
    Definition Classes
    ThriftRichClient
    Annotations
    @deprecated
    Deprecated

    (Since version 2017-11-13) Use com.twitter.finagle.ThriftRichClient#servicePerEndpoint[ServicePerEndpoint]

  10. def newServiceIface[ServiceIface <: Filterable[ServiceIface]](dest: String, label: String)(implicit builder: ServiceIfaceBuilder[ServiceIface]): ServiceIface
    Definition Classes
    ThriftRichClient
    Annotations
    @deprecated
    Deprecated

    (Since version 2017-11-13) Use com.twitter.finagle.ThriftRichClient#servicePerEndpoint[ServicePerEndpoint]

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from ThriftRichClient

Inherited from WithClientSession[Client]

Inherited from WithClientTransport[Client]

Inherited from ClientParams[Client]

Inherited from CommonParams[Client]

Inherited from Transformable[Client]

Inherited from Parameterized[Client]

Inherited from AnyRef

Inherited from Any

Ungrouped