com.twitter.scalding.serialization

Serialization

trait Serialization[T] extends Equiv[T] with Hashing[T] with Serializable

This is a base Input/OutputStream-based serialization typeclass This is useful for value serialization in hadoop when we don't need to do key sorting for partitioning.

This serialization typeclass must serialize equivalent objects identically to be lawful. Serialization should be the same on all JVMs run at any time, in other words, Serialization is a pure function. Given that constraint, we can always get an Equiv and Hashing from a Serialization (by doing byte-wise equivalence or byte-wise hashing).

A serialization always gives a hash because one can just serialize and then hash the bytes. You might prefer another implementation. This must satisfy: (!equiv(a, b)) || (hash(a) == hash(b))

Linear Supertypes
Hashing[T], Equiv[T], Serializable, Serializable, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Serialization
  2. Hashing
  3. Equiv
  4. Serializable
  5. Serializable
  6. AnyRef
  7. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def dynamicSize(t: T): Option[Int]

    returns Some if the size is cheap to calculate.

    returns Some if the size is cheap to calculate. otherwise the caller should just serialize into an ByteArrayOutputStream

  2. abstract def equiv(x: T, y: T): Boolean

    Definition Classes
    Equiv
  3. abstract def hash(x: T): Int

    Definition Classes
    Hashing
  4. abstract def read(in: InputStream): Try[T]

  5. abstract def staticSize: Option[Int]

    If all items have a static size, this returns Some, else None NOTE: lawful implementations that return Some here much return Some on dynamicSize so callers don't need to check both when they have an instance.

  6. abstract def write(out: OutputStream, t: T): Try[Unit]

Concrete Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

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

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

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

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

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

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

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

    Definition Classes
    AnyRef
  15. final def notify(): Unit

    Definition Classes
    AnyRef
  16. final def notifyAll(): Unit

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

    Definition Classes
    AnyRef
  18. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Hashing[T]

Inherited from Equiv[T]

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped