Package

com.twitter

scrooge

Permalink

package scrooge

Visibility
  1. Public
  2. All

Type Members

  1. trait HasThriftStructCodec3[T <: ThriftStruct] extends AnyRef

    Permalink
  2. trait LazyTProtocol extends TProtocol

    Permalink

    An extension to the TProtocol to enable lazy reading

    An extension to the TProtocol to enable lazy reading

    Three main classes of operations are intended to be enabled here:

    1) Enable caching of a backing Array[Byte] so we can serialize quickly what we just deserialized if unchanged. 2) Enabling deferred string decoding, since string decoding is an expensive operation if we don't need the string large savings can be had avoiding this for all strings in our deserialization path. 3) Optional fields require boxing + allocations during deserialization for primitive types, this stores the offset to those types instead, doing a lazy instantiation of the Option when the field is first accessed.

  3. case class ProtocolException[In, Out](input: In, response: Buf, exception: TApplicationException) extends RichResponse[In, Out] with Product with Serializable

    Permalink

    A ProtocolException represents a response which throws a thrift application exception of protocol error.

    A ProtocolException represents a response which throws a thrift application exception of protocol error.

    exception

    a TApplicationException of protocol error

  4. sealed trait RichResponse[In, Out] extends AnyRef

    Permalink

    A RichResponse tells filters richer information of a response, including the corresponding request, intermediate forms of the response and final response in byte buffer.

    A RichResponse tells filters richer information of a response, including the corresponding request, intermediate forms of the response and final response in byte buffer.

    In

    type of the request

    Out

    intermediate form of the response

  5. case class SuccessfulResult[In, Out](input: In, response: Buf, result: Out) extends RichResponse[In, Out] with Product with Serializable

    Permalink

    A SuccessfulResult represents a successful response.

    A SuccessfulResult represents a successful response.

    result

    a result contains deserialized successful response

  6. final class TArrayByteTransport extends TTransport

    Permalink
  7. case class TFieldBlob(field: TField, content: Buf) extends Product with Serializable

    Permalink

    This class encapsulates a TField reference with a TCompactProtocol-encoded binary blob.

  8. class TLazyBinaryProtocol extends TBinaryProtocol with LazyTProtocol

    Permalink
  9. case class TReusableBuffer(initialSize: Int = 512, maxThriftBufferSize: Int = 16 * 1024) extends Product with Serializable

    Permalink

    This is a per-thread managed resource and must be reset after use

    This is a per-thread managed resource and must be reset after use

    import com.twitter.scrooge.TReusableBuffer
    
    class Example {
      private[this] val reusableBuffer = new TReusableBuffer()
    
      def someMethod(): Unit = {
        val buffer = reusableBuffer.get()
        try {
          // code that uses buffer
        } finally {
          buffer.reset()
        }
      }
    }
    initialSize

    The initial buffer size, default is 512.

    maxThriftBufferSize

    The buffer will reset if it exceeds max buffer size, default is 16K.

  10. class TReusableMemoryTransport extends TTransport

    Permalink

    A version of TMemoryTransport that allows for reuse in order to minimize object allocations.

  11. trait ThriftEnum extends TEnum

    Permalink
  12. trait ThriftException extends Exception

    Permalink
  13. case class ThriftExceptionResult[In, Out](input: In, response: Buf, result: Out) extends RichResponse[In, Out] with Product with Serializable

    Permalink

    A ThriftExceptionResult represents a response which throws thrift application exceptions defined in IDL.

    A ThriftExceptionResult represents a response which throws thrift application exceptions defined in IDL.

    result

    a result contains thrift application exceptions

  14. trait ThriftMethod extends AnyRef

    Permalink

    Metadata for a method for a Thrift service.

    Metadata for a method for a Thrift service.

    Comments below will use this example IDL:

    service ExampleService {
      i32 boringMethod(
        1: i32 input1,
        2: string input2
      )
    }
  15. trait ThriftResponse[Result] extends AnyRef

    Permalink
  16. trait ThriftService extends AnyRef

    Permalink

    A marker trait for interfaces that represent thrift services.

  17. trait ThriftStruct extends AnyRef

    Permalink
  18. trait ThriftStructCodec[T <: ThriftStruct] extends AnyRef

    Permalink

    A trait encapsulating the logic for encoding and decoding a specific thrift struct type.

  19. abstract class ThriftStructCodec3[T <: ThriftStruct] extends ThriftStructCodec[T]

    Permalink

    Introduced as a backwards compatible API bridge in Scrooge 3.

    Introduced as a backwards compatible API bridge in Scrooge 3. Scala generated structs extend from this class.

    See also

    ThriftStructCodec

  20. final class ThriftStructField[T <: ThriftStruct] extends AnyRef

    Permalink
  21. final class ThriftStructFieldInfo extends AnyRef

    Permalink

    Field information to be embedded in a generated struct's companion class.

    Field information to be embedded in a generated struct's companion class. Allows for reflection on field types.

  22. final class ThriftStructMetaData[T <: ThriftStruct] extends AnyRef

    Permalink

    A simple class for generic introspection on ThriftStruct classes.

  23. trait ThriftUnion extends AnyRef

    Permalink

    Unions are tagged with this trait as well as with ThriftStruct.

  24. final class ThriftUnionFieldInfo[UnionFieldType <: ThriftUnion with ThriftStruct, ContainedType] extends AnyRef

    Permalink

    Field information to be embedded in a generated union's companion class.

    Field information to be embedded in a generated union's companion class.

    UnionFieldType

    The type of the union field represented by this class

    ContainedType

    The type of the value contained in the union field represented by this class

  25. trait ToThriftService extends AnyRef

    Permalink

    A trait indicating that this can be converted to a ThriftService

Value Members

  1. object TArrayByteTransport

    Permalink

    TArrayByteTransport decodes Array[Byte] to primitive types This is a replacement transport optimized for Array[Byte] and the TLazyBinaryProtocol

    TArrayByteTransport decodes Array[Byte] to primitive types This is a replacement transport optimized for Array[Byte] and the TLazyBinaryProtocol

    NB. This class/transport is not thread safe, and contains mutable state.

  2. object TFieldBlob extends Serializable

    Permalink
  3. object TLazyBinaryProtocol

    Permalink

    This is an implementation of the LazyTProtocol trait in scrooge-core This is not thread safe and maintains state.

    This is an implementation of the LazyTProtocol trait in scrooge-core This is not thread safe and maintains state. It also heavily uses inline annotations and marks things as final where possible to avoid virtual indirects. Its in a benchmark package as a POC, we may want to do something a bit different when it comes to a version for scrooge-serializer or elsewhere. Though it is a fully functional protocol that will deserialize/serialize any thrift.

  4. object TReusableMemoryTransport

    Permalink
  5. object ThriftResponse

    Permalink
  6. object ThriftStruct

    Permalink
  7. object ThriftUtil

    Permalink
  8. package adapt

    Permalink

Ungrouped