Trait

com.twitter.scrooge

LazyTProtocol

Related Doc: package scrooge

Permalink

trait LazyTProtocol extends TProtocol

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.

Linear Supertypes
TProtocol, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. LazyTProtocol
  2. TProtocol
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def buffer: Array[Byte]

    Permalink

    Return the underlying Array[Byte] used in reading

  2. abstract def decodeBool(arr: Array[Byte], offset: Int): Boolean

    Permalink

    Given a backing Array[Byte] and offset, decode this type from it using this TProtocol's deserializer

  3. abstract def decodeByte(arr: Array[Byte], offset: Int): Byte

    Permalink

    Given a backing Array[Byte] and offset, decode this type from it using this TProtocol's deserializer

  4. abstract def decodeDouble(arr: Array[Byte], offset: Int): Double

    Permalink

    Given a backing Array[Byte] and offset, decode this type from it using this TProtocol's deserializer

  5. abstract def decodeI16(arr: Array[Byte], offset: Int): Short

    Permalink

    Given a backing Array[Byte] and offset, decode this type from it using this TProtocol's deserializer

  6. abstract def decodeI32(arr: Array[Byte], offset: Int): Int

    Permalink

    Given a backing Array[Byte] and offset, decode this type from it using this TProtocol's deserializer

  7. abstract def decodeI64(arr: Array[Byte], offset: Int): Long

    Permalink

    Given a backing Array[Byte] and offset, decode this type from it using this TProtocol's deserializer

  8. abstract def decodeString(arr: Array[Byte], offset: Int): String

    Permalink

    Given a backing Array[Byte] and offset, decode this type from it using this TProtocol's deserializer

  9. abstract def offset: Int

    Permalink

    Return the offset currently on the underlying array byte of the transport used in reading.

  10. abstract def offsetSkipBinary(): Int

    Permalink

    Skips the length of a string on the underlying transport Returns: The offset at which the string can be read.

  11. abstract def offsetSkipBool(): Int

    Permalink

    Skips the length of a boolean on the underlying transport Returns: The offset at which the boolean can be read.

  12. abstract def offsetSkipByte(): Int

    Permalink

    Skips the length of a byte on the underlying transport Returns: The offset at which the byte can be read.

  13. abstract def offsetSkipDouble(): Int

    Permalink

    Skips the length of a double on the underlying transport Returns: The offset at which the double can be read.

  14. abstract def offsetSkipI16(): Int

    Permalink

    Skips the length of a short on the underlying transport Returns: The offset at which the short can be read.

  15. abstract def offsetSkipI32(): Int

    Permalink

    Skips the length of a int on the underlying transport Returns: The offset at which the int can be read.

  16. abstract def offsetSkipI64(): Int

    Permalink

    Skips the length of a long on the underlying transport Returns: The offset at which the long can be read.

  17. abstract def offsetSkipString(): Int

    Permalink

    Skips the length of a string on the underlying transport Returns: The offset at which the string can be read.

  18. abstract def readBinary(): ByteBuffer

    Permalink
    Definition Classes
    TProtocol
    Annotations
    @throws( ... )
  19. abstract def readBool(): Boolean

    Permalink
    Definition Classes
    TProtocol
    Annotations
    @throws( ... )
  20. abstract def readByte(): Byte

    Permalink
    Definition Classes
    TProtocol
    Annotations
    @throws( ... )
  21. abstract def readDouble(): Double

    Permalink
    Definition Classes
    TProtocol
    Annotations
    @throws( ... )
  22. abstract def readFieldBegin(): TField

    Permalink
    Definition Classes
    TProtocol
    Annotations
    @throws( ... )
  23. abstract def readFieldEnd(): Unit

    Permalink
    Definition Classes
    TProtocol
    Annotations
    @throws( ... )
  24. abstract def readI16(): Short

    Permalink
    Definition Classes
    TProtocol
    Annotations
    @throws( ... )
  25. abstract def readI32(): Int

    Permalink
    Definition Classes
    TProtocol
    Annotations
    @throws( ... )
  26. abstract def readI64(): Long

    Permalink
    Definition Classes
    TProtocol
    Annotations
    @throws( ... )
  27. abstract def readListBegin(): TList

    Permalink
    Definition Classes
    TProtocol
    Annotations
    @throws( ... )
  28. abstract def readListEnd(): Unit

    Permalink
    Definition Classes
    TProtocol
    Annotations
    @throws( ... )
  29. abstract def readMapBegin(): TMap

    Permalink
    Definition Classes
    TProtocol
    Annotations
    @throws( ... )
  30. abstract def readMapEnd(): Unit

    Permalink
    Definition Classes
    TProtocol
    Annotations
    @throws( ... )
  31. abstract def readMessageBegin(): TMessage

    Permalink
    Definition Classes
    TProtocol
    Annotations
    @throws( ... )
  32. abstract def readMessageEnd(): Unit

    Permalink
    Definition Classes
    TProtocol
    Annotations
    @throws( ... )
  33. abstract def readSetBegin(): TSet

    Permalink
    Definition Classes
    TProtocol
    Annotations
    @throws( ... )
  34. abstract def readSetEnd(): Unit

    Permalink
    Definition Classes
    TProtocol
    Annotations
    @throws( ... )
  35. abstract def readString(): String

    Permalink
    Definition Classes
    TProtocol
    Annotations
    @throws( ... )
  36. abstract def readStructBegin(): TStruct

    Permalink
    Definition Classes
    TProtocol
    Annotations
    @throws( ... )
  37. abstract def readStructEnd(): Unit

    Permalink
    Definition Classes
    TProtocol
    Annotations
    @throws( ... )
  38. abstract def writeBinary(arg0: ByteBuffer): Unit

    Permalink
    Definition Classes
    TProtocol
    Annotations
    @throws( ... )
  39. abstract def writeBool(arg0: Boolean): Unit

    Permalink
    Definition Classes
    TProtocol
    Annotations
    @throws( ... )
  40. abstract def writeByte(arg0: Byte): Unit

    Permalink
    Definition Classes
    TProtocol
    Annotations
    @throws( ... )
  41. abstract def writeDouble(arg0: Double): Unit

    Permalink
    Definition Classes
    TProtocol
    Annotations
    @throws( ... )
  42. abstract def writeFieldBegin(arg0: TField): Unit

    Permalink
    Definition Classes
    TProtocol
    Annotations
    @throws( ... )
  43. abstract def writeFieldEnd(): Unit

    Permalink
    Definition Classes
    TProtocol
    Annotations
    @throws( ... )
  44. abstract def writeFieldStop(): Unit

    Permalink
    Definition Classes
    TProtocol
    Annotations
    @throws( ... )
  45. abstract def writeI16(arg0: Short): Unit

    Permalink
    Definition Classes
    TProtocol
    Annotations
    @throws( ... )
  46. abstract def writeI32(arg0: Int): Unit

    Permalink
    Definition Classes
    TProtocol
    Annotations
    @throws( ... )
  47. abstract def writeI64(arg0: Long): Unit

    Permalink
    Definition Classes
    TProtocol
    Annotations
    @throws( ... )
  48. abstract def writeListBegin(arg0: TList): Unit

    Permalink
    Definition Classes
    TProtocol
    Annotations
    @throws( ... )
  49. abstract def writeListEnd(): Unit

    Permalink
    Definition Classes
    TProtocol
    Annotations
    @throws( ... )
  50. abstract def writeMapBegin(arg0: TMap): Unit

    Permalink
    Definition Classes
    TProtocol
    Annotations
    @throws( ... )
  51. abstract def writeMapEnd(): Unit

    Permalink
    Definition Classes
    TProtocol
    Annotations
    @throws( ... )
  52. abstract def writeMessageBegin(arg0: TMessage): Unit

    Permalink
    Definition Classes
    TProtocol
    Annotations
    @throws( ... )
  53. abstract def writeMessageEnd(): Unit

    Permalink
    Definition Classes
    TProtocol
    Annotations
    @throws( ... )
  54. abstract def writeRaw(buf: Array[Byte], offset: Int, len: Int): Unit

    Permalink

    Take a segment of an Array[Byte] and presume it is already encoded for this transport and just copy it down.

    Take a segment of an Array[Byte] and presume it is already encoded for this transport and just copy it down.

    This is useful if we have a cached set of bytes used when deserializing a field or struct

  55. abstract def writeSetBegin(arg0: TSet): Unit

    Permalink
    Definition Classes
    TProtocol
    Annotations
    @throws( ... )
  56. abstract def writeSetEnd(): Unit

    Permalink
    Definition Classes
    TProtocol
    Annotations
    @throws( ... )
  57. abstract def writeString(arg0: String): Unit

    Permalink
    Definition Classes
    TProtocol
    Annotations
    @throws( ... )
  58. abstract def writeStructBegin(arg0: TStruct): Unit

    Permalink
    Definition Classes
    TProtocol
    Annotations
    @throws( ... )
  59. abstract def writeStructEnd(): Unit

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

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 clone(): AnyRef

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

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  10. def getTransport(): TTransport

    Permalink
    Definition Classes
    TProtocol
  11. def hashCode(): Int

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

    Permalink
    Definition Classes
    Any
  13. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  14. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  16. def reset(): Unit

    Permalink
    Definition Classes
    TProtocol
  17. final def synchronized[T0](arg0: ⇒ T0): T0

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

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

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

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

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

Inherited from TProtocol

Inherited from AnyRef

Inherited from Any

Ungrouped