Package

com.twitter

scrooge

Permalink

package scrooge

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. scrooge
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. trait EnumItemUnknown extends ThriftEnum

    Permalink

    Base class for unknown enum items.

    Base class for unknown enum items. The implementations are used for backward compatibility during enum update at producer.

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

    Permalink
  3. class HeaderMap extends AnyRef

    Permalink

    Immutable Map of Header Keys Strings to Seq of Header Buf Values.

  4. 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.

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

    Permalink

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

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

    exception

    a TApplicationException of protocol error

    Note

    while this is a public API, it is only intended for use by the generated code.

  6. class Request[+Args <: ThriftStruct] extends AnyRef

    Permalink
  7. class Response[+SuccessType] extends AnyRef

    Permalink
  8. 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

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

    Permalink

    A SuccessfulResponse represents a successful response.

    A SuccessfulResponse represents a successful response.

    result

    a result contains deserialized successful response

    Note

    while this is a public API, it is only intended for use by the generated code.

  10. final class TArrayByteTransport extends TTransport

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

    Permalink

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

  12. class TLazyBinaryProtocol extends TBinaryProtocol with LazyTProtocol

    Permalink
  13. 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.

  14. class TReusableMemoryTransport extends TTransport

    Permalink

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

  15. trait ThriftEnum extends TEnum

    Permalink
  16. trait ThriftEnumObject[T <: ThriftEnum] extends AnyRef

    Permalink
  17. trait ThriftException extends Exception

    Permalink
  18. case class ThriftExceptionResponse[In, Out](input: In, response: Buf, ex: ThriftException) extends RichResponse[In, Out] with Product with Serializable

    Permalink

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

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

    ex

    the thrift application exception

    Note

    while this is a public API, it is only intended for use by the generated code.

  19. 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
      )
    }
  20. trait ThriftResponse[Result] extends AnyRef

    Permalink
  21. trait ThriftStruct extends AnyRef

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

    Permalink

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

  23. 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

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

    Permalink
  25. 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.

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

    Permalink

    A simple class for generic introspection on ThriftStruct classes.

  27. trait ThriftUnion extends AnyRef

    Permalink

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

  28. 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

  29. trait ValidatingThriftStruct[T <: ThriftStruct] extends ThriftStruct with HasThriftStructCodec3[T]

    Permalink

    This trait extends from HasThriftStructCodec3 and ThriftStruct.

    This trait extends from HasThriftStructCodec3 and ThriftStruct. It should be safe to call "validatingStruct._codec.validateNewInstance(validatingStruct)" on any validatingStruct that implements ValidatingThriftStruct. We take advantage of this fact in the validateField method in ValidatingThriftStructCodec3.

    A method could be added to this trait that does this (with more type safety), but we want to avoid adding unnecessary methods to thrift structs.

  30. abstract class ValidatingThriftStructCodec3[T <: ThriftStruct] extends ThriftStructCodec3[T]

    Permalink

Value Members

  1. val AsClosableMethodName: String

    Permalink

    A string representing reserved method name asClosable

  2. object Request

    Permalink
  3. object Response

    Permalink
  4. 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.

  5. object TFieldBlob extends Serializable

    Permalink
  6. 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.

  7. object TReusableMemoryTransport

    Permalink
  8. object ThriftResponse

    Permalink
  9. object ThriftStruct

    Permalink
  10. object ThriftUtil

    Permalink
  11. package adapt

    Permalink
  12. package validation

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped