package thrift


Please use the new interface, com.twitter.finagle.Thrift, for constructing thrift clients and servers.

Thrift codecs

We provide both framed and buffered client protocol support, and server support for the framed protocol. The public implementations are:

The type of the server codec is Service[Array[Byte], Array[Byte]] and the client codecs are Service[ThriftClientRequest, Array[Byte]]. The service provided is that of a "transport" of thrift messages (requests and replies) according to the protocol chosen. This is why the client codecs need to have access to a thrift ProtocolFactory.

These transports are used by the services produced by the finagle thrift codegenerator.

val service: Service[ThriftClientRequest, Array[Byte]] = ClientBuilder()

// Wrap the raw Thrift transport in a Client decorator. The client
// provides a convenient procedural interface for accessing the Thrift
// server.
val client = new Hello.ServiceToClient(service, protocolFactory)

In this example, Hello is the thrift interface, and the inner class ServiceToClient is provided by the finagle thrift code generator.

Linear Supertypes
AnyRef, Any
  1. Alphabetic
  2. By inheritance
  1. thrift
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
  1. Public
  2. All

Type Members

  1. case class ClientId(name: String) extends Product with Serializable

  2. class ClientIdRequiredFilter[Req, Rep] extends SimpleFilter[Req, Rep]

    A com.twitter.finagle.Filter for Thrift services that enforces all requests specify a com.twitter.finagle.thrift.ClientId.

  3. case class InvalidThriftConnectionException() extends Exception with ServiceException with Product with Serializable

    Indicates that the connection on which a Thrift request was issued is invalid, where "validity" is determined by com.twitter.finagle.thrift.ValidateThriftService.

  4. trait MethodIfaceBuilder[ServiceIface, MethodIface] extends AnyRef

    A typeclass to construct a MethodIface by wrapping a ServiceIface.

  5. class NoClientIdSpecifiedException extends RequestException

    Indicates that a request without a com.twitter.finagle.thrift.ClientId was issued to a server that requires them.

  6. class SeqIdFilter extends SimpleFilter[ThriftClientRequest, Array[Byte]]

    A com.twitter.finagle.Filter that overrides Thrift request sequence IDs, replacing them with our own randomly-assigned i32s.

  7. case class SeqMismatchException(id: Int, expected: Int) extends TransportException with Product with Serializable

    Indicates that a Thrift response did not have the correct sequence ID according to that assigned by com.twitter.finagle.thrift.SeqIdFilter on the corresponding request.

  8. trait ServiceIfaceBuilder[ServiceIface] extends AnyRef

    Typeclass ServiceIfaceBuilder[T] creates T-typed interfaces from thrift clients.

  9. class ThriftCall[A <: TBase[_, _], R <: TBase[_, _]] extends AnyRef

    The ThriftCall object represents a thrift dispatch on the channel.

  10. class ThriftCallFactory[A <: TBase[_, _], R <: TBase[_, _]] extends AnyRef

  11. class ThriftClientBufferedCodec extends ThriftClientFramedCodec

  12. class ThriftClientBufferedCodecFactory extends (ClientCodecConfig) ⇒ Codec[ThriftClientRequest, Array[Byte]]

  13. class ThriftClientFramedCodec extends Codec[ThriftClientRequest, Array[Byte]]

  14. class ThriftClientFramedCodecFactory extends (ClientCodecConfig) ⇒ Codec[ThriftClientRequest, Array[Byte]]

  15. class ThriftClientRequest extends AnyRef

  16. case class ThriftMethodStats(requestsCounter: Counter, successCounter: Counter, failuresCounter: Counter, failuresScope: StatsReceiver) extends Product with Serializable

  17. case class ThriftReply[R <: TBase[_, _]](response: R, call: ThriftCall[_ <: TBase[_, _], _ <: TBase[_, _]]) extends Product with Serializable

    Encapsulates the result of a call to a Thrift service.

  18. class ThriftServerBufferedCodec extends ThriftServerFramedCodec

  19. class ThriftServerBufferedCodecFactory extends (ServerCodecConfig) ⇒ Codec[Array[Byte], Array[Byte]]

  20. class ThriftServerFramedCodec extends Codec[Array[Byte], Array[Byte]]

  21. class ThriftServerFramedCodecFactory extends (ServerCodecConfig) ⇒ Codec[Array[Byte], Array[Byte]]

  22. class ValidateThriftService extends ServiceProxy[ThriftClientRequest, Array[Byte]]

    A filter that invalidates a connection if it suffers from an irrecoverable application exception.

Value Members

  1. object ClientId extends Serializable

    ClientId provides the client identification of the incoming request if available.

  2. object InputBuffers

  3. object Protocols

  4. object SeqIdFilter

  5. object ThriftClientBufferedCodec

    ThriftClientBufferedCodec implements a buffered thrift transport that supports upgrading in order to provide TraceContexts across requests.

  6. object ThriftClientFramedCodec

    ThriftClientFramedCodec implements a framed thrift transport that supports upgrading in order to provide TraceContexts across requests.

  7. object ThriftMethodStats extends Serializable

  8. object ThriftServerBufferedCodec

    ThriftServerBufferedCodec implements a buffered thrift transport.

  9. object ThriftServerFramedCodec

  10. object ThriftServiceIface

    Construct Service interface for a thrift method.

  11. object ThriftTypes extends HashMap[String, ThriftCallFactory[_, _]]

    A registry for Thrift types.

  12. object maxReusableBufferSize extends GlobalFlag[StorageUnit]

  13. package thrift

Inherited from AnyRef

Inherited from Any