Trait

com.twitter.finagle.thrift

ThriftRichClient

Related Doc: package thrift

Permalink

trait ThriftRichClient extends AnyRef

A mixin trait to provide a rich Thrift client API.

Self Type
ThriftRichClient with Client[ThriftClientRequest, Array[Byte]]
Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ThriftRichClient
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. class MultiplexedThriftClient extends AnyRef

    Permalink

Abstract Value Members

  1. abstract val clientParam: RichClientParam

    Permalink
    Attributes
    protected
  2. abstract val defaultClientName: String

    Permalink

    The client name used when group isn't named.

    The client name used when group isn't named.

    Attributes
    protected
  3. abstract def params: Params

    Permalink

    The Stack.Params to be used by this client.

    The Stack.Params to be used by this client.

    Both defaultClientName and stats predate Stack.Params and as such are implemented separately.

    Attributes
    protected

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def build[ThriftServiceType](name: Name, label: String, cls: Class[_], clientParam: RichClientParam, service: Service[ThriftClientRequest, Array[Byte]]): ThriftServiceType

    Permalink

    Create a new client of type ThriftServiceType, which must be generated by Scrooge.

    Create a new client of type ThriftServiceType, which must be generated by Scrooge.

    For Scala generated code, the Class passed in should be either ServiceName$MethodPerEndpoint or ServiceName[Future].

    For Java generated code, the Class passed in should be ServiceName$ServiceIface.

  6. def build[ThriftServiceType](name: Name, label: String, cls: Class[_]): ThriftServiceType

    Permalink

    Create a new client of type ThriftServiceType, which must be generated by Scrooge.

    Create a new client of type ThriftServiceType, which must be generated by Scrooge.

    For Scala generated code, the Class passed in should be either ServiceName$MethodPerEndpoint or ServiceName[Future].

    For Java generated code, the Class passed in should be ServiceName$ServiceIface.

  7. def build[ThriftServiceType](dest: Name, label: String)(implicit arg0: ClassTag[ThriftServiceType]): ThriftServiceType

    Permalink

    Create a new client of type ThriftServiceType, which must be generated by Scrooge.

    Create a new client of type ThriftServiceType, which must be generated by Scrooge.

    For Scala generated code, the Class passed in should be either ServiceName$MethodPerEndpoint or ServiceName[Future].

    For Java generated code, the Class passed in should be ServiceName$ServiceIface.

  8. def build[ThriftServiceType](dest: String, label: String)(implicit arg0: ClassTag[ThriftServiceType]): ThriftServiceType

    Permalink

    Create a new client of type ThriftServiceType, which must be generated by Scrooge.

    Create a new client of type ThriftServiceType, which must be generated by Scrooge.

    For Scala generated code, the Class passed in should be either ServiceName$MethodPerEndpoint or ServiceName[Future].

    For Java generated code, the Class passed in should be ServiceName$ServiceIface.

  9. def build[ThriftServiceType](dest: String)(implicit arg0: ClassTag[ThriftServiceType]): ThriftServiceType

    Permalink

    Create a new client of type ThriftServiceType, which must be generated by Scrooge.

    Create a new client of type ThriftServiceType, which must be generated by Scrooge.

    For Scala generated code, the Class passed in should be either ServiceName$MethodPerEndpoint or ServiceName[Future].

    For Java generated code, the Class passed in should be ServiceName$ServiceIface.

  10. def build[ThriftServiceType](dest: String, label: String, cls: Class[_]): ThriftServiceType

    Permalink

    Create a new client of type ThriftServiceType, which must be generated by Scrooge.

    Create a new client of type ThriftServiceType, which must be generated by Scrooge.

    For Scala generated code, the Class passed in should be either ServiceName$MethodPerEndpoint or ServiceName[Future].

    For Java generated code, the Class passed in should be ServiceName$ServiceIface.

  11. def build[ThriftServiceType](dest: String, cls: Class[_]): ThriftServiceType

    Permalink

    Create a new client of type ThriftServiceType, which must be generated by Scrooge.

    Create a new client of type ThriftServiceType, which must be generated by Scrooge.

    For Scala generated code, the Class passed in should be either ServiceName$MethodPerEndpoint or ServiceName[Future].

    For Java generated code, the Class passed in should be ServiceName$ServiceIface.

  12. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  13. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  15. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  17. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  18. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  19. def multiplex[T](dest: String, label: String)(build: ((ThriftRichClient.this)#MultiplexedThriftClient) ⇒ T): T

    Permalink

    Build client interfaces for multiplexed thrift services.

    Build client interfaces for multiplexed thrift services.

    E.g.

    val client = Thrift.client.multiplex(address, "client") { client =>
      new {
        val echo = client.newIface[Echo.FutureIface]("echo")
        val extendedEcho = client.newServiceIface[ExtendedEcho.ServiceIface]("extendedEcho")
      }
    }
    
    client.echo.echo("hello")
    client.extendedEcho.getStatus(ExtendedEcho.GetStatus.Args())
  20. def multiplex[T](dest: Name, label: String)(build: ((ThriftRichClient.this)#MultiplexedThriftClient) ⇒ T): T

    Permalink

    Build client interfaces for multiplexed thrift services.

    Build client interfaces for multiplexed thrift services.

    E.g.

    val client = Thrift.client.multiplex(address, "client") { client =>
      new {
        val echo = client.newIface[Echo.FutureIface]("echo")
        val extendedEcho = client.newServiceIface[ExtendedEcho.ServiceIface]("extendedEcho")
      }
    }
    
    client.echo.echo("hello")
    client.extendedEcho.getStatus(ExtendedEcho.GetStatus.Args())
  21. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  22. def newServicePerEndpoint[ServicePerEndpoint <: Filterable[ServicePerEndpoint]](service: Service[ThriftClientRequest, Array[Byte]], label: String)(implicit builder: ServicePerEndpointBuilder[ServicePerEndpoint]): ServicePerEndpoint

    Permalink

    Construct a Finagle Service interface for a Scrooge-generated Thrift object.

    Construct a Finagle Service interface for a Scrooge-generated Thrift object.

    E.g. given a Thrift service

    service Logger {
      string log(1: string message, 2: i32 logLevel);
      i32 getLogSize();
    }

    you can construct a client interface with a Finagle Service per Thrift method:

    val loggerService: Logger.ServicePerEndpoint = Thrift.client.servicePerEndpoint[Logger.ServicePerEndpoint]("localhost:8000", "client_label")
    val response: String = loggerService.log(Logger.Log.Args("log message", 1))

    You can also create a Finagle Service[scrooge.Request, scrooge.Response] per-endpoint (method) for a Scrooge-generated Thrift object.

    E.g. given a Thrift service

    service Logger {
      string log(1: string message, 2: i32 logLevel);
      i32 getLogSize();
    }

    you can construct a client interface with a Finagle Service per Thrift method that uses the Scrooge Request/Response envelopes:

    val loggerService: Logger.ReqRepServicePerEndpoint = Thrift.client.servicePerEndpoint[Logger.ReqRepServicePerEndpoint]("localhost:8000", "client_label")
    val response: c.t.scrooge.Response[String] = loggerService.log(c.t.scrooge.Request(Logger.Log.Args("log message", 1)))

    This allows you to access any contained c.t.scrooge.Request and c.t.scrooge.Response headers.

    service

    The Finagle Service to be used.

    label

    Assign a label for scoped stats.

    builder

    The builder type is generated by Scrooge for a thrift service.

    Attributes
    protected
  23. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  24. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  25. def servicePerEndpoint[ServicePerEndpoint <: Filterable[ServicePerEndpoint]](dest: Name, label: String)(implicit builder: ServicePerEndpointBuilder[ServicePerEndpoint]): ServicePerEndpoint

    Permalink

    Construct a Finagle Service interface for a Scrooge-generated Thrift object.

    Construct a Finagle Service interface for a Scrooge-generated Thrift object.

    E.g. given a Thrift service

    service Logger {
      string log(1: string message, 2: i32 logLevel);
      i32 getLogSize();
    }

    you can construct a client interface with a Finagle Service per Thrift method:

    val loggerService: Logger.ServicePerEndpoint = Thrift.client.servicePerEndpoint[Logger.ServicePerEndpoint]("localhost:8000", "client_label")
    val response: String = loggerService.log(Logger.Log.Args("log message", 1))

    You can also create a Finagle Service[scrooge.Request, scrooge.Response] per-endpoint (method) for a Scrooge-generated Thrift object.

    E.g. given a Thrift service

    service Logger {
      string log(1: string message, 2: i32 logLevel);
      i32 getLogSize();
    }

    you can construct a client interface with a Finagle Service per Thrift method that uses the Scrooge Request/Response envelopes:

    val loggerService: Logger.ReqRepServicePerEndpoint = Thrift.client.servicePerEndpoint[Logger.ReqRepServicePerEndpoint]("localhost:8000", "client_label")
    val response: c.t.scrooge.Response[String] = loggerService.log(c.t.scrooge.Request(Logger.Log.Args("log message", 1)))

    This allows you to access any contained c.t.scrooge.Request and c.t.scrooge.Response headers.

    dest

    Address of the service to connect to.

    label

    Assign a label for scoped stats.

    builder

    The builder type is generated by Scrooge for a thrift service.

  26. def servicePerEndpoint[ServicePerEndpoint <: Filterable[ServicePerEndpoint]](dest: String, label: String)(implicit builder: ServicePerEndpointBuilder[ServicePerEndpoint]): ServicePerEndpoint

    Permalink

    Construct a Finagle Service interface for a Scrooge-generated Thrift object.

    Construct a Finagle Service interface for a Scrooge-generated Thrift object.

    E.g. given a Thrift service

    service Logger {
      string log(1: string message, 2: i32 logLevel);
      i32 getLogSize();
    }

    you can construct a client interface with a Finagle Service per Thrift method:

    val loggerService: Logger.ServicePerEndpoint = Thrift.client.servicePerEndpoint[Logger.ServicePerEndpoint]("localhost:8000", "client_label")
    val response: String = loggerService.log(Logger.Log.Args("log message", 1))

    You can also create a Finagle Service[scrooge.Request, scrooge.Response] per-endpoint (method) for a Scrooge-generated Thrift object.

    E.g. given a Thrift service

    service Logger {
      string log(1: string message, 2: i32 logLevel);
      i32 getLogSize();
    }

    you can construct a client interface with a Finagle Service per Thrift method that uses the Scrooge Request/Response envelopes:

    val loggerService: Logger.ReqRepServicePerEndpoint = Thrift.client.servicePerEndpoint[Logger.ReqRepServicePerEndpoint]("localhost:8000", "client_label")
    val response: c.t.scrooge.Response[String] = loggerService.log(c.t.scrooge.Request(Logger.Log.Args("log message", 1)))

    This allows you to access any contained c.t.scrooge.Request and c.t.scrooge.Response headers.

    dest

    Address of the service to connect to, in the format accepted by Resolver.eval.

    label

    Assign a label for scoped stats.

    builder

    The builder type is generated by Scrooge for a thrift service.

  27. def stats: StatsReceiver

    Permalink
    Attributes
    protected
  28. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  29. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  30. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def newIface[Iface](name: Name, label: String, cls: Class[_], protocolFactory: TProtocolFactory, service: Service[ThriftClientRequest, Array[Byte]]): Iface

    Permalink
    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

    Permalink

    Create a new client of type Iface, which must be generated by Scrooge.

    Create a new client of type Iface, which must be generated by Scrooge.

    For Scala generated code, the Class passed in should be either ServiceName$FutureIface or ServiceName[Future].

    For Java generated code, the Class passed in should be ServiceName$ServiceIface.

    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

    Permalink

    Create a new client of type Iface, which must be generated by Scrooge.

    Create a new client of type Iface, which must be generated by Scrooge.

    For Scala generated code, the Class passed in should be either ServiceName$FutureIface or ServiceName[Future].

    For Java generated code, the Class passed in should be ServiceName$ServiceIface.

    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

    Permalink

    Create a new client of type Iface, which must be generated by Scrooge.

    Create a new client of type Iface, which must be generated by Scrooge.

    For Scala generated code, the Class passed in should be either ServiceName$FutureIface or ServiceName[Future].

    For Java generated code, the Class passed in should be ServiceName$ServiceIface.

    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

    Permalink

    Create a new client of type Iface, which must be generated by Scrooge.

    Create a new client of type Iface, which must be generated by Scrooge.

    For Scala generated code, the Class passed in should be either ServiceName$FutureIface or ServiceName[Future].

    For Java generated code, the Class passed in should be ServiceName$ServiceIface.

    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

    Permalink

    Create a new client of type Iface, which must be generated by Scrooge.

    Create a new client of type Iface, which must be generated by Scrooge.

    For Scala generated code, the Class passed in should be either ServiceName$FutureIface or ServiceName[Future].

    For Java generated code, the Class passed in should be ServiceName$ServiceIface.

    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

    Permalink

    Create a new client of type Iface, which must be generated by Scrooge.

    Create a new client of type Iface, which must be generated by Scrooge.

    For Scala generated code, the Class passed in should be either ServiceName$FutureIface or ServiceName[Future].

    For Java generated code, the Class passed in should be ServiceName$ServiceIface.

    Annotations
    @deprecated
    Deprecated

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

  8. def newIface[Iface](dest: String, cls: Class[_]): Iface

    Permalink

    Create a new client of type Iface, which must be generated by Scrooge.

    Create a new client of type Iface, which must be generated by Scrooge.

    For Scala generated code, the Class passed in should be either ServiceName$FutureIface or ServiceName[Future].

    For Java generated code, the Class passed in should be ServiceName$ServiceIface.

    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

    Permalink

    Construct a Finagle Service interface for a Scrooge-generated Thrift object.

    Construct a Finagle Service interface for a Scrooge-generated Thrift object.

    E.g. given a Thrift service

    service Logger {
      string log(1: string message, 2: i32 logLevel);
      i32 getLogSize();
    }

    you can construct a client interface with a Finagle Service per Thrift method:

    val loggerService: Logger.ServiceIface = Thrift.client.newServiceIface[Logger.ServiceIface]("localhost:8000", "client_label")
    val response: String = loggerService.log(Logger.Log.Args("log message", 1))
    dest

    Address of the service to connect to.

    label

    Assign a label for scoped stats.

    builder

    The builder type is generated by Scrooge for a thrift service.

    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

    Permalink

    Construct a Finagle Service interface for a Scrooge-generated Thrift object.

    Construct a Finagle Service interface for a Scrooge-generated Thrift object.

    E.g. given a Thrift service

    service Logger {
      string log(1: string message, 2: i32 logLevel);
      i32 getLogSize();
    }

    you can construct a client interface with a Finagle Service per Thrift method:

    val loggerService: Logger.ServiceIface = Thrift.client.newServiceIface[Logger.ServiceIface]("localhost:8000", "client_label")
    val response: String = loggerService.log(Logger.Log.Args("log message", 1))
    dest

    Address of the service to connect to, in the format accepted by Resolver.eval.

    label

    Assign a label for scoped stats.

    builder

    The builder type is generated by Scrooge for a thrift service.

    Annotations
    @deprecated
    Deprecated

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

Inherited from AnyRef

Inherited from Any

Ungrouped