Coders
to specify how data is encoded to and decoded from byte strings.See: Description
| Interface | Description |
|---|---|
| Coder<T> |
A
Coder<T> defines how to encode and decode values of type T into
byte streams. |
| CoderFactory |
A
CoderFactory creates coders and decomposes values. |
| CoderProvider |
A
CoderProvider may create a Coder for
any concrete class. |
| DelegateCoder.CodingFunction<InputT,OutputT> |
A
CodingFunction<InputT, OutputT> is a serializable
function from InputT to OutputT that may throw any Exception. |
| Class | Description |
|---|---|
| AtomicCoder<T> | |
| AvroCoder<T> |
A
Coder using Avro binary format. |
| BigDecimalCoder |
A
BigDecimalCoder encodes a BigDecimal as an integer scale encoded with
VarIntCoder and a BigInteger encoded using BigIntegerCoder. |
| BigEndianIntegerCoder |
A
BigEndianIntegerCoder encodes Integers in 4 bytes, big-endian. |
| BigEndianLongCoder |
A
BigEndianLongCoder encodes Longs in 8 bytes, big-endian. |
| BigIntegerCoder |
A
BigIntegerCoder encodes a BigInteger as a byte array containing the big endian
two's-complement representation, encoded via ByteArrayCoder. |
| ByteArrayCoder |
A
Coder for byte[]. |
| ByteCoder | |
| ByteStringCoder |
A
Coder for ByteString objects based on their encoded Protocol Buffer form. |
| Coder.Context |
The context in which encoding or decoding is being done.
|
| Coder.NonDeterministicException |
Exception thrown by
Coder.verifyDeterministic() if the encoding is
not deterministic, including details of why the encoding is not deterministic. |
| CoderFactories |
Static utility methods for creating and working with
Coders. |
| CoderProviders |
Static utility methods for working with
CoderProviders. |
| CoderRegistry |
A
CoderRegistry allows registering the default Coder to use for a Java class,
and looking up and instantiating the default Coder for a Java type. |
| CollectionCoder<T> | |
| CustomCoder<T> |
An abstract base class for writing a
Coder class that encodes itself via Java
serialization. |
| DelegateCoder<T,IntermediateT> |
A
DelegateCoder<T, IntermediateT> wraps a Coder for IntermediateT and
encodes/decodes values of type T by converting
to/from IntermediateT and then encoding/decoding using the underlying
Coder<IntermediateT>. |
| DeterministicStandardCoder<T> |
A
DeterministicStandardCoder is a StandardCoder that is
deterministic, in the sense that for objects considered equal
according to Object.equals(Object), the encoded bytes are
also equal. |
| DoubleCoder |
A
DoubleCoder encodes Double values in 8 bytes using Java serialization. |
| DurationCoder | |
| InstantCoder | |
| IterableCoder<T> | |
| IterableLikeCoder<T,IterableT extends Iterable<T>> |
An abstract base class with functionality for assembling a
Coder for a class that implements Iterable. |
| JAXBCoder<T> |
A coder for JAXB annotated objects.
|
| KvCoder<K,V> |
A
KvCoder encodes KVs. |
| ListCoder<T> | |
| MapCoder<K,V> | |
| NullableCoder<T> |
A
NullableCoder encodes nullable values of type T using a nested
Coder<T> that does not tolerate null values. |
| SerializableCoder<T extends Serializable> |
A
Coder for Java classes that implement Serializable. |
| SetCoder<T> | |
| StandardCoder<T> |
An abstract base class to implement a
Coder that defines equality, hashing, and printing
via the class name and recursively using StandardCoder.getComponents(). |
| StringDelegateCoder<T> |
A
Coder that wraps a Coder<String>
and encodes/decodes values via string representations. |
| StringUtf8Coder | |
| StructuralByteArray |
A wrapper around a byte[] that uses structural, value-based
equality rather than byte[]'s normal object identity.
|
| TableRowJsonCoder | |
| TextualIntegerCoder |
A
Coder that encodes Integer Integers as the ASCII bytes of
their textual, decimal, representation. |
| VarIntCoder | |
| VarLongCoder | |
| VoidCoder |
| Enum | Description |
|---|---|
| CannotProvideCoderException.ReasonCode |
Indicates the reason that
Coder inference failed. |
| Exception | Description |
|---|---|
| CannotProvideCoderException |
The exception thrown when a
CoderProvider cannot
provide a Coder that has been requested. |
| CoderException |
An
Exception thrown if there is a problem encoding or decoding a value. |
| Annotation Type | Description |
|---|---|
| DefaultCoder |
The
DefaultCoder annotation
specifies a default Coder class to handle encoding and decoding
instances of the annotated class. |
Coders
to specify how data is encoded to and decoded from byte strings.
During execution of a Pipeline, elements in a
PCollection
may need to be encoded into byte strings.
This happens both at the beginning and end of a pipeline when data is read from and written to
persistent storage and also during execution of a pipeline when elements are communicated between
machines.
Exactly when PCollection elements are encoded during execution depends on which
PipelineRunner is being used and how that runner
chooses to execute the pipeline. As such, Dataflow requires that all PCollections have an
appropriate Coder in case it becomes necessary. In many cases, the Coder can be inferred from
the available Java type
information and the Pipeline's CoderRegistry. It
can be specified per PCollection via
PCollection.setCoder(Coder) or per type using the
DefaultCoder annotation.
This package provides a number of coders for common types like Integer,
String, and List, as well as coders like
AvroCoder that can be used to encode many custom
types.