Class ValueAndCoderLazySerializable<T>

java.lang.Object
org.apache.beam.runners.spark.translation.ValueAndCoderLazySerializable<T>
Type Parameters:
T - element type
All Implemented Interfaces:
Serializable

public final class ValueAndCoderLazySerializable<T> extends Object implements Serializable
A holder object that lets you serialize an element with a Coder with minimal wasted space. Supports both Kryo and Java serialization.

There are two different representations: a deserialized representation and a serialized representation.

The deserialized representation stores a Coder and the value. To serialize the value, we write a length-prefixed encoding of value, but do NOT write the Coder used.

The serialized representation just reads a byte array - the value is not deserialized fully. In order to get at the deserialized value, the caller must pass the Coder used to create this instance via getOrDecode(Coder). This reverts the representation back to the deserialized representation.

See Also: